Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3) If you are not familiar with Gerrit workflow, please get a quick tutorial on itcheck out this tutorialGerrit Workflow for System Test Development.

...

Because we are targeting all tests to be automated in an CI enva Continuous Integration (CI) environment, there are several fundamental principles that we have to adhere to when writing test cases and driver files:

  1. Portability - allowing allow the test case to be run in other similar test environments; at the same time easier for us to merge the community contributed test in , as well as merging community contributed tests into our production environment;.
  2. Stability - the test should take in considerations of must handle various environment (e.g. response time of starting onos ONOS on VMs vs. on Bare metalsMetals), therefore, ; test case should must have stability in passing or failing results;
  3. Clarity - we should try all efforts strive to make the Python cases easy simple to understand and followcomprehend;
  4. Debuggability Debugging - use logging capability capabilities liberally and to catch all cases of exceptions, and make sure that to ensure test failures don't go silently.

In order to achieve the these objectives, it is essential to have a good understanding of the Jenkins - TestON interactions and abstractions in running a test case. The following diagram illustrates the interaction and abstraction of TestON and Jenkins.

 

Ydiagram
toolbartrue
nameTest_abstraction
display-formatimage

TestON Scripting General Guidelines:

  • Pre-requisites

...

  • and testbed environment setting - should be set manually, and/or with CI framework

...

  • (i.e

...

  • . through Jenkins jobs):

      ...

        • First Time Setup:
          1. TestStations:
            • should have a root account of "sdn" (password: rocks) to run TestON cli (so all hosts in the test infrastructure has the

      ...

            • same sdn/rocks

      ...

            •  credential)
            • should be able to

      ...

            • login to all nodes specified in the cell. See this guide to setup ssh keys.

      ...

          1. "ONOS Bench" and cells:

      ...

      ...

          1. Mininet (OCN) host: set up

      ...

      ...

          1. Note: it is possible to run "TestStation", "onos Bench" and "Mininet" on the same host, with .topo file set up accordingly.
        • General Steps:
          1. Clean up TestON and

      ...

          1. Mininet before each test run.
          2. Set OnosSystemTest version, and update OnosSystemTest by typing: "git pull

      ...

      ...

      ...

          1. Build ONOS.
          2. Set up ONOS Java Virtual Machine (JVM)

      ...

          1. related configurations if the default configuration is not desirable.
          2. Run test cases

      ...

          1. .  See scripting guidelines below.

      ...

        • Optional

      ...

        • :
          1. Run post-test tasks, such as

      ...

          1. :
            • Data storage
            • Result publishing
          2. Teardown by uninstalling ONOS and cleaning up Mininet.

      • OnosSystemTest/TestON Script should perform in:
        1. Test suite naming, see Test Plans.
        2. README file
          • Should describe the test topology to run the default test case.
          • Should explain the main goal of the test
          • Provide any additional requirements needed to run the test
        3. testname.params
          • Use

      ...

          • environment variable names to reference to components - no static IP's
          • Move any hardcoded values to this file - e.g. sleep times, counters, file names... etc.
          • If any modifications need to be made to the test, it should be done in this file
        1. testname.topo
          • Use

      ...

          • environment variable names to reference to components - no static IP's;
          • Leave out any passwords for the login information - Password-less login should be setup
        1. testname.py
          • Log

      ...

          • ONOS version/commit.
          • Set prompt, terminal type

      ...

          • Handle test case dependencies
          • Explicit

      ...

          • ONOS cell creation and setting
          • Explicit activation of bundles/apps
          • Test case specific app configurations for non-default values - cell apps should be specified in the params file
          • Test dependencies, Mininet topologies, and helper functions should be stored in the Dependency

      ...

          • directory located in the test

      ...

          • directory.
          • Test log should log the relevant config information - Log is cheap; be as verbose as possible to help the debugging process
          • Avoid static reference to paths, files - put any static references in the .params file
          • Check and log summary of onos exceptions, errors, warnings - Ideally, this should

      ...

          • be done after each test case
          • Handling of Test results - write to test log and

      ...

          • /tmp file for post-test processing purposes - Try to assert on every test result so that it can be shown on the wiki