admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 2 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 3 | Created on 26-Nov-2012 |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 4 | Copyright 2012 Open Networking Foundation ( ONF ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 5 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 6 | author:: Raghav Kashyap( raghavkashyap@paxterrasolutions.com ) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 7 | |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 8 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 9 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 10 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 11 | |
| 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 Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 15 | ( at your option ) any later version. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 16 | |
| 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 Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 23 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 24 | |
| 25 | Testing of the Experimental Mode |
| 26 | |
| 27 | ofautomation>run ExperimentTest example 1 |
| 28 | will execute this example. |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 29 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 30 | class ExperimentTest: |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 31 | |
| 32 | """ |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 33 | Testing of the Experimental Mode |
| 34 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 35 | """ |
| 36 | def __init__( self ): |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 37 | self.default = "" |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 38 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 39 | def CASE1( self, main ): |
| 40 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 41 | Testing the configuration of the host by using checkIP functionof Mininet driver |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 42 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 43 | main.EXPERIMENTAL_MODE = main.TRUE |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 44 | 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" ) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 52 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 53 | def CASE2( self, main ): |
| 54 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 55 | Testing of the reachability of the hosts by using pingall of Mininet driver |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 56 | """ |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 57 | main.EXPERIMENTAL_MODE = main.TRUE |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 58 | main.case( "Testing Reachabilty of all the hosts" ) |
| 59 | main.step( "Checking Hosts reachability by using pingall" ) |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 60 | result = main.Mininet1.pingall() |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 61 | 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" ) |