blob: c7e0915640b800c23555b6ca1188634e0a082100 [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001#!/usr/bin/env python
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07002"""
adminbae64d82013-08-01 10:50:15 -07003Created on 28-Nov-2012
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07004Copyright 2012 Open Networking Foundation ( ONF )
adminbae64d82013-08-01 10:50:15 -07005
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07006author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
adminbae64d82013-08-01 10:50:15 -07007
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07008Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
9the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
10or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
adminbae64d82013-08-01 10:50:15 -070011
12 TestON is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 2 of the License, or
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070015 ( at your option ) any later version.
adminbae64d82013-08-01 10:50:15 -070016
17 TestON is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
Jon Hall4ba53f02015-07-29 13:07:41 -070023 along with TestON. If not, see <http://www.gnu.org/licenses/>.
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070024"""
adminbae64d82013-08-01 10:50:15 -070025class StepParams:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070026
27 """
adminbae64d82013-08-01 10:50:15 -070028 This example shows the usage of the STEP level parameters, in params file the
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070029 [ [ CASE1 ] ]
30 [ [ [ STEP1 ] ] ]
adminbae64d82013-08-01 10:50:15 -070031 'host' = 'h2'
Jon Hall4ba53f02015-07-29 13:07:41 -070032
adminbae64d82013-08-01 10:50:15 -070033 We can get this STEP level parameter like :
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070034 main.params[ 'CASE1' ][ 'STEP1' ][ 'host' ]
Jon Hall4ba53f02015-07-29 13:07:41 -070035
36
37 ofautomation>run StepParams example 1
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070038 """
39 def __init__( self ):
adminbae64d82013-08-01 10:50:15 -070040 self.default = ""
Jon Hall4ba53f02015-07-29 13:07:41 -070041
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070042 def CASE1( self, main ):
43 """
adminbae64d82013-08-01 10:50:15 -070044 This example will showcase the usage of STEP level parameters to specify the host as h2
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070045 """
46 main.case( "Using STEP level parameters to specify the host as h2" )
47 main.step( "Host IP Checking using checkIP" )
48 result = main.Mininet1.checkIP( main.params[ 'CASE1' ][ 'STEP1' ][ 'host' ] )
49 main.step( "Verifying the result" )
50 utilities.assert_equals( expect=main.TRUE, actual=result, onpass="Host h2 IP address configured", onfail="Host h2 IP address didn't configured" )
Jon Hall4ba53f02015-07-29 13:07:41 -070051
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070052 def CASE2( self, main ):
53 """
adminbae64d82013-08-01 10:50:15 -070054 This example will showcase the usage of STEP level parameters to specify the host as h3
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070055 """
56 main.case( "Using STEP level parameters to specify the host as h3" )
57 main.step( "Host IP Checking using checkIP" )
58 result = main.Mininet1.checkIP( main.params[ 'CASE2' ][ 'STEP1' ][ 'host' ] )
59 main.step( "Verifying the result" )
60 utilities.assert_equals( expect=main.TRUE, actual=result, onpass="Host h3 IP address configured", onfail="Host h3 IP address didn't configured" )