blob: a57a8f0503f8d0cacad1142a812d275add2fa815 [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001#!/usr/bin/env python
Jon Hall4ba53f02015-07-29 13:07:41 -07002'''
adminbae64d82013-08-01 10:50:15 -07003Created on 26-Nov-2012
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07004Copyright 2012 Open Networking Foundation (ONF)
Jon Hall4ba53f02015-07-29 13:07:41 -07005
adminbae64d82013-08-01 10:50:15 -07006@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
7
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
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 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.
29'''
30class ExperimentTest:
31 '''
Jon Hall4ba53f02015-07-29 13:07:41 -070032 Testing of the Experimental Mode
33
adminbae64d82013-08-01 10:50:15 -070034 '''
Jon Hall4ba53f02015-07-29 13:07:41 -070035
adminbae64d82013-08-01 10:50:15 -070036 def __init__(self):
37 self.default = ""
Jon Hall4ba53f02015-07-29 13:07:41 -070038
adminbae64d82013-08-01 10:50:15 -070039 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 Hall4ba53f02015-07-29 13:07:41 -070048 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")
adminbae64d82013-08-01 10:50:15 -070050 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 Hall4ba53f02015-07-29 13:07:41 -070063 main.step("Calling Non Existing API for Experimental Mode")
adminbae64d82013-08-01 10:50:15 -070064 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 Hall4ba53f02015-07-29 13:07:41 -070066