blob: efccde95f69517b7bd9981fbaf54307dfa3d4663 [file] [log] [blame]
adminbae64d82013-08-01 10:50:15 -07001#!/usr/bin/env python
2'''
3Created on 28-Nov-2012
4
5@author: Anil Kumar (anilkumar.s@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 Hall4ba53f02015-07-29 13:07:41 -070019 along with TestON. If not, see <http://www.gnu.org/licenses/>.
20'''
adminbae64d82013-08-01 10:50:15 -070021class Topology:
22 '''
Jon Hall4ba53f02015-07-29 13:07:41 -070023
adminbae64d82013-08-01 10:50:15 -070024 This example shows, how we can use the topology file:
Jon Hall4ba53f02015-07-29 13:07:41 -070025
adminbae64d82013-08-01 10:50:15 -070026 In topo file we can specify the component like below:
Jon Hall4ba53f02015-07-29 13:07:41 -070027 [TOPOLOGY]
28
adminbae64d82013-08-01 10:50:15 -070029 [[COMPONENT]]
30 [[["Mininet1"]]]
Jon Hall4ba53f02015-07-29 13:07:41 -070031
adminbae64d82013-08-01 10:50:15 -070032 The usage of this component in the test script like below:
Jon Hall4ba53f02015-07-29 13:07:41 -070033
adminbae64d82013-08-01 10:50:15 -070034 main.Mininet1.checkIP(main.params['CASE1']['destination'])
Jon Hall4ba53f02015-07-29 13:07:41 -070035
36 Here we are using the Mininet1 which of type Mininet
37
38
39
adminbae64d82013-08-01 10:50:15 -070040 ofautomation>run Topology example 1
41 will execute this example.
42 '''
43 def __init__(self):
44 self.default = ""
Jon Hall4ba53f02015-07-29 13:07:41 -070045
adminbae64d82013-08-01 10:50:15 -070046 def CASE1(self,main):
47 '''
48 This will showcase the usage of Topology
49 '''
50 main.case("Usage of Topology")
51 main.step("Mininet1 specified in Topology , using the Mininet1 to check host ip")
52 result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
53 main.step("Verifying the result")
Jon Hall4ba53f02015-07-29 13:07:41 -070054 utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
55
56