This is an archive of the ONOS 1.4 wiki. For the current ONOS wiki, look here.

A few quick tips to get started contributing to OnosSystemTest:

1) Subscribe to the Testing mailing list <onos-test@onosproject.org>. All mailing lists can be found here.

2) Sign up for an account on onosproject.org so as to be able to commit test codes to gerrit.onosproject.org.

TestON Scripting General Guidelines:

Due to the many components required for system tests, it is possible that one tester's environment can be drastically different from another's.  In ONLAB, we have a production test environment to run the current published test suites. In time, we expect the community to contribute to improving the test suites, or creating new test suites that will also be run on this env. We set up a set of test development guidelines to achieve the following objectives:

  1. Portability: 

    • testers should be able to clone the tests; set up system environment variables accordingly; and run the tests without test script modifications;

    • contributors should be able to commit changes and new test suites to be run on ONLAB production testbed without test script modifications.

  2. Stability:

    • robustness - i.e. minimize script-causing test failures.

  3. Clarity:

    • tests should produce useful onos failure information for further debug;

    • reports should provide a glance of onos health from each suite;

    • Standardize driver & tests documentation.

Note: Due to the high fluidity of current onos features and APIs, OnosSystemTest version will track with onos version.

Guidelines:

  1. Pre-requisites  and testbed environment setting - should be set manually, and/or with CI framework, e.g. through Jenkins jobs:
    1.  (First time setup only)TestStations:
      • should have a root account of "admin" to run TestON cli
      • should be able to logon to all nodes specified in the cell. See this guide to setup ssh keys.
    2. (First time setup only)"onos Bench" and cells: set up per "ONOS from Scratch"
    3. (First time setup only)Mininet (OCN) host: set up per "Mininet Walkthrough"
      Note: it is possible to run "TestStation", "onos Bench" and "Mininet" on the same host, with .topo file set up accordingly.
    4. Clean up TestON and MN before each test run
    5. Set OnosSystemTest version, and git pull "OnosSystemTest" from gerrit.onosproject.org
    6. Set onos version, and git pull onos from gerrit.onosproject.org
    7. Compile/build onos
    8. Setup onos JVM related configurations if default is not desirable
    9. Run test cases - see Scripting guidelines below
    10. (Optional) Run post-test tasks, such as data storage, result publishing, etc.
    11. (Optional)Teardown: onos uninstall and mn cleanup.

  1. 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 env 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
    4. testname.topo
      • Use env variable names to reference to components - no static IP's;
      • Leave out any passwords for the login information - Password-less login should be setup
    5. testname.py
      • Log onos version/ commit
      • Set prompt, terminal type
      • Handel 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 should be stored in the Dependency folder located in the test folder - Mininet topologies and helper functions should all be in the Dependency folder
      • 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


  • No labels