Page tree

Versions Compared


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


Code Block
233:   msg['From'] = ''
250:   smtp = smtplib.SMTP('Hostname/IP')
252:   smtp.login('','password')

Test files

You can see test files in the /TestON/tests/ folder. The name of the test folder should be the name of the test as well as all the files .Each of the tests has a unique set of files defined below:

.params - This file contains user defined variables for the test case. Also specify the order of which test cases to run.

.topo - This file defines all the components and options that Test-ON will use to execute its test. The machine's user name, password, IP addresses, drivers, and/or Mininet's topology would be specified in this file. ( Please use the exact syntax/format in the topo file. The space character in the xml tags is important even though you are not defining anything in the tag Eg. <COMPONENTS> </COMPONENTS>)

.py - This is where all of the test cases are written. It calls upon functions implemented in the respective drivers to create a progression of events that produces some sort of pass/fail outcome.

PingallExample test

This test uses pingall function to ping all the host in the network. The test is successful if all the hosts are reachable.

  • CASE1: Starts up ONOS, from pulling the latest code to running ONOS, also starts the a Mininet instance. Reports success if ONOS did not start up correctly.
  • CASE2: Assign mastership to controller. Reports success if all the switches are assigned to a controller.
  • CASE3: Installs onos-app-fwd (reactive forwarding app) and does pingall. Reports success if all hosts are reachable.

Params File

Below is the PingallExample.params file:

Code Block


The <testcases> tag defines the order in which the test cases in the .py file are executed. The <cellName> is the name of the cell when setting up your environment.

Topo File

Below is the PingallExample.topo file:


Code Block

            <password> </password>

            <password> </password>


            <password> </password>
                #Specify the Option for mininet
                <arg1> --topo=tree,3,3 </arg1>
                <arg2> </arg2>
                <arg3> </arg3>
                <controller> remote </controller>


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 name user name and password 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 , if that space character isn't there, and would stop the test. The <args> tag in the MIninet component is necessary and should be kept even though have empty arguments.

NOTE: It is important to check the log in info carefully for each component as incorrect information would result to test failure.