blob: a04c548f39cbd12177d30c9b61bc60ce48c77f4b [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 26-Nov-2012
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07004Copyright 2012 Open Networking Foundation ( ONF )
Jon Hall4ba53f02015-07-29 13:07:41 -07005
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07006author:: Raghav Kashyap( raghavkashyap@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/>.
adminbae64d82013-08-01 10:50:15 -070024
25Testing of the Experimental Mode
26
27ofautomation>run ExperimentTest example 1
28 will execute this example.
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070029"""
adminbae64d82013-08-01 10:50:15 -070030class ExperimentTest:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070031
32 """
Jon Hall4ba53f02015-07-29 13:07:41 -070033 Testing of the Experimental Mode
34
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070035 """
36 def __init__( self ):
adminbae64d82013-08-01 10:50:15 -070037 self.default = ""
Jon Hall4ba53f02015-07-29 13:07:41 -070038
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070039 def CASE1( self, main ):
40 """
adminbae64d82013-08-01 10:50:15 -070041 Testing the configuration of the host by using checkIP functionof Mininet driver
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070042 """
adminbae64d82013-08-01 10:50:15 -070043 main.EXPERIMENTAL_MODE = main.TRUE
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070044 main.case( "Testing the configuration of the host" )
45 main.step( "Host IP Checking using checkIP" )
46 result = main.Mininet1.checkIP( main.params[ 'CASE1' ][ 'destination' ] )
47 main.step( "Verifying the result" )
48 utilities.assert_equals( expect=main.TRUE, actual=result, onpass="Host h2 IP address configured", onfail="Host h2 IP address didn't configured" )
49 main.step( "Calling Non Existing API for Experimental Mode" )
50 testReturn = main.POX2.verify_flow( returns=main.TRUE )
51 utilities.assert_equals( expect=main.TRUE, actual=testReturn, onpass="Host h2 IP address configured", onfail="Host h2 IP address didn't configured" )
adminbae64d82013-08-01 10:50:15 -070052
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070053 def CASE2( self, main ):
54 """
adminbae64d82013-08-01 10:50:15 -070055 Testing of the reachability of the hosts by using pingall of Mininet driver
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070056 """
adminbae64d82013-08-01 10:50:15 -070057 main.EXPERIMENTAL_MODE = main.TRUE
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070058 main.case( "Testing Reachabilty of all the hosts" )
59 main.step( "Checking Hosts reachability by using pingall" )
adminbae64d82013-08-01 10:50:15 -070060 result = main.Mininet1.pingall()
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070061 main.step( "Verifying the result" )
62 utilities.assert_equals( expect=main.TRUE, actual=result, onpass="All hosts are reacchable", onfail="Hosts are not reachable" )
63 main.step( "Calling Non Existing API for Experimental Mode" )
64 testReturn = main.Mininet1.verify_flow( returns=main.TRUE )
65 utilities.assert_equals( expect=main.TRUE, actual=testReturn, onpass="Host h2 IP address configured", onfail="Host h2 IP address didn't configured" )