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 |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 4 | Copyright 2012 Open Networking Foundation (ONF) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 5 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 6 | @author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com) |
| 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 |
| 15 | (at your option) any later version. |
| 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. |
| 29 | ''' |
| 30 | class ExperimentTest: |
| 31 | ''' |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 32 | Testing of the Experimental Mode |
| 33 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 34 | ''' |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 35 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 36 | def __init__(self): |
| 37 | self.default = "" |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 38 | |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 39 | def CASE1(self,main): |
| 40 | ''' |
| 41 | Testing the configuration of the host by using checkIP functionof Mininet driver |
| 42 | ''' |
| 43 | main.EXPERIMENTAL_MODE = main.TRUE |
| 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") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 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") |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 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") |
| 52 | |
| 53 | def CASE2(self,main): |
| 54 | ''' |
| 55 | Testing of the reachability of the hosts by using pingall of Mininet driver |
| 56 | ''' |
| 57 | main.EXPERIMENTAL_MODE = main.TRUE |
| 58 | main.case("Testing Reachabilty of all the hosts") |
| 59 | main.step("Checking Hosts reachability by using pingall") |
| 60 | result = main.Mininet1.pingall() |
| 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") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 63 | main.step("Calling Non Existing API for Experimental Mode") |
admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 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") |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 66 | |