Versions Compared

Key

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

...

The .topo file includes the log in info of the machine that the ONOS and Mininet will be run. In this example, the test runs using two VM machine with host IP, user name , password as well as the driver that will be used are defined for each of the component. The <connect_order> tag is the connection order that the TestON will execute. The formatting of the .topo file must be followed correctly. The space character inside every empty tag indicates that a blank information will be passed along in the component otherwise the test would give an error. The <type> tag is use to specify which driver the component will use, the driver name is case sensitive. The <args> tag in the MIninet component is necessary and should be kept even though it has empty arguments. In the Topo file, all the tags are necessary but the driver specific tags can be placed between the components tags.

...

The python file defines all the test cases for the test. In the PingallExample and every other test in TestON, a utility class is called to assert each cases by the end of the case. Although not required, It is a good practice to follow a coding style in to your test scripts to improved readability of your code. Check out our built in code checker using pep8 coding style at /TestON/bin/codecheck. All of the TestON test follow the pep8 coding style.

Every case results in your test should be asserted at the end of the case using TestON utilities class. There are different kinds of assert: equals,matches,greater,lesser. Equals assert is used most of the time because it is efficient and easy to use. Below is an example of assert in case 3 of PingallExample.py. 

Code Block
 # REACTIVE FWD test
        pingResult = main.FALSE
        time1 = time.time()
        pingResult = main.Mininet1.pingall()
        time2 = time.time()
        main.log.info( "Time for pingall: %2f seconds" % ( time2 - time1 ) )

        # uninstall onos-app-fwd
        main.log.info( "Uninstall reactive forwarding app" )
        main.ONOScli1.featureUninstall( "onos-app-fwd" )

        utilities.assert_equals( expect=main.TRUE, actual=pingResult,
                                 onpass="All hosts are reachable",
                                 onfail="Some pings failed" )

 

Stuck? Found a bug? Questions?

...