admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | ''' |
| 2 | |
| 3 | * TestON is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation, either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | |
| 8 | * TestON is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | |
| 13 | |
| 14 | ''' |
| 15 | class DpctlTest : |
| 16 | |
| 17 | def __init__(self) : |
| 18 | self.default = '' |
| 19 | |
| 20 | def CASE1(self,main) : |
| 21 | |
| 22 | main.case("DPCTL Ping Host") |
| 23 | main.step("Adding flow for host2") |
| 24 | main.DPCTL1.addFlow(tcpip=main.params['CASE1']['STEP1']['tcpip'], tcpport=main.params['CASE1']['STEP1']['tcpport'], inport=main.params['CASE1']['STEP1']['inport'], timeout=main.params['CASE1']['STEP1']['timeout'], action=main.params['CASE1']['STEP1']['action']) |
| 25 | main.step("Adding Another Flow for Host3") |
| 26 | main.DPCTL1.addFlow(tcpip=main.params['CASE1']['STEP2']['tcpip'], tcpport=main.params['CASE1']['STEP2']['tcpport'], inport=main.params['CASE1']['STEP2']['inport'], timeout=main.params['CASE1']['STEP2']['timeout'], action=main.params['CASE1']['STEP2']['action']) |
| 27 | main.step("Ping From h2 to h3") |
| 28 | main.Mininet1.pingHost(src=main.componentDictionary['DPCTL1']['src'], target=main.componentDictionary['DPCTL1']['target'], controller=main.componentDictionary['DPCTL1']['controller']) |
| 29 | result = main.last_result |
| 30 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Ping Successful",onfail="Ping failed") |
| 31 | |
| 32 | def CASE2(self,main) : |
| 33 | |
| 34 | main.case("DPCTL Show Flow") |
| 35 | main.step("Adding flow for host2") |
| 36 | main.DPCTL1.addFlow(tcpip=main.params['CASE2']['STEP1']['tcpip'], tcpport=main.params['CASE2']['STEP1']['tcpport'], inport=main.params['CASE2']['STEP1']['inport'], timeout=main.params['CASE2']['STEP1']['timeout'], action=main.params['CASE2']['STEP1']['action']) |
| 37 | main.step("Adding Another Flow for Host3") |
| 38 | main.DPCTL1.addFlow(tcpip=main.params['CASE2']['STEP2']['tcpip'], tcpport=main.params['CASE2']['STEP2']['tcpport'], inport=main.params['CASE2']['STEP2']['inport'], timeout=main.params['CASE2']['STEP2']['timeout'], action=main.params['CASE2']['STEP2']['action']) |
| 39 | main.step("Execute Show Flow") |
| 40 | main.DPCTL1.showFlow(tcpip=main.params['CASE2']['tcpip'], tcpport=main.params['CASE2']['tcpport']) |
| 41 | result = main.last_result |
| 42 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="SHOW FLOW IS EXECUTED",onfail="Show Flow Execution failed") |