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

Source Code for Module TestON.examples.CaseParams.CaseParams

 1  #!/usr/bin/env python 
 2  ''' 
 3  Created on 26-Nov-2012 
 4   
 5  @author: Anil Kumar (anilkumar.s@paxterrasolutions.com) 
 6  '''   
7 -class CaseParams:
8 ''' 9 This example shows the usage of the CASE level parameters, in params file the 10 [[CASE]] 11 'destination' = 'h2' 12 13 We can get this CASE level parameter like : 14 main.params['CASE1']['destination'] 15 16 17 cd ~/bin/ 18 ofautomation>run CaseParams example 1 19 will execute this example. 20 ''' 21
22 - def __init__(self):
23 self.default = ""
24
25 - def CASE1(self,main):
26 ''' 27 This test case will showcase usage of CASE level parameters to specify the host as h2 28 ''' 29 main.case("Using CASE level parameters to specify the host as h2") 30 main.step("Host IP Checking using checkIP") 31 result = main.Mininet1.checkIP(main.params['CASE1']['destination']) 32 main.step("Verifying the result") 33 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
34 35
36 - def CASE2(self,main):
37 ''' 38 This test case will showcase usage of CASE level parameters to specify the host as h3 39 ''' 40 main.case("Using CASE level parameters to specify the host as h3") 41 main.step("Host IP Checking using checkIP") 42 result = main.Mininet1.checkIP(main.params['CASE2']['destination']) 43 main.step("Verifying the result") 44 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
45