Package TestON :: Package examples :: Package ExperimentTest :: Module ExperimentTest
[hide private]
[frames] | no frames]

Source Code for Module TestON.examples.ExperimentTest.ExperimentTest

 1  #!/usr/bin/env python 
 2  '''  
 3  Created on 26-Nov-2012 
 4       
 5  @author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com) 
 6   
 7  Testing of the Experimental Mode 
 8   
 9  ofautomation>run ExperimentTest example 1 
10      will execute this example. 
11  ''' 
12 -class ExperimentTest:
13 ''' 14 Testing of the Experimental Mode 15 16 ''' 17
18 - def __init__(self):
19 self.default = ""
20
21 - def CASE1(self,main):
22 ''' 23 Testing the configuration of the host by using checkIP functionof Mininet driver 24 ''' 25 main.EXPERIMENTAL_MODE = main.TRUE 26 main.case("Testing the configuration of the host") 27 main.step("Host IP Checking using checkIP") 28 result = main.Mininet1.checkIP(main.params['CASE1']['destination']) 29 main.step("Verifying the result") 30 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured") 31 main.step("Calling Non Existing API for Experimental Mode") 32 testReturn = main.POX2.verify_flow(returns=main.TRUE) 33 utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
34
35 - def CASE2(self,main):
36 ''' 37 Testing of the reachability of the hosts by using pingall of Mininet driver 38 ''' 39 main.EXPERIMENTAL_MODE = main.TRUE 40 main.case("Testing Reachabilty of all the hosts") 41 main.step("Checking Hosts reachability by using pingall") 42 result = main.Mininet1.pingall() 43 main.step("Verifying the result") 44 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="All hosts are reacchable",onfail="Hosts are not reachable") 45 main.step("Calling Non Existing API for Experimental Mode") 46 testReturn = main.Mininet1.verify_flow(returns=main.TRUE) 47 utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
48