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      TestON is free software: you can redistribute it and/or modify 
 8      it under the terms of the GNU General Public License as published by 
 9      the Free Software Foundation, either version 2 of the License, or 
10      (at your option) any later version. 
11   
12      TestON is distributed in the hope that it will be useful, 
13      but WITHOUT ANY WARRANTY; without even the implied warranty of 
14      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
15      GNU General Public License for more details. 
16   
17      You should have received a copy of the GNU General Public License 
18      along with TestON.  If not, see <http://www.gnu.org/licenses/>. 
19   
20  ''' 
21 -class CaseParams:
22 ''' 23 This example shows the usage of the CASE level parameters, in params file the 24 [[CASE]] 25 'destination' = 'h2' 26 27 We can get this CASE level parameter like : 28 main.params['CASE1']['destination'] 29 30 31 cd ~/bin/ 32 ofautomation>run CaseParams example 1 33 will execute this example. 34 ''' 35
36 - def __init__(self):
37 self.default = ""
38
39 - def CASE1(self,main):
40 ''' 41 This test case will showcase usage of CASE level parameters to specify the host as h2 42 ''' 43 main.case("Using CASE level parameters to specify the host as h2") 44 main.step("Host IP Checking using checkIP") 45 result = main.Mininet1.checkIP(main.params['CASE1']['destination']) 46 main.step("Verifying the result") 47 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
48 49
50 - def CASE2(self,main):
51 ''' 52 This test case will showcase usage of CASE level parameters to specify the host as h3 53 ''' 54 main.case("Using CASE level parameters to specify the host as h3") 55 main.step("Host IP Checking using checkIP") 56 result = main.Mininet1.checkIP(main.params['CASE2']['destination']) 57 main.step("Verifying the result") 58 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
59