admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2 | ''' |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 3 | Created on 26-Nov-2012 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 5 | @author: Raghav Kashyap(raghavkashyap@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 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 20 | |
| 21 | Testing of the Experimental Mode |
| 22 | |
| 23 | ofautomation>run ExperimentTest example 1 |
| 24 | will execute this example. |
| 25 | ''' |
| 26 | class ExperimentTest: |
| 27 | ''' |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 28 | Testing of the Experimental Mode |
| 29 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 30 | ''' |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 31 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 32 | def __init__(self): |
| 33 | self.default = "" |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 34 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 35 | def CASE1(self,main): |
| 36 | ''' |
| 37 | Testing the configuration of the host by using checkIP functionof Mininet driver |
| 38 | ''' |
| 39 | main.EXPERIMENTAL_MODE = main.TRUE |
| 40 | main.case("Testing the configuration of the host") |
| 41 | main.step("Host IP Checking using checkIP") |
| 42 | result = main.Mininet1.checkIP(main.params['CASE1']['destination']) |
| 43 | main.step("Verifying the result") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 44 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured") |
| 45 | main.step("Calling Non Existing API for Experimental Mode") |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 46 | testReturn = main.POX2.verify_flow(returns=main.TRUE) |
| 47 | utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured") |
| 48 | |
| 49 | def CASE2(self,main): |
| 50 | ''' |
| 51 | Testing of the reachability of the hosts by using pingall of Mininet driver |
| 52 | ''' |
| 53 | main.EXPERIMENTAL_MODE = main.TRUE |
| 54 | main.case("Testing Reachabilty of all the hosts") |
| 55 | main.step("Checking Hosts reachability by using pingall") |
| 56 | result = main.Mininet1.pingall() |
| 57 | main.step("Verifying the result") |
| 58 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="All hosts are reacchable",onfail="Hosts are not reachable") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 59 | main.step("Calling Non Existing API for Experimental Mode") |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 60 | testReturn = main.Mininet1.verify_flow(returns=main.TRUE) |
| 61 | utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 62 | |