shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 2 | # Testing the basic functionality of ONOS Next |
| 3 | # For sanity and driver functionality excercises only. |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 4 | |
| 5 | import time |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 6 | # import sys |
| 7 | # import os |
| 8 | # import re |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 9 | import json |
| 10 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 11 | time.sleep( 1 ) |
| 12 | |
| 13 | |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 14 | class ProdFunc13: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 15 | |
| 16 | def __init__( self ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 17 | self.default = '' |
| 18 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 19 | def CASE1( self, main ): |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 20 | import time |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 21 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 22 | Startup sequence: |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 23 | cell <name> |
| 24 | onos-verify-cell |
| 25 | onos-remove-raft-log |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 26 | git pull |
| 27 | mvn clean install |
| 28 | onos-package |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 29 | onos-install -f |
| 30 | onos-wait-for-start |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 31 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 32 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 33 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 34 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 35 | main.case( "Setting up test environment" ) |
| 36 | main.log.report( |
| 37 | "This testcase is testing setting up test environment" ) |
| 38 | main.log.report( "__________________________________" ) |
| 39 | |
| 40 | main.step( "Applying cell variable to environment" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 41 | cellResult = main.ONOSbench.setCell( cellName ) |
| 42 | verifyResult = main.ONOSbench.verifyCell() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 43 | |
| 44 | main.step( "Removing raft logs before a clen installation of ONOS" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 45 | main.ONOSbench.onosRemoveRaftLogs() |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 46 | |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 47 | main.step( "Git checkout and get version" ) |
shahshreya | b512cd0 | 2015-01-27 17:01:47 -0800 | [diff] [blame] | 48 | #main.ONOSbench.gitCheckout( "master" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 49 | gitPullResult = main.ONOSbench.gitPull() |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 50 | main.log.info( "git_pull_result = " + str( gitPullResult )) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 51 | main.ONOSbench.getVersion( report=True ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 52 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 53 | if gitPullResult == 1: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 54 | main.step( "Using mvn clean & install" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 55 | main.ONOSbench.cleanInstall() |
| 56 | elif gitPullResult == 0: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 57 | main.log.report( |
| 58 | "Git Pull Failed, look into logs for detailed reason" ) |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 59 | main.cleanup() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 60 | main.exit() |
| 61 | |
| 62 | main.step( "Creating ONOS package" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 63 | packageResult = main.ONOSbench.onosPackage() |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 64 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 65 | main.step( "Installing ONOS package" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 66 | onosInstallResult = main.ONOSbench.onosInstall() |
| 67 | if onosInstallResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 68 | main.log.report( "Installing ONOS package successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 69 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 70 | main.log.report( "Installing ONOS package failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 71 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 72 | onos1Isup = main.ONOSbench.isup() |
| 73 | if onos1Isup == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 74 | main.log.report( "ONOS instance is up and ready" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 75 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 76 | main.log.report( "ONOS instance may not be up" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 77 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 78 | main.step( "Starting ONOS service" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 79 | startResult = main.ONOSbench.onosStart( ONOS1Ip ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 80 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 81 | main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] ) |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 82 | main.step( "Starting Mininet CLI..." ) |
| 83 | |
| 84 | # Starting the mininet using the old way |
| 85 | main.step( "Starting Mininet ..." ) |
| 86 | netIsUp = main.Mininet1.startNet() |
| 87 | if netIsUp: |
| 88 | main.log.info("Mininet CLI is up") |
| 89 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 90 | case1Result = ( packageResult and |
| 91 | cellResult and verifyResult |
| 92 | and onosInstallResult and |
| 93 | onos1Isup and startResult ) |
| 94 | utilities.assert_equals( expect=main.TRUE, actual=case1Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 95 | onpass="Test startup successful", |
| 96 | onfail="Test startup NOT successful" ) |
| 97 | |
| 98 | def CASE2( self, main ): |
| 99 | """ |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 100 | Switch Down |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 101 | """ |
| 102 | # NOTE: You should probably run a topology check after this |
| 103 | import time |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 104 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 105 | main.case( "Switch down discovery" ) |
| 106 | main.log.report( "This testcase is testing a switch down discovery" ) |
| 107 | main.log.report( "__________________________________" ) |
| 108 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 109 | switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] ) |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 110 | |
| 111 | description = "Killing a switch to ensure it is discovered correctly" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 112 | main.log.report( description ) |
| 113 | main.case( description ) |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 114 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 115 | # TODO: Make this switch parameterizable |
| 116 | main.step( "Kill s28 " ) |
| 117 | main.log.report( "Deleting s28" ) |
| 118 | # FIXME: use new dynamic topo functions |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 119 | main.Mininet1.delSwitch( "s28" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 120 | main.log.info( |
| 121 | "Waiting " + |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 122 | str( switchSleep ) + |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 123 | " seconds for switch down to be discovered" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 124 | time.sleep( switchSleep ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 125 | # Peek at the deleted switch |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 126 | device = main.ONOS2.getDevice( dpid="0028" ) |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 127 | print "device = ", device |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 128 | if device[ u'available' ] == 'False': |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 129 | case2Result = main.FALSE |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 130 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 131 | case2Result = main.TRUE |
| 132 | utilities.assert_equals( expect=main.TRUE, actual=case2Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 133 | onpass="Switch down discovery successful", |
| 134 | onfail="Switch down discovery failed" ) |
shahshreya | a22f8f8 | 2014-12-08 16:59:21 -0800 | [diff] [blame] | 135 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 136 | def CASE11( self, main ): |
| 137 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 138 | Cleanup sequence: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 139 | onos-service <nodeIp> stop |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 140 | onos-uninstall |
| 141 | |
| 142 | TODO: Define rest of cleanup |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 143 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 144 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 145 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 146 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 147 | main.case( "Cleaning up test environment" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 148 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 149 | main.step( "Testing ONOS kill function" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 150 | killResult = main.ONOSbench.onosKill( ONOS1Ip ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 151 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 152 | main.step( "Stopping ONOS service" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 153 | stopResult = main.ONOSbench.onosStop( ONOS1Ip ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 154 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 155 | main.step( "Uninstalling ONOS service" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 156 | uninstallResult = main.ONOSbench.onosUninstall() |
| 157 | |
| 158 | case11Result = killResult and stopResult and uninstallResult |
| 159 | utilities.assert_equals( expect=main.TRUE, actual=case11Result, |
| 160 | onpass="Cleanup successful", |
| 161 | onfail="Cleanup failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 162 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 163 | def CASE3( self, main ): |
| 164 | """ |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 165 | Test 'onos' command and its functionality in driver |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 166 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 167 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 168 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 169 | main.case( "Testing 'onos' command" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 170 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 171 | main.step( "Sending command 'onos -w <onos-ip> system:name'" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 172 | cmdstr1 = "system:name" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 173 | cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 ) |
| 174 | main.log.info( "onos command returned: " + cmdResult1 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 175 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 176 | main.step( "Sending command 'onos -w <onos-ip> onos:topology'" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 177 | cmdstr2 = "onos:topology" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 178 | cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 ) |
| 179 | main.log.info( "onos command returned: " + cmdResult2 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 180 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 181 | def CASE20( self ): |
| 182 | """ |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 183 | Exit from mininet cli |
| 184 | reinstall ONOS |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 185 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 186 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 187 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 188 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 189 | main.log.report( "This testcase exits the mininet cli and reinstalls" + |
| 190 | "ONOS to switch over to Packet Optical topology" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 191 | main.log.report( "_____________________________________________" ) |
| 192 | main.case( "Disconnecting mininet and restarting ONOS" ) |
| 193 | main.step( "Disconnecting mininet and restarting ONOS" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 194 | mininetDisconnect = main.Mininet1.disconnect() |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 195 | print "mininetDisconnect = ", mininetDisconnect |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 196 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 197 | main.step( "Removing raft logs before a clen installation of ONOS" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 198 | main.ONOSbench.onosRemoveRaftLogs() |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 199 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 200 | main.step( "Applying cell variable to environment" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 201 | cellResult = main.ONOSbench.setCell( cellName ) |
| 202 | verifyResult = main.ONOSbench.verifyCell() |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 203 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 204 | onosInstallResult = main.ONOSbench.onosInstall() |
| 205 | if onosInstallResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 206 | main.log.report( "Installing ONOS package successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 207 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 208 | main.log.report( "Installing ONOS package failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 209 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 210 | onos1Isup = main.ONOSbench.isup() |
| 211 | if onos1Isup == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 212 | main.log.report( "ONOS instance is up and ready" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 213 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 214 | main.log.report( "ONOS instance may not be up" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 215 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 216 | main.step( "Starting ONOS service" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 217 | startResult = main.ONOSbench.onosStart( ONOS1Ip ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 218 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 219 | main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] ) |
| 220 | case20Result = mininetDisconnect and cellResult and verifyResult \ |
| 221 | and onosInstallResult and onos1Isup and \ |
| 222 | startResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 223 | utilities.assert_equals( |
| 224 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 225 | actual=case20Result, |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 226 | onpass= "Exiting functionality mininet topology and reinstalling" + |
| 227 | " ONOS successful", |
| 228 | onfail= "Exiting functionality mininet topology and reinstalling" + |
| 229 | " ONOS failed" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 230 | |
| 231 | def CASE21( self, main ): |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 232 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 233 | On ONOS bench, run this command: |
| 234 | ./~/ONOS/tools/test/bin/onos-topo-cfg |
| 235 | which starts the rest and copies the links |
| 236 | json file to the onos instance. |
| 237 | Note that in case of Packet Optical, the links are not learnt |
| 238 | from the topology, instead the links are learnt |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 239 | from the json config file |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 240 | """ |
| 241 | main.log.report( |
| 242 | "This testcase starts the packet layer topology and REST" ) |
| 243 | main.log.report( "_____________________________________________" ) |
| 244 | main.case( "Starting LINC-OE and other components" ) |
| 245 | main.step( "Starting LINC-OE and other components" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 246 | startConsoleResult = main.LincOE1.startConsole() |
| 247 | opticalMnScript = main.LincOE2.runOpticalMnScript() |
| 248 | onosTopoCfgResult = main.ONOSbench.runOnosTopoCfg( |
| 249 | instanceName=main.params[ 'CTRL' ][ 'ip1' ], |
| 250 | jsonFile=main.params[ 'OPTICAL' ][ 'jsonfile' ] ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 251 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 252 | print "start_console_result =", startConsoleResult |
| 253 | print "optical_mn_script = ", opticalMnScript |
| 254 | print "onos_topo_cfg_result =", onosTopoCfgResult |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 255 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 256 | case21Result = startConsoleResult and opticalMnScript and \ |
| 257 | onosTopoCfgResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 258 | utilities.assert_equals( |
| 259 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 260 | actual=case21Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 261 | onpass="Packet optical topology spawned successsfully", |
| 262 | onfail="Packet optical topology spawning failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 263 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 264 | def CASE22( self, main ): |
| 265 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 266 | Curretly we use, 4 linear switch optical topology and |
| 267 | 2 packet layer mininet switches each with one host. |
| 268 | Therefore, the roadmCount variable = 4, |
| 269 | packetLayerSWCount variable = 2 and hostCount = 2 |
| 270 | and this is hardcoded in the testcase. If the topology changes, |
| 271 | these hardcoded values need to be changed |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 272 | """ |
| 273 | main.log.report( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 274 | "This testcase compares the optical+packet topology against what" + |
| 275 | " is expected" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 276 | main.case( "Topology comparision" ) |
| 277 | main.step( "Topology comparision" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 278 | main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] ) |
| 279 | devicesResult = main.ONOS3.devices( jsonFormat=False ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 280 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 281 | print "devices_result = ", devicesResult |
| 282 | devicesLinewise = devicesResult.split( "\n" ) |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 283 | devicesLinewise = devicesLinewise[ 1: ] |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 284 | roadmCount = 0 |
| 285 | packetLayerSWCount = 0 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 286 | for line in devicesLinewise: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 287 | components = line.split( "," ) |
| 288 | availability = components[ 1 ].split( "=" )[ 1 ] |
| 289 | type = components[ 3 ].split( "=" )[ 1 ] |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 290 | if availability == 'true' and type == 'ROADM': |
| 291 | roadmCount += 1 |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 292 | elif availability == 'true' and type == 'SWITCH': |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 293 | packetLayerSWCount += 1 |
| 294 | if roadmCount == 4: |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 295 | print "Number of Optical Switches = %d and is" % roadmCount +\ |
| 296 | " correctly detected" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 297 | main.log.info( |
| 298 | "Number of Optical Switches = " + |
| 299 | str( roadmCount ) + |
| 300 | " and is correctly detected" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 301 | opticalSWResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 302 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 303 | print "Number of Optical Switches = %d and is wrong" % roadmCount |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 304 | main.log.info( |
| 305 | "Number of Optical Switches = " + |
| 306 | str( roadmCount ) + |
| 307 | " and is wrong" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 308 | opticalSWResult = main.FALSE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 309 | |
| 310 | if packetLayerSWCount == 2: |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 311 | print "Number of Packet layer or mininet Switches = %d "\ |
| 312 | % packetLayerSWCount + "and is correctly detected" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 313 | main.log.info( |
| 314 | "Number of Packet layer or mininet Switches = " + |
| 315 | str( packetLayerSWCount ) + |
| 316 | " and is correctly detected" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 317 | packetSWResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 318 | else: |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 319 | print "Number of Packet layer or mininet Switches = %d and"\ |
| 320 | % packetLayerSWCount + " is wrong" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 321 | main.log.info( |
| 322 | "Number of Packet layer or mininet Switches = " + |
| 323 | str( packetLayerSWCount ) + |
| 324 | " and is wrong" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 325 | packetSWResult = main.FALSE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 326 | print "_________________________________" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 327 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 328 | linksResult = main.ONOS3.links( jsonFormat=False ) |
| 329 | print "links_result = ", linksResult |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 330 | print "_________________________________" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 331 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 332 | # NOTE:Since only point intents are added, there is no |
| 333 | # requirement to discover the hosts |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 334 | # Therfore, the below portion of the code is commented. |
| 335 | """ |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 336 | #Discover hosts using pingall |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 337 | pingallResult = main.LincOE2.pingall() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 338 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 339 | hostsResult = main.ONOS3.hosts( jsonFormat=False ) |
| 340 | main.log.info( "hosts_result = "+hostsResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 341 | main.log.info( "_________________________________" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 342 | hostsLinewise = hostsResult.split( "\n" ) |
| 343 | hostsLinewise = hostsLinewise[ 1:-1 ] |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 344 | hostCount = 0 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 345 | for line in hostsLinewise: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 346 | hostid = line.split( "," )[ 0 ].split( "=" )[ 1 ] |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 347 | hostCount +=1 |
| 348 | if hostCount ==2: |
| 349 | print "Number of hosts = %d and is correctly detected" %hostCount |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 350 | main.log.info( "Number of hosts = " + str( hostCount ) +" and \ |
| 351 | is correctly detected" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 352 | hostDiscovery = main.TRUE |
| 353 | else: |
| 354 | print "Number of hosts = %d and is wrong" %hostCount |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 355 | main.log.info( "Number of hosts = " + str( hostCount ) +" and \ |
| 356 | is wrong" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 357 | hostDiscovery = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 358 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 359 | case22Result = opticalSWResult and packetSWResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 360 | utilities.assert_equals( |
| 361 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 362 | actual=case22Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 363 | onpass="Packet optical topology discovery successful", |
| 364 | onfail="Packet optical topology discovery failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 365 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 366 | def CASE23( self, main ): |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 367 | import time |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 368 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 369 | Add bidirectional point intents between 2 packet layer( mininet ) |
| 370 | devices and |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 371 | ping mininet hosts |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 372 | """ |
| 373 | main.log.report( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 374 | "This testcase adds bidirectional point intents between 2 " + |
| 375 | "packet layer( mininet ) devices and ping mininet hosts" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 376 | main.case( "Topology comparision" ) |
| 377 | main.step( "Adding point intents" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 378 | ptpIntentResult = main.ONOS3.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 379 | "of:0000ffffffff0001/1", |
| 380 | "of:0000ffffffff0002/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 381 | if ptpIntentResult == main.TRUE: |
| 382 | main.ONOS3.intents( jsonFormat=False ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 383 | main.log.info( "Point to point intent install successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 384 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 385 | ptpIntentResult = main.ONOS3.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 386 | "of:0000ffffffff0002/1", |
| 387 | "of:0000ffffffff0001/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 388 | if ptpIntentResult == main.TRUE: |
| 389 | main.ONOS3.intents( jsonFormat=False ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 390 | main.log.info( "Point to point intent install successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 391 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 392 | time.sleep( 10 ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 393 | flowHandle = main.ONOS3.flows() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 394 | main.log.info( "flows :" + flowHandle ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 395 | |
| 396 | # Sleep for 30 seconds to provide time for the intent state to change |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 397 | time.sleep( 30 ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 398 | intentHandle = main.ONOS3.intents( jsonFormat=False ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 399 | main.log.info( "intents :" + intentHandle ) |
| 400 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 401 | PingResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 402 | count = 1 |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 403 | main.log.info( "\n\nh1 is Pinging h2" ) |
| 404 | ping = main.LincOE2.pingHostOptical( src="h1", target="h2" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 405 | # ping = main.LincOE2.pinghost() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 406 | if ping == main.FALSE and count < 5: |
| 407 | count += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 408 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 409 | main.log.info( |
| 410 | "Ping between h1 and h2 failed. Making attempt number " + |
| 411 | str( count ) + |
| 412 | " in 2 seconds" ) |
| 413 | time.sleep( 2 ) |
| 414 | elif ping == main.FALSE: |
| 415 | main.log.info( "All ping attempts between h1 and h2 have failed" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 416 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 417 | elif ping == main.TRUE: |
| 418 | main.log.info( "Ping test between h1 and h2 passed!" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 419 | PingResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 420 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 421 | main.log.info( "Unknown error" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 422 | PingResult = main.ERROR |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 423 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 424 | if PingResult == main.FALSE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 425 | main.log.report( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 426 | "Point intents for packet optical have not ben installed" + |
| 427 | " correctly. Cleaning up" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 428 | if PingResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 429 | main.log.report( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 430 | "Point Intents for packet optical have been " + |
| 431 | "installed correctly" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 432 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 433 | case23Result = PingResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 434 | utilities.assert_equals( |
| 435 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 436 | actual=case23Result, |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 437 | onpass= "Point intents addition for packet optical and" + |
| 438 | "Pingall Test successful", |
| 439 | onfail= "Point intents addition for packet optical and" + |
| 440 | "Pingall Test NOT successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 441 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 442 | def CASE24( self, main ): |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 443 | import time |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 444 | import json |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 445 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 446 | Test Rerouting of Packet Optical by bringing a port down |
| 447 | ( port 22 ) of a switch( switchID=1 ), so that link |
| 448 | ( between switch1 port22 - switch4-port30 ) is inactive |
| 449 | and do a ping test. If rerouting is successful, |
| 450 | ping should pass. also check the flows |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 451 | """ |
| 452 | main.log.report( |
| 453 | "This testcase tests rerouting and pings mininet hosts" ) |
| 454 | main.case( "Test rerouting and pings mininet hosts" ) |
| 455 | main.step( "Bring a port down and verify the link state" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 456 | main.LincOE1.portDown( swId="1", ptId="22" ) |
| 457 | linksNonjson = main.ONOS3.links( jsonFormat=False ) |
| 458 | main.log.info( "links = " + linksNonjson ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 459 | |
| 460 | links = main.ONOS3.links() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 461 | main.log.info( "links = " + links ) |
| 462 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 463 | linksResult = json.loads( links ) |
| 464 | linksStateResult = main.FALSE |
| 465 | for item in linksResult: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 466 | if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[ |
| 467 | 'src' ][ 'port' ] == "22": |
| 468 | if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff04" and item[ |
| 469 | 'dst' ][ 'port' ] == "30": |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 470 | linksState = item[ 'state' ] |
| 471 | if linksState == "INACTIVE": |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 472 | main.log.info( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 473 | "Links state is inactive as expected due to one" + |
| 474 | " of the ports being down" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 475 | main.log.report( |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 476 | "Links state is inactive as expected due to one" + |
| 477 | " of the ports being down" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 478 | linksStateResult = main.TRUE |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 479 | break |
| 480 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 481 | main.log.info( |
| 482 | "Links state is not inactive as expected" ) |
| 483 | main.log.report( |
| 484 | "Links state is not inactive as expected" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 485 | linksStateResult = main.FALSE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 486 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 487 | print "links_state_result = ", linksStateResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 488 | time.sleep( 10 ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 489 | flowHandle = main.ONOS3.flows() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 490 | main.log.info( "flows :" + flowHandle ) |
shahshreya | f1b1b9f | 2014-12-04 16:59:20 -0800 | [diff] [blame] | 491 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 492 | main.step( "Verify Rerouting by a ping test" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 493 | PingResult = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 494 | count = 1 |
| 495 | main.log.info( "\n\nh1 is Pinging h2" ) |
| 496 | ping = main.LincOE2.pingHostOptical( src="h1", target="h2" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 497 | # ping = main.LincOE2.pinghost() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 498 | if ping == main.FALSE and count < 5: |
| 499 | count += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 500 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 501 | main.log.info( |
| 502 | "Ping between h1 and h2 failed. Making attempt number " + |
| 503 | str( count ) + |
| 504 | " in 2 seconds" ) |
| 505 | time.sleep( 2 ) |
| 506 | elif ping == main.FALSE: |
| 507 | main.log.info( "All ping attempts between h1 and h2 have failed" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 508 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 509 | elif ping == main.TRUE: |
| 510 | main.log.info( "Ping test between h1 and h2 passed!" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 511 | PingResult = main.TRUE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 512 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 513 | main.log.info( "Unknown error" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 514 | PingResult = main.ERROR |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 515 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 516 | if PingResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 517 | main.log.report( "Ping test successful " ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 518 | if PingResult == main.FALSE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 519 | main.log.report( "Ping test failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 520 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 521 | case24Result = PingResult and linksStateResult |
| 522 | utilities.assert_equals( expect=main.TRUE, actual=case24Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 523 | onpass="Packet optical rerouting successful", |
| 524 | onfail="Packet optical rerouting failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 525 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 526 | def CASE4( self, main ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 527 | import re |
| 528 | import time |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 529 | main.log.report( "This testcase is testing the assignment of" + |
| 530 | " all the switches to all the controllers and" + |
| 531 | " discovering the hists in reactive mode" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 532 | main.log.report( "__________________________________" ) |
| 533 | main.case( "Pingall Test" ) |
| 534 | main.step( "Assigning switches to controllers" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 535 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 536 | ONOS1Port = main.params[ 'CTRL' ][ 'port1' ] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 537 | for i in range( 1, 29 ): |
| 538 | if i == 1: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 539 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 540 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 541 | ip1=ONOS1Ip, |
| 542 | port1=ONOS1Port ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 543 | elif i >= 2 and i < 5: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 544 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 545 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 546 | ip1=ONOS1Ip, |
| 547 | port1=ONOS1Port ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 548 | elif i >= 5 and i < 8: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 549 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 550 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 551 | ip1=ONOS1Ip, |
| 552 | port1=ONOS1Port ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 553 | elif i >= 8 and i < 18: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 554 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 555 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 556 | ip1=ONOS1Ip, |
| 557 | port1=ONOS1Port ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 558 | elif i >= 18 and i < 28: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 559 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 560 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 561 | ip1=ONOS1Ip, |
| 562 | port1=ONOS1Port ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 563 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 564 | main.Mininet1.assignSwController( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 565 | sw=str( i ), |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 566 | ip1=ONOS1Ip, |
| 567 | port1=ONOS1Port ) |
| 568 | SwitchMastership = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 569 | for i in range( 1, 29 ): |
| 570 | if i == 1: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 571 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 572 | print( "Response is " + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 573 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 574 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 575 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 576 | SwitchMastership = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 577 | elif i >= 2 and i < 5: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 578 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 579 | print( "Response is " + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 580 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 581 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 582 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 583 | SwitchMastership = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 584 | elif i >= 5 and i < 8: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 585 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 586 | print( "Response is " + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 587 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 588 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 589 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 590 | SwitchMastership = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 591 | elif i >= 8 and i < 18: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 592 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 593 | print( "Response is " + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 594 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 595 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 596 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 597 | SwitchMastership = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 598 | elif i >= 18 and i < 28: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 599 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 600 | print( "Response is " + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 601 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 602 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 603 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 604 | SwitchMastership = main.FALSE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 605 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 606 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 607 | print( "Response is" + str( response ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 608 | if re.search( "tcp:" + ONOS1Ip, response ): |
| 609 | SwitchMastership = SwitchMastership and main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 610 | else: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 611 | SwitchMastership = main.FALSE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 612 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 613 | if SwitchMastership == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 614 | main.log.report( "Controller assignmnet successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 615 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 616 | main.log.report( "Controller assignmnet failed" ) |
| 617 | utilities.assert_equals( |
| 618 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 619 | actual=SwitchMastership, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 620 | onpass="MasterControllers assigned correctly" ) |
| 621 | """ |
| 622 | for i in range ( 1,29 ): |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 623 | main.Mininet1.assignSwController( sw=str( i ),count=5, |
| 624 | ip1=ONOS1Ip,port1=ONOS1Port, |
| 625 | ip2=ONOS2Ip,port2=ONOS2Port, |
| 626 | ip3=ONOS3Ip,port3=ONOS3Port, |
| 627 | ip4=ONOS4Ip,port4=ONOS4Port, |
| 628 | ip5=ONOS5Ip,port5=ONOS5Port ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 629 | """ |
| 630 | # REACTIVE FWD test |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 631 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 632 | main.step( "Get list of hosts from Mininet" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 633 | hostList = main.Mininet1.getHosts() |
| 634 | main.log.info( hostList ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 635 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 636 | main.step( "Get host list in ONOS format" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 637 | hostOnosList = main.ONOS2.getHostsId( hostList ) |
| 638 | main.log.info( hostOnosList ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 639 | # time.sleep( 5 ) |
| 640 | |
| 641 | main.step( "Pingall" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 642 | pingResult = main.FALSE |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 643 | time1 = time.time() |
| 644 | pingResult = main.Mininet1.pingall() |
| 645 | time2 = time.time() |
| 646 | print "Time for pingall: %2f seconds" % ( time2 - time1 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 647 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 648 | # Start onos cli again because u might have dropped out of |
| 649 | # onos prompt to the shell prompt |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 650 | # if there was no activity |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 651 | main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 652 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 653 | case4Result = SwitchMastership and pingResult |
| 654 | if pingResult == main.TRUE: |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 655 | main.log.report( "Pingall Test in reactive mode to" + |
| 656 | " discover the hosts successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 657 | else: |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 658 | main.log.report( "Pingall Test in reactive mode to" + |
| 659 | " discover the hosts failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 660 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 661 | utilities.assert_equals( |
| 662 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 663 | actual=case4Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 664 | onpass="Controller assignment and Pingall Test successful", |
| 665 | onfail="Controller assignment and Pingall Test NOT successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 666 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 667 | def CASE10( self ): |
| 668 | main.log.report( |
| 669 | "This testcase uninstalls the reactive forwarding app" ) |
| 670 | main.log.report( "__________________________________" ) |
| 671 | main.case( "Uninstalling reactive forwarding app" ) |
| 672 | # Unistall onos-app-fwd app to disable reactive forwarding |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 673 | appUninstallResult = main.ONOS2.featureUninstall( "onos-app-fwd" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 674 | main.log.info( "onos-app-fwd uninstalled" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 675 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 676 | # After reactive forwarding is disabled, the reactive flows on |
| 677 | # switches timeout in 10-15s |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 678 | # So sleep for 15s |
| 679 | time.sleep( 15 ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 680 | |
| 681 | flows = main.ONOS2.flows() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 682 | main.log.info( flows ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 683 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 684 | case10Result = appUninstallResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 685 | utilities.assert_equals( |
| 686 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 687 | actual=case10Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 688 | onpass="Reactive forwarding app uninstallation successful", |
| 689 | onfail="Reactive forwarding app uninstallation failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 690 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 691 | def CASE6( self ): |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 692 | main.log.report( "This testcase is testing the addition of" + |
| 693 | " host intents and then does pingall" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 694 | main.log.report( "__________________________________" ) |
| 695 | main.case( "Obtaining host id's" ) |
| 696 | main.step( "Get hosts" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 697 | hosts = main.ONOS2.hosts() |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 698 | main.log.info( hosts ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 699 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 700 | main.step( "Get all devices id" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 701 | devicesIdList = main.ONOS2.getAllDevicesId() |
| 702 | main.log.info( devicesIdList ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 703 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 704 | # ONOS displays the hosts in hex format unlike mininet which does |
| 705 | # in decimal format |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 706 | # So take care while adding intents |
| 707 | """ |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 708 | main.step( "Add host-to-host intents for mininet hosts h8 and h18 or |
| 709 | ONOS hosts h8 and h12" ) |
| 710 | hthIntentResult = main.ONOS2.addHostIntent( |
| 711 | "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" ) |
| 712 | hthIntentResult = main.ONOS2.addHostIntent( |
| 713 | "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" ) |
| 714 | hthIntentResult = main.ONOS2.addHostIntent( |
| 715 | "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" ) |
| 716 | hthIntentResult = main.ONOS2.addHostIntent( |
| 717 | "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" ) |
| 718 | hthIntentResult = main.ONOS2.addHostIntent( |
| 719 | "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" ) |
| 720 | hthIntentResult = main.ONOS2.addHostIntent( |
| 721 | "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" ) |
| 722 | hthIntentResult = main.ONOS2.addHostIntent( |
| 723 | "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" ) |
| 724 | hthIntentResult = main.ONOS2.addHostIntent( |
| 725 | "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" ) |
| 726 | hthIntentResult = main.ONOS2.addHostIntent( |
| 727 | "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" ) |
| 728 | hthIntentResult = main.ONOS2.addHostIntent( |
| 729 | "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" ) |
| 730 | print "______________________________________________________" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 731 | """ |
| 732 | for i in range( 8, 18 ): |
| 733 | main.log.info( |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 734 | "Adding host intent between h" + str( i ) + |
| 735 | " and h" + str( i + 10 ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 736 | host1 = "00:00:00:00:00:" + \ |
| 737 | str( hex( i )[ 2: ] ).zfill( 2 ).upper() |
| 738 | host2 = "00:00:00:00:00:" + \ |
| 739 | str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper() |
| 740 | # NOTE: get host can return None |
| 741 | # TODO: handle this |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 742 | host1Id = main.ONOS2.getHost( host1 )[ 'id' ] |
| 743 | host2Id = main.ONOS2.getHost( host2 )[ 'id' ] |
| 744 | main.ONOS2.addHostIntent( host1Id, host2Id ) |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 745 | hIntents = main.ONOS2.intents( jsonFormat=False ) |
| 746 | main.log.info( "intents:" + hIntents ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 747 | |
| 748 | time.sleep( 10 ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 749 | hIntents = main.ONOS2.intents( jsonFormat=False ) |
| 750 | main.log.info( "intents:" + hIntents ) |
| 751 | main.ONOS2.flows() |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 752 | |
| 753 | count = 1 |
| 754 | i = 8 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 755 | PingResult = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 756 | # while i<10: |
| 757 | while i < 18: |
| 758 | main.log.info( |
| 759 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 760 | ping = main.Mininet1.pingHost( |
| 761 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 762 | if ping == main.FALSE and count < 5: |
| 763 | count += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 764 | # i = 8 |
| 765 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 766 | main.log.report( "Ping between h" + |
| 767 | str( i ) + |
| 768 | " and h" + |
| 769 | str( i + |
| 770 | 10 ) + |
| 771 | " failed. Making attempt number " + |
| 772 | str( count ) + |
| 773 | " in 2 seconds" ) |
| 774 | time.sleep( 2 ) |
| 775 | elif ping == main.FALSE: |
| 776 | main.log.report( "All ping attempts between h" + |
| 777 | str( i ) + |
| 778 | " and h" + |
| 779 | str( i + |
| 780 | 10 ) + |
| 781 | "have failed" ) |
| 782 | i = 19 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 783 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 784 | elif ping == main.TRUE: |
| 785 | main.log.info( "Ping test between h" + |
| 786 | str( i ) + |
| 787 | " and h" + |
| 788 | str( i + |
| 789 | 10 ) + |
| 790 | "passed!" ) |
| 791 | i += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 792 | PingResult = main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 793 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 794 | main.log.info( "Unknown error" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 795 | PingResult = main.ERROR |
| 796 | if PingResult == main.FALSE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 797 | main.log.report( |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 798 | "Ping all test after Host intent addition failed.Cleaning up" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 799 | # main.cleanup() |
| 800 | # main.exit() |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 801 | if PingResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 802 | main.log.report( |
| 803 | "Ping all test after Host intent addition successful" ) |
| 804 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 805 | case6Result = PingResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 806 | utilities.assert_equals( |
| 807 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 808 | actual=case6Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 809 | onpass="Pingall Test after Host intents addition successful", |
| 810 | onfail="Pingall Test after Host intents addition failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 811 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 812 | def CASE5( self, main ): |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 813 | import json |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 814 | # assumes that sts is already in you PYTHONPATH |
| 815 | from sts.topology.teston_topology import TestONTopology |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 816 | # main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] ) |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 817 | main.log.report( "This testcase is testing if all ONOS nodes" + |
| 818 | " are in topology sync with mininet" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 819 | main.log.report( "__________________________________" ) |
| 820 | main.case( "Comparing Mininet topology with the topology of ONOS" ) |
| 821 | main.step( "Start continuous pings" ) |
| 822 | main.Mininet2.pingLong( |
| 823 | src=main.params[ 'PING' ][ 'source1' ], |
| 824 | target=main.params[ 'PING' ][ 'target1' ], |
| 825 | pingTime=500 ) |
| 826 | main.Mininet2.pingLong( |
| 827 | src=main.params[ 'PING' ][ 'source2' ], |
| 828 | target=main.params[ 'PING' ][ 'target2' ], |
| 829 | pingTime=500 ) |
| 830 | main.Mininet2.pingLong( |
| 831 | src=main.params[ 'PING' ][ 'source3' ], |
| 832 | target=main.params[ 'PING' ][ 'target3' ], |
| 833 | pingTime=500 ) |
| 834 | main.Mininet2.pingLong( |
| 835 | src=main.params[ 'PING' ][ 'source4' ], |
| 836 | target=main.params[ 'PING' ][ 'target4' ], |
| 837 | pingTime=500 ) |
| 838 | main.Mininet2.pingLong( |
| 839 | src=main.params[ 'PING' ][ 'source5' ], |
| 840 | target=main.params[ 'PING' ][ 'target5' ], |
| 841 | pingTime=500 ) |
| 842 | main.Mininet2.pingLong( |
| 843 | src=main.params[ 'PING' ][ 'source6' ], |
| 844 | target=main.params[ 'PING' ][ 'target6' ], |
| 845 | pingTime=500 ) |
| 846 | main.Mininet2.pingLong( |
| 847 | src=main.params[ 'PING' ][ 'source7' ], |
| 848 | target=main.params[ 'PING' ][ 'target7' ], |
| 849 | pingTime=500 ) |
| 850 | main.Mininet2.pingLong( |
| 851 | src=main.params[ 'PING' ][ 'source8' ], |
| 852 | target=main.params[ 'PING' ][ 'target8' ], |
| 853 | pingTime=500 ) |
| 854 | main.Mininet2.pingLong( |
| 855 | src=main.params[ 'PING' ][ 'source9' ], |
| 856 | target=main.params[ 'PING' ][ 'target9' ], |
| 857 | pingTime=500 ) |
| 858 | main.Mininet2.pingLong( |
| 859 | src=main.params[ 'PING' ][ 'source10' ], |
| 860 | target=main.params[ 'PING' ][ 'target10' ], |
| 861 | pingTime=500 ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 862 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 863 | main.step( "Create TestONTopology object" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 864 | global ctrls |
| 865 | ctrls = [] |
| 866 | count = 1 |
| 867 | while True: |
| 868 | temp = () |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 869 | if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]: |
| 870 | temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), ) |
| 871 | temp = temp + ( "ONOS" + str( count ), ) |
| 872 | temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], ) |
| 873 | temp = temp + \ |
| 874 | ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), ) |
| 875 | ctrls.append( temp ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 876 | count = count + 1 |
| 877 | else: |
| 878 | break |
| 879 | global MNTopo |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 880 | Topo = TestONTopology( |
| 881 | main.Mininet1, |
| 882 | ctrls ) # can also add Intent API info for intent operations |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 883 | MNTopo = Topo |
| 884 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 885 | TopologyCheck = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 886 | main.step( "Compare ONOS Topology to MN Topology" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 887 | devicesJson = main.ONOS2.devices() |
| 888 | linksJson = main.ONOS2.links() |
| 889 | # portsJson = main.ONOS2.ports() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 890 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 891 | result1 = main.Mininet1.compareSwitches( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 892 | MNTopo, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 893 | json.loads( devicesJson ) ) |
| 894 | result2 = main.Mininet1.compareLinks( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 895 | MNTopo, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 896 | json.loads( linksJson ) ) |
| 897 | # result3 = main.Mininet1.comparePorts( |
| 898 | # MNTopo, json.loads( portsJson ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 899 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 900 | # result = result1 and result2 and result3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 901 | result = result1 and result2 |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 902 | |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 903 | print "***********************" |
| 904 | if result == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 905 | main.log.report( "ONOS" + " Topology matches MN Topology" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 906 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 907 | main.log.report( "ONOS" + " Topology does not match MN Topology" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 908 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 909 | utilities.assert_equals( |
| 910 | expect=main.TRUE, |
| 911 | actual=result, |
| 912 | onpass="ONOS" + |
| 913 | " Topology matches MN Topology", |
| 914 | onfail="ONOS" + |
| 915 | " Topology does not match MN Topology" ) |
| 916 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 917 | TopologyCheck = TopologyCheck and result |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 918 | utilities.assert_equals( |
| 919 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 920 | actual=TopologyCheck, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 921 | onpass="Topology checks passed", |
| 922 | onfail="Topology checks failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 923 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 924 | def CASE7( self, main ): |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 925 | from sts.topology.teston_topology import TestONTopology |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 926 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 927 | linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 928 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 929 | main.log.report( "This testscase is killing a link to ensure that" + |
| 930 | " link discovery is consistent" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 931 | main.log.report( "__________________________________" ) |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 932 | main.log.report( "Killing a link to ensure that link discovery" + |
| 933 | " is consistent" ) |
| 934 | main.case( "Killing a link to Ensure that Link Discovery" + |
| 935 | "is Working Properly" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 936 | """ |
| 937 | main.step( "Start continuous pings" ) |
| 938 | |
| 939 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 940 | target=main.params[ 'PING' ][ 'target1' ], |
| 941 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 942 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 943 | target=main.params[ 'PING' ][ 'target2' ], |
| 944 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 945 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 946 | target=main.params[ 'PING' ][ 'target3' ], |
| 947 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 948 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 949 | target=main.params[ 'PING' ][ 'target4' ], |
| 950 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 951 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 952 | target=main.params[ 'PING' ][ 'target5' ], |
| 953 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 954 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 955 | target=main.params[ 'PING' ][ 'target6' ], |
| 956 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 957 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 958 | target=main.params[ 'PING' ][ 'target7' ], |
| 959 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 960 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 961 | target=main.params[ 'PING' ][ 'target8' ], |
| 962 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 963 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 964 | target=main.params[ 'PING' ][ 'target9' ], |
| 965 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 966 | main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ], |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 967 | target=main.params[ 'PING' ][ 'target10' ], |
| 968 | pingTime=500 ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 969 | """ |
| 970 | main.step( "Determine the current number of switches and links" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 971 | topologyOutput = main.ONOS2.topology() |
| 972 | topologyResult = main.ONOS1.getTopology( topologyOutput ) |
| 973 | activeSwitches = topologyResult[ 'devices' ] |
| 974 | links = topologyResult[ 'links' ] |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 975 | print "activeSwitches = ", type( activeSwitches ) |
| 976 | print "links = ", type( links ) |
| 977 | main.log.info( |
| 978 | "Currently there are %s switches and %s links" % |
| 979 | ( str( activeSwitches ), str( links ) ) ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 980 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 981 | main.step( "Kill Link between s3 and s28" ) |
| 982 | main.Mininet1.link( END1="s3", END2="s28", OPTION="down" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 983 | time.sleep( linkSleep ) |
| 984 | topologyOutput = main.ONOS2.topology() |
| 985 | LinkDown = main.ONOS1.checkStatus( |
| 986 | topologyOutput, activeSwitches, str( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 987 | int( links ) - 2 ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 988 | if LinkDown == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 989 | main.log.report( "Link Down discovered properly" ) |
| 990 | utilities.assert_equals( |
| 991 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 992 | actual=LinkDown, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 993 | onpass="Link Down discovered properly", |
| 994 | onfail="Link down was not discovered in " + |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 995 | str( linkSleep ) + |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 996 | " seconds" ) |
| 997 | |
| 998 | # Check ping result here..add code for it |
| 999 | |
| 1000 | main.step( "Bring link between s3 and s28 back up" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1001 | LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" ) |
| 1002 | time.sleep( linkSleep ) |
| 1003 | topologyOutput = main.ONOS2.topology() |
| 1004 | LinkUp = main.ONOS1.checkStatus( |
| 1005 | topologyOutput, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1006 | activeSwitches, |
| 1007 | str( links ) ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1008 | if LinkUp == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1009 | main.log.report( "Link up discovered properly" ) |
| 1010 | utilities.assert_equals( |
| 1011 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1012 | actual=LinkUp, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1013 | onpass="Link up discovered properly", |
| 1014 | onfail="Link up was not discovered in " + |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1015 | str( linkSleep ) + |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1016 | " seconds" ) |
| 1017 | |
| 1018 | # NOTE Check ping result here..add code for it |
| 1019 | |
| 1020 | main.step( "Compare ONOS Topology to MN Topology" ) |
| 1021 | Topo = TestONTopology( |
| 1022 | main.Mininet1, |
| 1023 | ctrls ) # can also add Intent API info for intent operations |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1024 | MNTopo = Topo |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1025 | TopologyCheck = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1026 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1027 | devicesJson = main.ONOS2.devices() |
| 1028 | linksJson = main.ONOS2.links() |
| 1029 | portsJson = main.ONOS2.ports() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1030 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1031 | result1 = main.Mininet1.compareSwitches( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1032 | MNTopo, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1033 | json.loads( devicesJson ) ) |
| 1034 | result2 = main.Mininet1.compareLinks( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1035 | MNTopo, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1036 | json.loads( linksJson ) ) |
| 1037 | # result3 = main.Mininet1.comparePorts( |
| 1038 | # MNTopo, json.loads( portsJson ) ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1039 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1040 | # result = result1 and result2 and result3 |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1041 | result = result1 and result2 |
| 1042 | print "***********************" |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1043 | |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1044 | if result == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1045 | main.log.report( "ONOS" + " Topology matches MN Topology" ) |
| 1046 | utilities.assert_equals( |
| 1047 | expect=main.TRUE, |
| 1048 | actual=result, |
| 1049 | onpass="ONOS" + |
| 1050 | " Topology matches MN Topology", |
| 1051 | onfail="ONOS" + |
| 1052 | " Topology does not match MN Topology" ) |
| 1053 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1054 | TopologyCheck = TopologyCheck and result |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1055 | utilities.assert_equals( |
| 1056 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1057 | actual=TopologyCheck, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1058 | onpass="Topology checks passed", |
| 1059 | onfail="Topology checks failed" ) |
| 1060 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1061 | result = LinkDown and LinkUp and TopologyCheck |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1062 | utilities.assert_equals( expect=main.TRUE, actual=result, |
| 1063 | onpass="Link failure is discovered correctly", |
| 1064 | onfail="Link Discovery failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1065 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1066 | def CASE8( self ): |
| 1067 | """ |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1068 | Intent removal |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1069 | """ |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1070 | import time |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1071 | main.log.report( "This testcase removes any previously added intents" + |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1072 | " before adding any new set of intents" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1073 | main.log.report( "__________________________________" ) |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1074 | main.log.info( "intent removal" ) |
| 1075 | main.case( "Removing installed intents" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1076 | main.step( "Obtain the intent id's" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1077 | intentResult = main.ONOS2.intents( jsonFormat=False ) |
| 1078 | main.log.info( "intent_result = " + intentResult ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1079 | intentLinewise = intentResult.split( "\n" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1080 | intentList = [] |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1081 | for line in intentLinewise: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1082 | if line.startswith( "id=" ): |
| 1083 | intentList.append( line ) |
| 1084 | |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1085 | intentids = [] |
| 1086 | for line in intentList: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1087 | intentids.append( line.split( "," )[ 0 ].split( "=" )[ 1 ] ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1088 | for id in intentids: |
| 1089 | print "id = ", id |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1090 | |
| 1091 | main.step( |
| 1092 | "Iterate through the intentids list and remove each intent" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1093 | for id in intentids: |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1094 | main.ONOS2.removeIntent( intentId=id ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1095 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1096 | intentResult = main.ONOS2.intents( jsonFormat=False ) |
| 1097 | main.log.info( "intent_result = " + intentResult ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1098 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1099 | case8Result = main.TRUE |
| 1100 | if case8Result == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1101 | main.log.report( "Intent removal successful" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1102 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1103 | main.log.report( "Intent removal failed" ) |
| 1104 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1105 | PingResult = main.TRUE |
| 1106 | if case8Result == main.TRUE: |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1107 | i = 8 |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1108 | while i < 18: |
| 1109 | main.log.info( |
| 1110 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 1111 | ping = main.Mininet1.pingHost( |
| 1112 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 1113 | if ping == main.TRUE: |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1114 | i = 19 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1115 | PingResult = PingResult and main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1116 | elif ping == main.FALSE: |
| 1117 | i += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1118 | PingResult = PingResult and main.FALSE |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1119 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1120 | main.log.info( "Unknown error" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1121 | PingResult = main.ERROR |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1122 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1123 | # Note: If the ping result failed, that means the intents have been |
| 1124 | # withdrawn correctly. |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1125 | if PingResult == main.TRUE: |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1126 | main.log.report( "Installed intents have not been withdrawn correctly" ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1127 | # main.cleanup() |
| 1128 | # main.exit() |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1129 | if PingResult == main.FALSE: |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1130 | main.log.report( "Installed intents have been withdrawn correctly" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1131 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1132 | case8Result = case8Result and PingResult |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1133 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1134 | if case8Result == main.FALSE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1135 | main.log.report( "Intent removal successful" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1136 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1137 | main.log.report( "Intent removal failed" ) |
shahshreya | e6c7cf4 | 2014-11-26 16:39:01 -0800 | [diff] [blame] | 1138 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1139 | utilities.assert_equals( expect=main.FALSE, actual=case8Result, |
| 1140 | onpass="Intent removal test passed", |
| 1141 | onfail="Intent removal test failed" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1142 | |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1143 | def CASE9( self ): |
| 1144 | main.log.report( |
| 1145 | "This testcase adds point intents and then does pingall" ) |
| 1146 | main.log.report( "__________________________________" ) |
| 1147 | main.log.info( "Adding point intents" ) |
| 1148 | main.case( |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1149 | "Adding bidirectional point for mn hosts" + |
| 1150 | "( h8-h18, h9-h19, h10-h20, h11-h21, h12-h22, " + |
| 1151 | "h13-h23, h14-h24, h15-h25, h16-h26, h17-h27 )" ) |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1152 | |
| 1153 | main.step( "Add point intents for mn hosts h8 and h18 or" + |
| 1154 | "ONOS hosts h8 and h12" ) |
| 1155 | # main.step(var1) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1156 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1157 | "of:0000000000003008/1", |
| 1158 | "of:0000000000006018/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1159 | if ptpIntentResult == main.TRUE: |
| 1160 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1161 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1162 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1163 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1164 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1165 | "of:0000000000006018/1", |
| 1166 | "of:0000000000003008/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1167 | if ptpIntentResult == main.TRUE: |
| 1168 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1169 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1170 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1171 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1172 | var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13" |
| 1173 | main.step(var2) |
| 1174 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1175 | "of:0000000000003009/1", |
| 1176 | "of:0000000000006019/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1177 | if ptpIntentResult == main.TRUE: |
| 1178 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1179 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1180 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1181 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1182 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1183 | "of:0000000000006019/1", |
| 1184 | "of:0000000000003009/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1185 | if ptpIntentResult == main.TRUE: |
| 1186 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1187 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1188 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1189 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1190 | var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14" |
| 1191 | main.step(var3) |
| 1192 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1193 | "of:0000000000003010/1", |
| 1194 | "of:0000000000006020/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1195 | if ptpIntentResult == main.TRUE: |
| 1196 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1197 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1198 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1199 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1200 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1201 | "of:0000000000006020/1", |
| 1202 | "of:0000000000003010/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1203 | if ptpIntentResult == main.TRUE: |
| 1204 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1205 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1206 | # main.log.info( getIntentResult ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1207 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1208 | var4 = "Add point intents for mininet hosts h11 and h21 or" +\ |
| 1209 | " ONOS hosts hB and h15" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1210 | main.case(var4) |
| 1211 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1212 | "of:0000000000003011/1", |
| 1213 | "of:0000000000006021/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1214 | if ptpIntentResult == main.TRUE: |
| 1215 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1216 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1217 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1218 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1219 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1220 | "of:0000000000006021/1", |
| 1221 | "of:0000000000003011/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1222 | if ptpIntentResult == main.TRUE: |
| 1223 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1224 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1225 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1226 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1227 | var5 = "Add point intents for mininet hosts h12 and h22 " +\ |
| 1228 | "ONOS hosts hC and h16" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1229 | main.case(var5) |
| 1230 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1231 | "of:0000000000003012/1", |
| 1232 | "of:0000000000006022/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1233 | if ptpIntentResult == main.TRUE: |
| 1234 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1235 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1236 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1237 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1238 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1239 | "of:0000000000006022/1", |
| 1240 | "of:0000000000003012/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1241 | if ptpIntentResult == main.TRUE: |
| 1242 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1243 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1244 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1245 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1246 | var6 = "Add point intents for mininet hosts h13 and h23 or" +\ |
| 1247 | " ONOS hosts hD and h17" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1248 | main.case(var6) |
| 1249 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1250 | "of:0000000000003013/1", |
| 1251 | "of:0000000000006023/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1252 | if ptpIntentResult == main.TRUE: |
| 1253 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1254 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1255 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1256 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1257 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1258 | "of:0000000000006023/1", |
| 1259 | "of:0000000000003013/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1260 | if ptpIntentResult == main.TRUE: |
| 1261 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1262 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1263 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1264 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1265 | var7 = "Add point intents for mininet hosts h14 and h24 or" +\ |
| 1266 | " ONOS hosts hE and h18" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1267 | main.case(var7) |
| 1268 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1269 | "of:0000000000003014/1", |
| 1270 | "of:0000000000006024/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1271 | if ptpIntentResult == main.TRUE: |
| 1272 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1273 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1274 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1275 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1276 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1277 | "of:0000000000006024/1", |
| 1278 | "of:0000000000003014/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1279 | if ptpIntentResult == main.TRUE: |
| 1280 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1281 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1282 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1283 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1284 | var8 = "Add point intents for mininet hosts h15 and h25 or" +\ |
| 1285 | " ONOS hosts hF and h19" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1286 | main.case(var8) |
| 1287 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1288 | "of:0000000000003015/1", |
| 1289 | "of:0000000000006025/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1290 | if ptpIntentResult == main.TRUE: |
| 1291 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1292 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1293 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1294 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1295 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1296 | "of:0000000000006025/1", |
| 1297 | "of:0000000000003015/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1298 | if ptpIntentResult == main.TRUE: |
| 1299 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1300 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1301 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1302 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1303 | var9 = "Add intents for mininet hosts h16 and h26 or" +\ |
| 1304 | " ONOS hosts h10 and h1A" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1305 | main.case(var9) |
| 1306 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1307 | "of:0000000000003016/1", |
| 1308 | "of:0000000000006026/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1309 | if ptpIntentResult == main.TRUE: |
| 1310 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1311 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1312 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1313 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1314 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1315 | "of:0000000000006026/1", |
| 1316 | "of:0000000000003016/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1317 | if ptpIntentResult == main.TRUE: |
| 1318 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1319 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1320 | # main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1321 | |
kelvin-onlab | cf33bda | 2015-01-23 16:54:17 -0800 | [diff] [blame] | 1322 | var10 = "Add point intents for mininet hosts h17 and h27 or" +\ |
| 1323 | " ONOS hosts h11 and h1B" |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1324 | main.case(var10) |
| 1325 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1326 | "of:0000000000003017/1", |
| 1327 | "of:0000000000006027/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1328 | if ptpIntentResult == main.TRUE: |
| 1329 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1330 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1331 | main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1332 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1333 | ptpIntentResult = main.ONOS2.addPointIntent( |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1334 | "of:0000000000006027/1", |
| 1335 | "of:0000000000003017/1" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1336 | if ptpIntentResult == main.TRUE: |
| 1337 | getIntentResult = main.ONOS2.intents() |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1338 | main.log.info( "Point to point intent install successful" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1339 | main.log.info( getIntentResult ) |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1340 | |
| 1341 | print( |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1342 | "___________________________________________________________" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1343 | |
| 1344 | flowHandle = main.ONOS2.flows() |
shahshreya | 82ecd28 | 2015-02-05 16:48:03 -0800 | [diff] [blame] | 1345 | #main.log.info( "flows :" + flowHandle ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1346 | |
| 1347 | count = 1 |
| 1348 | i = 8 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1349 | PingResult = main.TRUE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1350 | while i < 18: |
| 1351 | main.log.info( |
| 1352 | "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) ) |
| 1353 | ping = main.Mininet1.pingHost( |
| 1354 | src="h" + str( i ), target="h" + str( i + 10 ) ) |
| 1355 | if ping == main.FALSE and count < 5: |
| 1356 | count += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1357 | # i = 8 |
| 1358 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1359 | main.log.report( "Ping between h" + |
| 1360 | str( i ) + |
| 1361 | " and h" + |
| 1362 | str( i + |
| 1363 | 10 ) + |
| 1364 | " failed. Making attempt number " + |
| 1365 | str( count ) + |
| 1366 | " in 2 seconds" ) |
| 1367 | time.sleep( 2 ) |
| 1368 | elif ping == main.FALSE: |
| 1369 | main.log.report( "All ping attempts between h" + |
| 1370 | str( i ) + |
| 1371 | " and h" + |
| 1372 | str( i + |
| 1373 | 10 ) + |
| 1374 | "have failed" ) |
| 1375 | i = 19 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1376 | PingResult = main.FALSE |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1377 | elif ping == main.TRUE: |
| 1378 | main.log.info( "Ping test between h" + |
| 1379 | str( i ) + |
| 1380 | " and h" + |
| 1381 | str( i + |
| 1382 | 10 ) + |
| 1383 | "passed!" ) |
| 1384 | i += 1 |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1385 | PingResult = main.TRUE |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1386 | else: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1387 | main.log.info( "Unknown error" ) |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1388 | PingResult = main.ERROR |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1389 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1390 | if PingResult == main.FALSE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1391 | main.log.report( |
| 1392 | "Point intents have not ben installed correctly. Cleaning up" ) |
| 1393 | # main.cleanup() |
| 1394 | # main.exit() |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1395 | if PingResult == main.TRUE: |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1396 | main.log.report( "Point Intents have been installed correctly" ) |
shahshreya | 4e13a06 | 2014-11-11 16:46:18 -0800 | [diff] [blame] | 1397 | |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1398 | case9Result = PingResult |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1399 | utilities.assert_equals( |
| 1400 | expect=main.TRUE, |
shahshreya | 9294c8d | 2015-01-21 15:54:16 -0800 | [diff] [blame] | 1401 | actual=case9Result, |
kelvin-onlab | 8a83258 | 2015-01-16 17:06:11 -0800 | [diff] [blame] | 1402 | onpass="Point intents addition and Pingall Test successful", |
| 1403 | onfail="Point intents addition and Pingall Test NOT successful" ) |