Andreas Pantelopoulos | 90f0b10 | 2018-02-01 13:21:45 -0800 | [diff] [blame] | 1 | |
| 2 | class SRRouting: |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 3 | |
Andreas Pantelopoulos | 90f0b10 | 2018-02-01 13:21:45 -0800 | [diff] [blame] | 4 | def __init__( self ): |
| 5 | self.default = '' |
| 6 | |
| 7 | def CASE1( self, main ): |
| 8 | """ |
Andreas Pantelopoulos | b7904ce | 2018-02-07 16:24:49 -0800 | [diff] [blame] | 9 | Ping between all ipv4 hosts in the topology. |
Andreas Pantelopoulos | 90f0b10 | 2018-02-01 13:21:45 -0800 | [diff] [blame] | 10 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 11 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 12 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 13 | main.case( "Ping between all ipv4 hosts in the topology" ) |
| 14 | setupTest( main, test_idx=1, onosNodes=3, ipv6=False, external=False ) |
| 15 | verify( main, ipv6=False, disconnected=False, external=False ) |
| 16 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | f6ed501 | 2018-02-08 21:26:01 -0800 | [diff] [blame] | 17 | |
| 18 | def CASE2( self, main ): |
| 19 | """ |
| 20 | Ping between all ipv6 hosts in the topology. |
| 21 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 22 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 23 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 24 | main.case( "Ping between all ipv6 hosts in the topology" ) |
| 25 | setupTest( main, test_idx=2, onosNodes=3, ipv4=False, external=False ) |
| 26 | verify( main, ipv4=False, disconnected=False, external=False ) |
| 27 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | f6ed501 | 2018-02-08 21:26:01 -0800 | [diff] [blame] | 28 | |
You Wang | 7957781 | 2018-02-27 16:39:50 -0800 | [diff] [blame] | 29 | def CASE3( self, main ): |
| 30 | """ |
| 31 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 32 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 33 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 34 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 35 | main.case( "Ping between all ipv4 and ipv6 hosts in the topology" ) |
| 36 | setupTest( main, test_idx=3, onosNodes=3, external=False ) |
| 37 | verify( main, disconnected=False, external=False ) |
| 38 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | ba231e7 | 2018-03-01 13:18:21 -0800 | [diff] [blame] | 39 | |
| 40 | def CASE4( self, main ): |
| 41 | """ |
| 42 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 43 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 44 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 45 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 46 | main.case( "Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts" ) |
| 47 | setupTest( main, test_idx=4, onosNodes=3, ipv6=False ) |
| 48 | verify( main, ipv6=False, disconnected=False ) |
| 49 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | ba231e7 | 2018-03-01 13:18:21 -0800 | [diff] [blame] | 50 | |
| 51 | def CASE5( self, main ): |
| 52 | """ |
| 53 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 54 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 55 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 56 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 57 | main.case( "Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts" ) |
| 58 | setupTest( main, test_idx=5, onosNodes=3, ipv4=False ) |
| 59 | verify( main, ipv4=False, disconnected=False ) |
| 60 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | ba231e7 | 2018-03-01 13:18:21 -0800 | [diff] [blame] | 61 | |
| 62 | def CASE6( self, main ): |
| 63 | """ |
| 64 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 65 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 66 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 67 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 68 | main.case( "Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external hosts" ) |
| 69 | setupTest( main, test_idx=6, onosNodes=3 ) |
| 70 | verify( main, disconnected=False ) |
| 71 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 72 | |
| 73 | def CASE7( self, main ): |
| 74 | """ |
| 75 | Ping between ipv4 hosts and an external host that is not configured in |
| 76 | external router config, but reachable through the use of route-add |
| 77 | command. |
| 78 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 79 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 80 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 81 | main.case( "Ping between from ipv4 hosts to external host configured with route-add command" ) |
| 82 | setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False ) |
| 83 | verify( main, ipv6=False, internal=False, disconnected=False ) |
| 84 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 85 | |
| 86 | def CASE8( self, main ): |
| 87 | """ |
| 88 | Ping between ipv6 hosts and an external host that is not configured in |
| 89 | external router config, but reachable through the use of route-add |
| 90 | command. |
| 91 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 92 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 93 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 94 | main.case( "Ping between from ipv6 hosts to external host configured with route-add command" ) |
| 95 | setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False ) |
| 96 | verify( main, ipv6=False, internal=False, disconnected=False ) |
| 97 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 98 | |
| 99 | def CASE9( self, main ): |
| 100 | """ |
| 101 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 102 | external router config, but reachable through the use of route-add |
| 103 | command. |
| 104 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 105 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 106 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 107 | main.case( "Ping between from ipv4 and ipv6 hosts to external host configured with route-add command" ) |
| 108 | setupTest( main, test_idx=9, onosNodes=3, external=False ) |
| 109 | verify( main, internal=False, disconnected=False ) |
| 110 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 111 | |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 112 | def CASE101( self, main ): |
| 113 | """ |
| 114 | Kill and recover links |
| 115 | Ping between all ipv4 hosts in the topology. |
| 116 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 117 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 118 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 119 | main.case( "Test link failures with IPv4 hosts" ) |
| 120 | setupTest( main, test_idx=101, onosNodes=3, ipv6=False, external=False ) |
| 121 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 122 | verifyLinkFailure( main, ipv6=False, external=False ) |
| 123 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 124 | |
| 125 | def CASE102( self, main ): |
| 126 | """ |
| 127 | Kill and recover links |
| 128 | Ping between all ipv6 hosts in the topology. |
| 129 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 130 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 131 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 132 | main.case( "Test link failures with IPv6 hosts" ) |
| 133 | setupTest( main, test_idx=102, onosNodes=3, ipv4=False, external=False ) |
| 134 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 135 | verifyLinkFailure( main, ipv4=False, external=False ) |
| 136 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 137 | |
| 138 | def CASE103( self, main ): |
| 139 | """ |
| 140 | Kill and recover links |
| 141 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 142 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 143 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 144 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 145 | main.case( "Test link failures with IPv4 and IPv6 hosts" ) |
| 146 | setupTest( main, test_idx=103, onosNodes=3, external=False ) |
| 147 | verify( main, external=False, disconnected=False ) |
| 148 | verifyLinkFailure( main, external=False ) |
| 149 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 150 | |
| 151 | def CASE104( self, main ): |
| 152 | """ |
| 153 | Kill and recover links |
| 154 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 155 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 156 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 157 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 158 | main.case( "Test link failures with IPv4 hosts including external hosts" ) |
| 159 | setupTest( main, test_idx=104, onosNodes=3, ipv6=False ) |
| 160 | verify( main, ipv6=False, disconnected=False ) |
| 161 | verifyLinkFailure( main, ipv6=False ) |
| 162 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 163 | |
| 164 | def CASE105( self, main ): |
| 165 | """ |
| 166 | Kill and recover links |
| 167 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 168 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 169 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 170 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 171 | main.case( "Test link failures with IPv6 hosts including external hosts" ) |
| 172 | setupTest( main, test_idx=105, onosNodes=3, ipv4=False ) |
| 173 | verify( main, ipv4=False, disconnected=False ) |
| 174 | verifyLinkFailure( main, ipv4=False ) |
| 175 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 176 | |
| 177 | def CASE106( self, main ): |
| 178 | """ |
| 179 | Kill and recover links |
| 180 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 181 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 182 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 183 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 184 | main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts" ) |
| 185 | setupTest( main, test_idx=106, onosNodes=3 ) |
| 186 | verify( main, disconnected=False ) |
| 187 | verifyLinkFailure( main ) |
| 188 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 189 | |
| 190 | def CASE107( self, main ): |
| 191 | """ |
| 192 | Kill and recover links |
| 193 | Ping between ipv4 hosts and an external host that is not configured in |
| 194 | external router config, but reachable through the use of route-add command. |
| 195 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 196 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 197 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 198 | main.case( "Test link failures with IPv4 hosts including external hosts configured with route-add command" ) |
| 199 | setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False ) |
| 200 | verify( main, ipv6=False, disconnected=False ) |
| 201 | verifyLinkFailure( main, ipv6=False, internal=False ) |
| 202 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 203 | |
| 204 | def CASE108( self, main ): |
| 205 | """ |
| 206 | Kill and recover links |
| 207 | Ping between ipv6 hosts and an external host that is not configured in |
| 208 | external router config, but reachable through the use of route-add command. |
| 209 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 210 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 211 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 212 | main.case( "Test link failures with IPv6 hosts including external hosts configured with route-add command" ) |
| 213 | setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False ) |
| 214 | verify( main, ipv4=False, disconnected=False ) |
| 215 | verifyLinkFailure( main, ipv4=False, internal=False ) |
| 216 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 217 | |
| 218 | def CASE109( self, main ): |
| 219 | """ |
| 220 | Kill and recover links |
| 221 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 222 | external router config, but reachable through the use of route-add command. |
| 223 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 224 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 225 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 226 | main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
| 227 | setupTest( main, test_idx=109, onosNodes=3, external=False ) |
| 228 | verify( main, disconnected=False ) |
| 229 | verifyLinkFailure( main, internal=False ) |
| 230 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 231 | |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 232 | def CASE201( self, main ): |
| 233 | """ |
| 234 | Kill and recover spine switches |
| 235 | Ping between all ipv4 hosts in the topology. |
| 236 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 237 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 238 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 239 | main.case( "Test switch failures with IPv4 hosts" ) |
| 240 | setupTest( main, test_idx=201, onosNodes=3, ipv6=False, external=False ) |
| 241 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 242 | verifySwitchFailure( main, ipv6=False, external=False ) |
| 243 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 244 | |
| 245 | def CASE202( self, main ): |
| 246 | """ |
| 247 | Kill and recover spine switches |
| 248 | Ping between all ipv6 hosts in the topology. |
| 249 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 250 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 251 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 252 | main.case( "Test switch failures with IPv6 hosts" ) |
| 253 | setupTest( main, test_idx=202, onosNodes=3, ipv4=False, external=False ) |
| 254 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 255 | verifySwitchFailure( main, ipv4=False, external=False ) |
| 256 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 257 | |
| 258 | def CASE203( self, main ): |
| 259 | """ |
| 260 | Kill and recover spine switches |
| 261 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 262 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 263 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 264 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 265 | main.case( "Test switch failures with IPv4 and IPv6 hosts" ) |
| 266 | setupTest( main, test_idx=203, onosNodes=3, external=False ) |
| 267 | verify( main, external=False, disconnected=False ) |
| 268 | verifySwitchFailure( main, external=False ) |
| 269 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 270 | |
| 271 | def CASE204( self, main ): |
| 272 | """ |
| 273 | Kill and recover spine switches |
| 274 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 275 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 276 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 277 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 278 | main.case( "Test switch failures with IPv4 hosts including external hosts" ) |
| 279 | setupTest( main, test_idx=204, onosNodes=3, ipv6=False ) |
| 280 | verify( main, ipv6=False, disconnected=False ) |
| 281 | verifySwitchFailure( main, ipv6=False ) |
| 282 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 283 | |
| 284 | def CASE205( self, main ): |
| 285 | """ |
| 286 | Kill and recover spine switches |
| 287 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 288 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 289 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 290 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 291 | main.case( "Test switch failures with IPv6 hosts including external hosts" ) |
| 292 | setupTest( main, test_idx=205, onosNodes=3, ipv4=False ) |
| 293 | verify( main, ipv4=False, disconnected=False ) |
| 294 | verifySwitchFailure( main, ipv4=False ) |
| 295 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 296 | |
| 297 | def CASE206( self, main ): |
| 298 | """ |
| 299 | Kill and recover spine switches |
| 300 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 301 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 302 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 303 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 304 | main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts" ) |
| 305 | setupTest( main, test_idx=206, onosNodes=3 ) |
| 306 | verify( main, disconnected=False ) |
| 307 | verifySwitchFailure( main ) |
| 308 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 309 | |
| 310 | def CASE207( self, main ): |
| 311 | """ |
| 312 | Kill and recover spine switches |
| 313 | Ping between ipv4 hosts and an external host that is not configured in |
| 314 | external router config, but reachable through the use of route-add command. |
| 315 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 316 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 317 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 318 | main.case( "Test switch failures with IPv4 hosts including external hosts configured with route-add command" ) |
| 319 | setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False ) |
| 320 | verify( main, ipv6=False, disconnected=False ) |
| 321 | verifySwitchFailure( main, ipv6=False, internal=False ) |
| 322 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 323 | |
| 324 | def CASE208( self, main ): |
| 325 | """ |
| 326 | Kill and recover spine switches |
| 327 | Ping between ipv6 hosts and an external host that is not configured in |
| 328 | external router config, but reachable through the use of route-add command. |
| 329 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 330 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 331 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 332 | main.case( "Test switch failures with IPv6 hosts including external hosts configured with route-add command" ) |
| 333 | setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False ) |
| 334 | verify( main, ipv4=False, disconnected=False ) |
| 335 | verifySwitchFailure( main, ipv4=False, internal=False ) |
| 336 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 337 | |
| 338 | def CASE209( self, main ): |
| 339 | """ |
| 340 | Kill and recover spine switches |
| 341 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 342 | external router config, but reachable through the use of route-add command. |
| 343 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 344 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 345 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 346 | main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
| 347 | setupTest( main, test_idx=209, onosNodes=3, external=False ) |
| 348 | verify( main, disconnected=False ) |
| 349 | verifySwitchFailure( main, internal=False ) |
| 350 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 351 | |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 352 | def CASE301( self, main ): |
| 353 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 354 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 355 | Ping between all ipv4 hosts in the topology. |
| 356 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 357 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 358 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 359 | main.case( "Test onos failures with IPv4 hosts" ) |
| 360 | setupTest( main, test_idx=301, onosNodes=3, ipv6=False, external=False ) |
| 361 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 362 | verifyOnosFailure( main, ipv6=False, external=False ) |
| 363 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 364 | |
| 365 | def CASE302( self, main ): |
| 366 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 367 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 368 | Ping between all ipv6 hosts in the topology. |
| 369 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 370 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 371 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 372 | main.case( "Test onos failures with IPv6 hosts" ) |
| 373 | setupTest( main, test_idx=302, onosNodes=3, ipv4=False, external=False ) |
| 374 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 375 | verifyOnosFailure( main, ipv4=False, external=False ) |
| 376 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 377 | |
| 378 | def CASE303( self, main ): |
| 379 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 380 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 381 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 382 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 383 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 384 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 385 | main.case( "Test onos failures with IPv4 and IPv6 hosts" ) |
| 386 | setupTest( main, test_idx=303, onosNodes=3, external=False ) |
| 387 | verify( main, external=False, disconnected=False ) |
| 388 | verifyOnosFailure( main, external=False ) |
| 389 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 390 | |
| 391 | def CASE304( self, main ): |
| 392 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 393 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 394 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 395 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 396 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 397 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 398 | main.case( "Test onos failures with IPv4 hosts including external hosts" ) |
| 399 | setupTest( main, test_idx=304, onosNodes=3, ipv6=False ) |
| 400 | verify( main, ipv6=False, disconnected=False ) |
| 401 | verifyOnosFailure( main, ipv6=False ) |
| 402 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 403 | |
| 404 | def CASE305( self, main ): |
| 405 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 406 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 407 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 408 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 409 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 410 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 411 | main.case( "Test onos failures with IPv6 hosts including external hosts" ) |
| 412 | setupTest( main, test_idx=305, onosNodes=3, ipv4=False ) |
| 413 | verify( main, ipv4=False, disconnected=False ) |
| 414 | verifyOnosFailure( main, ipv4=False ) |
| 415 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 416 | |
| 417 | def CASE306( self, main ): |
| 418 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 419 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 420 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 421 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 422 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 423 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 424 | main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts" ) |
| 425 | setupTest( main, test_idx=306, onosNodes=3 ) |
| 426 | verify( main, disconnected=False ) |
| 427 | verifyOnosFailure( main ) |
| 428 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 429 | |
| 430 | def CASE307( self, main ): |
| 431 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 432 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 433 | Ping between ipv4 hosts and an external host that is not configured in |
| 434 | external router config, but reachable through the use of route-add command. |
| 435 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 436 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 437 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 438 | main.case( "Test onos failures with IPv4 hosts including external hosts configured with route-add command" ) |
| 439 | setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False ) |
| 440 | verify( main, ipv6=False, disconnected=False ) |
| 441 | verifyOnosFailure( main, ipv6=False, internal=False ) |
| 442 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 443 | |
| 444 | def CASE308( self, main ): |
| 445 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 446 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 447 | Ping between ipv6 hosts and an external host that is not configured in |
| 448 | external router config, but reachable through the use of route-add command. |
| 449 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 450 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 451 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 452 | main.case( "Test onos failures with IPv6 hosts including external hosts configured with route-add command" ) |
| 453 | setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False ) |
| 454 | verify( main, ipv4=False, disconnected=False ) |
| 455 | verifyOnosFailure( main, ipv4=False, internal=False ) |
| 456 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 457 | |
| 458 | def CASE309( self, main ): |
| 459 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 460 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 461 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 462 | external router config, but reachable through the use of route-add command. |
| 463 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 464 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 465 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 466 | main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
| 467 | setupTest( main, test_idx=309, onosNodes=3, external=False ) |
| 468 | verify( main, disconnected=False ) |
| 469 | verifyOnosFailure( main, internal=False ) |
| 470 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 471 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 472 | def CASE601( self, main ): |
| 473 | """ |
| 474 | Bring down all switches |
| 475 | Verify Topology |
| 476 | Bring up all switches |
| 477 | Verify |
| 478 | |
| 479 | repeat x3 |
| 480 | """ |
| 481 | import time |
| 482 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 483 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 484 | main.case( "Bring down all switches then recover" ) |
| 485 | setupTest( main, test_idx=601, external=False ) |
| 486 | main.Cluster.next().CLI.balanceMasters() |
| 487 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 488 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 489 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 490 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 491 | switchList = [ 'spine101', 'spine102', 'spine103', 'spine104', |
| 492 | 'leaf1', 'leaf2', 'leaf3', 'leaf4', 'leaf5', 'leaf6' ] |
| 493 | verify( main, disconnected=False, external=False ) |
| 494 | for i in range( 1, 4 ): |
| 495 | main.log.info( "Beginning iteration {} of stopping then starting all switches".format( i ) ) |
| 496 | main.log.debug( main.Cluster.next().summary() ) |
| 497 | # Bring down all switches |
| 498 | main.step( "Stopping switches - iteration " + str( i ) ) |
| 499 | switchStop = main.TRUE |
| 500 | for switch in switchList: |
| 501 | switchStop = switchStop and main.Network.switch( SW=switch, OPTION="stop" ) |
| 502 | utilities.assert_equals( expect=main.TRUE, actual=switchStop, |
| 503 | onpass="All switches stopped", |
| 504 | onfail="Failed to stop all switches" ) |
| 505 | |
| 506 | time.sleep( 60 ) |
| 507 | lib.verifyTopology( main, 0, 0, main.Cluster.numCtrls ) |
| 508 | # Bring up all switches |
| 509 | main.log.debug( main.Cluster.next().summary() ) |
| 510 | main.step( "Starting switches - iteration " + str( i ) ) |
| 511 | switchStart = main.TRUE |
| 512 | for switch in switchList: |
| 513 | switchStart = switchStart and main.Network.switch( SW=switch, OPTION="start" ) |
| 514 | utilities.assert_equals( expect=main.TRUE, actual=switchStart, |
| 515 | onpass="All switches started", |
| 516 | onfail="Failed to start all switches" ) |
| 517 | |
| 518 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 519 | lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls ) |
| 520 | main.log.debug( main.Cluster.next().summary() ) |
| 521 | time.sleep( 60 ) |
| 522 | main.log.debug( main.Cluster.next().summary() ) |
| 523 | time.sleep( 60 ) |
| 524 | main.log.debug( main.Cluster.next().summary() ) |
| 525 | verifyPing( main ) |
| 526 | verify( main, disconnected=False, external=False ) |
| 527 | verify( main, disconnected=False, external=False ) |
| 528 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 529 | |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 530 | def CASE602( self, main ): |
| 531 | """" |
| 532 | Take down a leaf switch that is paired and has a dual homed host |
| 533 | Restore the leaf switch |
| 534 | Repeat for various dual homed hosts and paired switches |
| 535 | """ |
| 536 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 537 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 538 | main.case( "Drop a leaf switch that is paired and has a dual homed host." ) |
| 539 | setupTest( main, test_idx=602, onosNodes=3 ) |
| 540 | verify( main, disconnected=False ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 541 | # We need to disable ports toward dual-homed hosts before killing the leaf switch |
| 542 | portsToDisable = [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 543 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ] |
| 544 | lib.disablePortBatch( main, portsToDisable, 10, 48, 5 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 545 | # Kill leaf-2 |
| 546 | lib.killSwitch( main, "leaf2", 9, 38 ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 547 | # FIXME: the downed interfaces on h4v6 and h5v6 won't disappear because they are |
| 548 | # configured by netcfg |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 549 | hostLocations = { "h4v6": "of:0000000000000003/6", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 550 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 551 | "h4v4": "of:0000000000000003/10", |
| 552 | "h5v4": "of:0000000000000003/11" } |
| 553 | lib.verifyHostLocations( main, hostLocations ) |
| 554 | main.disconnectedIpv4Hosts = [ "h3v4" ] |
| 555 | main.disconnectedIpv6Hosts = [ "h3v6" ] |
| 556 | verify( main ) |
| 557 | # Recover leaf-2 |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 558 | lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 559 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 560 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 561 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 562 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 563 | lib.verifyHostLocations( main, hostLocations ) |
| 564 | main.disconnectedIpv4Hosts = [] |
| 565 | main.disconnectedIpv6Hosts = [] |
| 566 | verify( main, disconnected=False ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 567 | # We need to disable ports toward dual-homed hosts before killing the leaf switch |
| 568 | portsToDisable = [ [ "of:0000000000000004", 7 ], [ "of:0000000000000004", 8 ], |
| 569 | [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ] ] |
| 570 | lib.disablePortBatch( main, portsToDisable, 10, 48, 5 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 571 | # Kill leaf-4 |
| 572 | lib.killSwitch( main, "leaf4", 9, 38 ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 573 | hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ], |
| 574 | "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ], |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 575 | "h9v4": "of:0000000000000005/9", |
| 576 | "h10v4": "of:0000000000000005/10" } |
| 577 | lib.verifyHostLocations( main, hostLocations ) |
| 578 | main.disconnectedIpv4Hosts = [ "h8v4" ] |
| 579 | main.disconnectedIpv6Hosts = [ "h8v6" ] |
| 580 | verify( main ) |
| 581 | # Recover leaf-4 |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 582 | lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 583 | hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ], |
| 584 | "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ], |
| 585 | "h9v4": [ "of:0000000000000004/10", "of:0000000000000005/9" ], |
| 586 | "h10v4": [ "of:0000000000000004/11", "of:0000000000000005/10" ] } |
| 587 | lib.verifyHostLocations( main, hostLocations ) |
| 588 | main.disconnectedIpv4Hosts = [] |
| 589 | main.disconnectedIpv6Hosts = [] |
| 590 | verify( main, disconnected=False ) |
| 591 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 592 | |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 593 | def CASE603( self, main ): |
| 594 | """" |
| 595 | Drop HAGG-1 device and test connectivity. |
| 596 | Drop DAAS-1 device and test connectivity (some hosts lost it) |
| 597 | Bring up DAAS-1 and test connectivity (all hosts gained it again) |
| 598 | |
| 599 | Repeat the same with HAGG-2 and DAAS-2. |
| 600 | """ |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 601 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 602 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 603 | main.case( "Drop hagg spine switch along with dass leaf switch." ) |
| 604 | setupTest( main, test_idx=603, onosNodes=3 ) |
| 605 | main.disconnectedIpv4Hosts = [] |
| 606 | main.disconnectedIpv6Hosts = [] |
| 607 | |
| 608 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 609 | lib.killSwitch( main, "spine103", |
| 610 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 611 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 612 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 613 | lib.killSwitch( main, "leaf6", |
| 614 | int( main.params[ "TOPO" ]["switchNum" ] ) - 2, |
| 615 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 616 | main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4'] |
| 617 | main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6'] |
| 618 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 619 | lib.recoverSwitch( main, "leaf6", |
| 620 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 621 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, |
| 622 | rediscoverHosts=True) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 623 | main.disconnectedIpv4Hosts = [] |
| 624 | main.disconnectedIpv6Hosts = [] |
| 625 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 626 | lib.recoverSwitch( main, "spine103", |
| 627 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 628 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 629 | verify( main ) |
| 630 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 631 | lib.killSwitch( main, "spine104", |
| 632 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 633 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 634 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 635 | lib.killSwitch( main, "leaf1", |
| 636 | int( main.params[ "TOPO" ]["switchNum" ] ) - 2, |
| 637 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 638 | main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4'] |
| 639 | main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6'] |
| 640 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 641 | lib.recoverSwitch( main, "leaf1", |
| 642 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 643 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, |
| 644 | rediscoverHosts=True ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 645 | main.disconnectedIpv4Hosts = [] |
| 646 | main.disconnectedIpv6Hosts = [] |
| 647 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 648 | lib.recoverSwitch( main, "spine104", |
| 649 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 650 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 651 | verify( main ) |
| 652 | |
| 653 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 654 | |
| 655 | def CASE604( self, main ): |
| 656 | """" |
| 657 | Drop HAGG-1 device and test connectivity. |
| 658 | Bring up HAGG-1 and test connectivity. |
| 659 | Drop HAGG-2 device and test connectivity. |
| 660 | Bring up HAGG-2 device and test connectivity |
| 661 | """ |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 662 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 663 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 664 | main.case( "Drop hagg spine switches." ) |
| 665 | setupTest( main, test_idx=604, onosNodes=3 ) |
| 666 | main.disconnectedIpv4Hosts = [] |
| 667 | main.disconnectedIpv6Hosts = [] |
| 668 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 669 | lib.killSwitch( main, "spine103", |
| 670 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 671 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 672 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 673 | lib.recoverSwitch( main, "spine103", |
| 674 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 675 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 676 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 677 | lib.killSwitch( main, "spine104", |
| 678 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 679 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 680 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 681 | lib.recoverSwitch( main, "spine104", |
| 682 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 683 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 684 | verify( main ) |
| 685 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 686 | |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 687 | def CASE605( self, main ): |
| 688 | """ |
| 689 | Drop HAGG-1 and test connectivity (expect no failure) |
| 690 | Drop all leafs in big fabric and test connectivity (expect some failures) |
| 691 | Bring up HAGG-1 and test connectivity (still expect some failures) |
| 692 | Bring up all leafs in big fabric and test connectivity (expect no failure) |
| 693 | Repeat above with HAGG-2 |
| 694 | """ |
| 695 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 696 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 697 | main.case( "Drop one hagg and all leafs in big fabric" ) |
| 698 | setupTest( main, test_idx=605, onosNodes=3 ) |
| 699 | main.disconnectedIpv4Hosts = [] |
| 700 | main.disconnectedIpv6Hosts = [] |
| 701 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 702 | lib.killSwitch( main, "spine103", |
| 703 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, |
| 704 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 705 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 706 | lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 707 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 5, |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 708 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 ) |
| 709 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 710 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 711 | main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ] |
| 712 | main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ] |
| 713 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 714 | lib.recoverSwitch( main, "spine103", |
| 715 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, |
| 716 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 717 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 718 | lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 719 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 720 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
| 721 | main.disconnectedIpv4Hosts = [] |
| 722 | main.disconnectedIpv6Hosts = [] |
| 723 | main.disconnectedExternalIpv4Hosts = [ ] |
| 724 | main.disconnectedExternalIpv6Hosts = [ ] |
| 725 | verify( main ) |
| 726 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 727 | lib.killSwitch( main, "spine104", |
| 728 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, |
| 729 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 730 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 731 | lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 732 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 5, |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 733 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 ) |
| 734 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 735 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 736 | main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ] |
| 737 | main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ] |
| 738 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 739 | lib.recoverSwitch( main, "spine104", |
| 740 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, |
| 741 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 742 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 743 | lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 744 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 745 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
| 746 | main.disconnectedIpv4Hosts = [] |
| 747 | main.disconnectedIpv6Hosts = [] |
| 748 | main.disconnectedExternalIpv4Hosts = [ ] |
| 749 | main.disconnectedExternalIpv6Hosts = [ ] |
| 750 | verify( main ) |
| 751 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 752 | |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 753 | def CASE606( self, main ): |
| 754 | """ |
| 755 | Drop SPINE-1 and test connectivity |
| 756 | Drop paired leaf and test connectivity (expect some failures) |
| 757 | Bring up SPINE-1 and test connectivity (still expect some failures) |
| 758 | Bring up the paired leaf and test connectivity |
| 759 | Repeat above with SPINE-2 and a different paired leaf |
| 760 | """ |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 761 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 762 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 763 | main.case( "Drop spine and paired leaf" ) |
| 764 | setupTest( main, test_idx=606, onosNodes=3 ) |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 765 | verify( main, disconnected=False ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 766 | # Drop spine101 and leaf-2/3 |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 767 | lib.killSwitch( main, "spine101", 9, 30 ) |
| 768 | verify( main, disconnected=False ) |
| 769 | lib.killSwitch( main, "leaf2", 8, 24 ) |
| 770 | lib.killSwitch( main, "leaf3", 7, 20 ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 771 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ] |
| 772 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ] |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 773 | verify( main ) |
| 774 | lib.recoverSwitch( main, "spine101", 8, 30 ) |
| 775 | verify( main ) |
| 776 | lib.recoverSwitch( main, "leaf3", 9, 38 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 777 | lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True, |
| 778 | hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 779 | main.disconnectedIpv4Hosts = [] |
| 780 | main.disconnectedIpv6Hosts = [] |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 781 | verify( main, disconnected=False ) |
| 782 | # Drop spine102 and leaf-4/5 |
| 783 | lib.killSwitch( main, "spine102", 9, 30 ) |
| 784 | verify( main, disconnected=False ) |
| 785 | lib.killSwitch( main, "leaf4", 8, 24 ) |
| 786 | lib.killSwitch( main, "leaf5", 7, 20 ) |
| 787 | main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 788 | main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 789 | verify( main, external=False ) |
| 790 | lib.recoverSwitch( main, "spine102", 8, 30 ) |
| 791 | verify( main, external=False ) |
| 792 | lib.recoverSwitch( main, "leaf5", 9, 38 ) |
| 793 | lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True, |
| 794 | hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
| 795 | main.disconnectedIpv4Hosts = [] |
| 796 | main.disconnectedIpv6Hosts = [] |
| 797 | verify( main, disconnected=False ) |
| 798 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 799 | |
| 800 | def CASE620( self, main ): |
| 801 | """ |
| 802 | Take down one of double links towards the spine from all leaf switches and |
| 803 | check that buckets in select groups change accordingly |
| 804 | Bring up links again and check that buckets in select groups change accordingly |
| 805 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 806 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 807 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 808 | main.case( "Take down one of double links towards the spine" ) |
| 809 | setupTest( main, test_idx=620, onosNodes=3 ) |
| 810 | verify( main, disconnected=False ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 811 | groupBuckets = { "of:0000000000000002": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 812 | "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 813 | "10.2.10.0/24": 4, "10.2.40.0/24": 4, |
| 814 | "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8, |
| 815 | "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 816 | "of:0000000000000003": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 817 | "10.2.0.0/24": 4, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 818 | "10.2.10.0/24": 1, "10.2.40.0/24": 1, |
| 819 | "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8, |
| 820 | "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 821 | "of:0000000000000004": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 822 | "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8, |
| 823 | "10.2.10.0/24": 4, "10.2.40.0/24": 4, |
| 824 | "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 825 | "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 826 | "of:0000000000000005": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 827 | "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8, |
| 828 | "10.2.10.0/24": 4, "10.2.40.0/24": 4, |
| 829 | "10.3.0.0/24": 4, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 830 | "10.3.20.0/24": 1, "10.5.10.0/24": 4, "10.5.20.0/24": 4 } } |
| 831 | for switch, subnets in groupBuckets.items(): |
| 832 | lib.checkGroupsForBuckets( main, switch, subnets ) |
| 833 | # Take down one of double links |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 834 | portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ], |
| 835 | [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ], |
| 836 | [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ], |
| 837 | [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 838 | lib.disablePortBatch( main, portsToDisable, 10, 32 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 839 | groupBucketsNew = { "of:0000000000000002": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 840 | "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 841 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 842 | "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4, |
| 843 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 844 | "of:0000000000000003": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 845 | "10.2.0.0/24": 2, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 846 | "10.2.10.0/24": 1, "10.2.40.0/24": 1, |
| 847 | "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4, |
| 848 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 849 | "of:0000000000000004": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 850 | "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4, |
| 851 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 852 | "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 853 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 854 | "of:0000000000000005": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 855 | "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4, |
| 856 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 857 | "10.3.0.0/24": 2, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 858 | "10.3.20.0/24": 1, "10.5.10.0/24": 2, "10.5.20.0/24": 2 } } |
| 859 | for switch, subnets in groupBucketsNew.items(): |
| 860 | lib.checkGroupsForBuckets( main, switch, subnets ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 861 | verify( main, disconnected=False ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 862 | # Bring up the links |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 863 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 864 | for switch, subnets in groupBuckets.items(): |
| 865 | lib.checkGroupsForBuckets( main, switch, subnets ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 866 | verify( main, disconnected=False ) |
| 867 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 868 | |
| 869 | def CASE621( self, main ): |
| 870 | """ |
| 871 | Remove all the links in the network and restore all Links (repeat x3) |
| 872 | """ |
| 873 | import time |
| 874 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 875 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 876 | main.case( "Remove all the links in the network and restore all Links" ) |
| 877 | setupTest( main, test_idx=621, onosNodes=3 ) |
| 878 | verify( main, disconnected=False ) |
| 879 | linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"], |
| 880 | ["spine103", "leaf6"], ["spine103", "leaf1"], |
| 881 | ["spine104", "leaf6"], ["spine104", "leaf1"], |
| 882 | ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"], |
| 883 | ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"], |
| 884 | ["leaf2", "leaf3"], ["leaf4", "leaf5"] ] |
| 885 | portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ], |
| 886 | [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ], |
| 887 | [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ], |
| 888 | [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ], |
| 889 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ], |
| 890 | [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ], |
| 891 | [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ], |
| 892 | [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ], |
| 893 | [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ], |
| 894 | [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ], |
| 895 | [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ], |
| 896 | [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ], |
| 897 | [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ], |
| 898 | [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ], |
| 899 | [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ], |
| 900 | [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ], |
| 901 | [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ], |
| 902 | [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ], |
| 903 | [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ], |
| 904 | [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ] |
| 905 | for i in range( 0, 3 ): |
| 906 | lib.killLinkBatch( main, linksToRemove, 0, 10 ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 907 | lib.disablePortBatch( main, portsToDisable, 10, 0 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 908 | main.disconnectedIpv4Hosts = main.internalIpv4Hosts |
| 909 | main.disconnectedIpv6Hosts = main.internalIpv6Hosts |
| 910 | verify( main ) |
| 911 | lib.restoreLinkBatch( main, linksToRemove, 48, 10 ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 912 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 913 | main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
| 914 | time.sleep( 10 ) |
| 915 | main.disconnectedIpv4Hosts = [] |
| 916 | main.disconnectedIpv6Hosts = [] |
| 917 | verify( main ) |
| 918 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 919 | |
| 920 | def CASE622( self, main ): |
| 921 | """ |
| 922 | Take down all uplinks from a paired leaf switch |
| 923 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 924 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 925 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 926 | from core import utilities |
| 927 | main.case( "Take down all uplinks from a paired leaf switch" ) |
| 928 | setupTest( main, test_idx=622, onosNodes=3 ) |
| 929 | verify( main, disconnected=False ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 930 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 931 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 932 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 933 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 934 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 935 | linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ] |
| 936 | lib.killLinkBatch( main, linksToRemove, 40, 10 ) |
| 937 | # TODO: more verifications are required |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 938 | main.disconnectedIpv4Hosts = [ "h3v4" ] |
| 939 | main.disconnectedIpv6Hosts = [ "h3v6" ] |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 940 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 941 | hostLocations = { "h4v6": "of:0000000000000003/6", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 942 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 943 | "h4v4": "of:0000000000000003/10", |
| 944 | "h5v4": "of:0000000000000003/11" } |
| 945 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 946 | lib.restoreLinkBatch( main, linksToRemove, 48, 10 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 947 | main.disconnectedIpv4Hosts = [] |
| 948 | main.disconnectedIpv6Hosts = [] |
| 949 | verify( main, disconnected=False ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 950 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 951 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 952 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 953 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 954 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 955 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 956 | |
| 957 | def CASE630( self, main ): |
| 958 | """ |
| 959 | Bring an instance down |
| 960 | Drop a device |
| 961 | Bring that same instance up again and observe that this specific instance sees that the device is down. |
| 962 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 963 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 964 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 965 | from core import utilities |
| 966 | main.case( "Bring an instance down and drop a device" ) |
| 967 | setupTest( main, test_idx=630, onosNodes=3 ) |
| 968 | onosToKill = 0 |
| 969 | deviceToDrop = "spine101" |
| 970 | lib.killOnos( main, [ onosToKill ], 10, 48, 2 ) |
| 971 | lib.killSwitch( main, deviceToDrop, 9, 30 ) |
| 972 | lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 ) |
| 973 | result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 ) |
| 974 | utilities.assert_equals( expect=main.TRUE, actual=result, |
| 975 | onpass="ONOS instance {} sees correct device numbers".format( onosToKill ), |
| 976 | onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 977 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 978 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 979 | def CASE640( self, main ): |
| 980 | """ |
| 981 | Controller instance going down and switch coming down at the same time and then we bring them up together |
| 982 | |
| 983 | A. Instance goes down and SPINE-1 goes down |
| 984 | - All connectivity should be there |
| 985 | - Bring them up together |
| 986 | - All connectivity should be there |
| 987 | B. Instance goes down and HAGG-1 goes down |
| 988 | - All connectivity should be there |
| 989 | - Bring them up together |
| 990 | - All connectivity should be there |
| 991 | C. Instance goes down and a paired leaf switch goes down |
| 992 | - Single homed hosts in this leaf should lose connectivity all others should be ok |
| 993 | - Bring them up together |
| 994 | - Test connectivity |
| 995 | """ |
| 996 | import time |
| 997 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 998 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 999 | main.case( "Drop an ONOS instance and switch(es) at the same time" ) |
| 1000 | caseDict = { 'A': { 'switches': "spine101", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1001 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1002 | 'disconnectedV4': [], |
| 1003 | 'disconnectedV6': [], |
| 1004 | 'expectedSwitches': 9, |
| 1005 | 'expectedLinks': 30 }, |
| 1006 | 'B': { 'switches': "spine103", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1007 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1008 | 'disconnectedV4': [], |
| 1009 | 'disconnectedV6': [], |
| 1010 | 'expectedSwitches': 9, |
| 1011 | 'expectedLinks': 42 }, |
| 1012 | 'C': { 'switches': "leaf2", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1013 | 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 1014 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1015 | 'disconnectedV4': [ "h3v4" ], |
| 1016 | 'disconnectedV6': [ "h3v6" ], |
| 1017 | 'expectedSwitches': 9, |
| 1018 | 'expectedLinks': 38 } } |
| 1019 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 1020 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 1021 | nodeIndex = 0 |
| 1022 | cases = sorted( caseDict.keys() ) |
| 1023 | for case in cases: |
| 1024 | switches = caseDict[ case ][ 'switches' ] |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1025 | ports = caseDict[ case ][ 'ports' ] |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1026 | expectedSwitches = caseDict[ case ][ 'expectedSwitches' ] |
| 1027 | expectedLinks = caseDict[ case ][ 'expectedLinks' ] |
| 1028 | main.step( "\n640{}: Drop ONOS{} and switch(es) {} at the same time".format( case, |
| 1029 | nodeIndex + 1, |
| 1030 | switches ) ) |
| 1031 | setupTest( main, test_idx=640 ) |
| 1032 | main.Cluster.next().CLI.balanceMasters() |
| 1033 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1034 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1035 | instance = main.Cluster.controllers[ nodeIndex ] |
| 1036 | verify( main, disconnected=False, external=False ) |
| 1037 | |
| 1038 | # Simultaneous failures |
| 1039 | main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) ) |
| 1040 | killResult = main.ONOSbench.onosDie( instance.ipAddress ) |
| 1041 | utilities.assert_equals( expect=main.TRUE, actual=killResult, |
| 1042 | onpass="ONOS node killed", |
| 1043 | onfail="Failed to kill ONOS node" ) |
| 1044 | instance.active = False |
| 1045 | main.Cluster.reset() |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1046 | if ports: |
| 1047 | lib.disablePortBatch( main, ports, 10, 48, 0 ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1048 | # TODO: Remove sleeps from the concurrent events |
| 1049 | lib.killSwitch( main, switches, expectedSwitches, expectedLinks ) |
| 1050 | main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ] |
| 1051 | main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ] |
| 1052 | |
| 1053 | # verify functionality |
| 1054 | main.log.debug( main.Cluster.next().summary() ) |
| 1055 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1056 | main.log.debug( main.Cluster.next().summary() ) |
| 1057 | lib.verifyTopology( main, expectedSwitches, expectedLinks, main.Cluster.numCtrls - 1 ) |
| 1058 | lib.verifyNodes( main ) |
| 1059 | verify( main, external=False ) |
| 1060 | |
| 1061 | # Bring everything back up |
| 1062 | lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True ) |
| 1063 | main.disconnectedIpv4Hosts = [] |
| 1064 | main.disconnectedIpv6Hosts = [] |
| 1065 | lib.recoverOnos( main, [ nodeIndex ], expectedSwitches, expectedLinks, main.Cluster.numCtrls ) |
| 1066 | |
| 1067 | # Verify functionality |
| 1068 | lib.verifyNodes( main ) |
| 1069 | verify( main, disconnected=False, external=False ) |
| 1070 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1071 | nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls |
| 1072 | |
| 1073 | def CASE641( self, main ): |
| 1074 | """ |
| 1075 | Controller instance going down while switch comes up at the same time |
| 1076 | |
| 1077 | A. Take down SPINE-1 |
| 1078 | - Test connectivity |
| 1079 | - Bring up SPINE-1 and drop an instance at the same time |
| 1080 | - Test connectivity |
| 1081 | - Bring up instance one |
| 1082 | - Test connectivity |
| 1083 | B. Take down HAGG-1 |
| 1084 | - Test connectivity |
| 1085 | - Bring up HAGG-1 and drop an instance at the same time |
| 1086 | - Test connectivity |
| 1087 | - Bring up instance one |
| 1088 | - Test connectivity |
| 1089 | C. Take down a paired leaf switch |
| 1090 | - Test connectivity ( single homed hosts on this leaf will lose it ) |
| 1091 | - Bring up paired leaf switch and drop a controller instance at the same time |
| 1092 | - Test connectivity |
| 1093 | - Bring up the instance |
| 1094 | - Test connectivity |
| 1095 | """ |
| 1096 | import time |
| 1097 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1098 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1099 | main.case( "Drop an ONOS instance and recover switch(es) at the same time" ) |
| 1100 | caseDict = { 'A': { 'switches': "spine101", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1101 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1102 | 'disconnectedV4': [], |
| 1103 | 'disconnectedV6': [], |
| 1104 | 'expectedSwitches': 9, |
| 1105 | 'expectedLinks': 30 }, |
| 1106 | 'B': { 'switches': "spine103", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1107 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1108 | 'disconnectedV4': [], |
| 1109 | 'disconnectedV6': [], |
| 1110 | 'expectedSwitches': 9, |
| 1111 | 'expectedLinks': 42 }, |
| 1112 | 'C': { 'switches': "leaf2", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1113 | 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 1114 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1115 | 'disconnectedV4': [ "h3v4" ], |
| 1116 | 'disconnectedV6': [ "h3v6" ], |
| 1117 | 'expectedSwitches': 9, |
| 1118 | 'expectedLinks': 38 } } |
| 1119 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 1120 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 1121 | nodeIndex = 0 |
| 1122 | cases = sorted( caseDict.keys() ) |
| 1123 | for case in cases: |
| 1124 | switches = caseDict[ case ][ 'switches' ] |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1125 | ports = caseDict[ case ][ 'ports' ] |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1126 | expectedSwitches = caseDict[ case ][ 'expectedSwitches' ] |
| 1127 | expectedLinks = caseDict[ case ][ 'expectedLinks' ] |
| 1128 | main.step( "\n641{}: Drop ONOS{} and recover switch(es) {} at the same time".format( case, |
| 1129 | nodeIndex + 1, |
| 1130 | switches ) ) |
| 1131 | setupTest( main, test_idx=641 ) |
| 1132 | main.Cluster.next().CLI.balanceMasters() |
| 1133 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1134 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1135 | instance = main.Cluster.controllers[ nodeIndex ] |
| 1136 | verify( main, disconnected=False, external=False ) |
| 1137 | # Drop the switch to setup scenario |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame^] | 1138 | if ports: |
| 1139 | lib.disablePortBatch( main, ports, 10, 48, 5 ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1140 | lib.killSwitch( main, switches, expectedSwitches, expectedLinks ) |
| 1141 | main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ] |
| 1142 | main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ] |
| 1143 | verify( main, external=False ) |
| 1144 | |
| 1145 | # Simultaneous node failure and switch recovery |
| 1146 | main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) ) |
| 1147 | killResult = main.ONOSbench.onosDie( instance.ipAddress ) |
| 1148 | utilities.assert_equals( expect=main.TRUE, actual=killResult, |
| 1149 | onpass="ONOS node killed", |
| 1150 | onfail="Failed to kill ONOS node" ) |
| 1151 | instance.active = False |
| 1152 | main.Cluster.reset() |
| 1153 | # TODO: Remove sleeps from the concurrent events |
| 1154 | lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True ) |
| 1155 | main.disconnectedIpv4Hosts = [] |
| 1156 | main.disconnectedIpv6Hosts = [] |
| 1157 | |
| 1158 | # verify functionality |
| 1159 | main.log.debug( main.Cluster.next().summary() ) |
| 1160 | lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True ) |
| 1161 | main.log.debug( main.Cluster.next().summary() ) |
| 1162 | lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls - 1 ) |
| 1163 | lib.verifyNodes( main ) |
| 1164 | verify( main, disconnected=False, external=False ) |
| 1165 | |
| 1166 | # Bring everything back up and verify functionality |
| 1167 | lib.recoverOnos( main, [ nodeIndex ], totalSwitches, totalLinks, main.Cluster.numCtrls ) |
| 1168 | lib.verifyNodes( main ) |
| 1169 | verify( main, external=False ) |
| 1170 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1171 | nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls |
| 1172 | |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1173 | def CASE642( self, main ): |
| 1174 | """ |
| 1175 | Drop one link from each double link |
| 1176 | Drop a link between DAAS-1 and HAAG-1 |
| 1177 | Drop a link between HAGG-2 and SPINE-2 |
| 1178 | Drop one ONOS instance |
| 1179 | Test connectivity (expect no failure) |
| 1180 | Bring up all links and ONOS instance |
| 1181 | Test connectivity (expect no failure) |
| 1182 | """ |
| 1183 | import time |
| 1184 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1185 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1186 | main.case( "Drop ONOS instance and links at the same time" ) |
| 1187 | setupTest( main, test_idx=642, onosNodes=3 ) |
| 1188 | main.Cluster.active( 0 ).CLI.balanceMasters() |
| 1189 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1190 | verify( main ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1191 | portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ], |
| 1192 | [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ], |
| 1193 | [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ], |
| 1194 | [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ], |
| 1195 | [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ], |
| 1196 | [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ], |
| 1197 | [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ], |
| 1198 | [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ], |
| 1199 | [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ], |
| 1200 | [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ], |
| 1201 | [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1202 | lib.disablePortBatch( main, portsToDisable, |
| 1203 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1204 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), |
| 1205 | sleep=0 ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1206 | lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1207 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 ) |
| 1208 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1209 | lib.enablePortBatch( main, portsToDisable, |
| 1210 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1211 | int( main.params[ "TOPO" ][ "linkNum" ] ), |
| 1212 | sleep=0 ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1213 | lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1214 | int( main.params[ "TOPO" ][ "linkNum" ] ), 3 ) |
| 1215 | verify( main ) |
| 1216 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1217 | |
| 1218 | def CASE643( self, main ): |
| 1219 | """ |
| 1220 | Drop one link from each double link |
| 1221 | Drop a link between DAAS-1 and HAAG-1 |
| 1222 | Drop a link between HAGG-2 and SPINE-2 |
| 1223 | Test connectivity (expect no failure) |
| 1224 | Bring up all links |
| 1225 | Drop one ONOS instance |
| 1226 | Test connectivity (expect no failure) |
| 1227 | Bring up ONOS instance |
| 1228 | Test connectivity (expect no failure) |
| 1229 | """ |
| 1230 | import time |
| 1231 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1232 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1233 | main.case( "Drop ONOS instances and bring up links at the same time" ) |
| 1234 | setupTest( main, test_idx=643, onosNodes=3 ) |
| 1235 | main.Cluster.active( 0 ).CLI.balanceMasters() |
| 1236 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1237 | verify( main ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1238 | portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ], |
| 1239 | [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ], |
| 1240 | [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ], |
| 1241 | [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ], |
| 1242 | [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ], |
| 1243 | [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ], |
| 1244 | [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ], |
| 1245 | [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ], |
| 1246 | [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ], |
| 1247 | [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ], |
| 1248 | [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1249 | lib.disablePortBatch( main, portsToDisable, |
| 1250 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1251 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1252 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1253 | lib.enablePortBatch( main, portsToDisable, |
| 1254 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1255 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1256 | lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1257 | int( main.params[ "TOPO" ][ "linkNum" ] ), 2 ) |
| 1258 | verify( main ) |
| 1259 | lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1260 | int( main.params[ "TOPO" ][ "linkNum" ] ), 3 ) |
| 1261 | verify( main ) |
| 1262 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1263 | |
| 1264 | def CASE651( self, main ): |
| 1265 | """ |
| 1266 | Move a single-homed host from port A to port B in DAAS-1 |
| 1267 | Test connectivity (expect no failure) |
| 1268 | |
| 1269 | Repeat with DAAS-2 |
| 1270 | """ |
| 1271 | import time |
| 1272 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1273 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1274 | main.case( "Move a single-homed host to another port in the same DAAS" ) |
| 1275 | setupTest( main, test_idx=651, onosNodes=3 ) |
| 1276 | main.Cluster.active( 0 ).CLI.balanceMasters() |
| 1277 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1278 | verify( main ) |
| 1279 | |
| 1280 | h1v4cfg = '{"of:0000000000000001/7" : { "interfaces" : [ { "ips" : [ "10.1.0.254/24" ], "vlan-untagged": 10 } ] } }' |
| 1281 | lib.moveHost( main, "h1v4", "leaf1", "leaf1", "10.1.0.254", prefixLen=24, cfg=h1v4cfg ) |
| 1282 | verify( main ) |
| 1283 | |
| 1284 | h13v4cfg = '''{"of:0000000000000006/7" : { "interfaces" : [ { "ips" : [ "10.5.20.254/24" ], "vlan-untagged": 20 } ] } }''' |
| 1285 | lib.moveHost( main, "h13v4", "leaf6", "leaf6", "10.5.20.254", prefixLen=24, cfg=h13v4cfg ) |
| 1286 | verify( main ) |