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