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" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 82 | setupTest( main, test_idx=7, onosNodes=3, ipv6=False, external=False, static=True ) |
| 83 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 84 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 85 | verify( main, ipv6=False, internal=False, disconnected=False ) |
| 86 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 87 | |
| 88 | def CASE8( self, main ): |
| 89 | """ |
| 90 | Ping between ipv6 hosts and an external host that is not configured in |
| 91 | external router config, but reachable through the use of route-add |
| 92 | command. |
| 93 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 94 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 95 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 96 | main.case( "Ping between from ipv6 hosts to external host configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 97 | setupTest( main, test_idx=8, onosNodes=3, ipv4=False, external=False, static=True ) |
| 98 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 99 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | f6c8343 | 2018-05-30 17:01:01 -0700 | [diff] [blame] | 100 | verify( main, ipv4=False, internal=False, disconnected=False ) |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 101 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 102 | |
| 103 | def CASE9( self, main ): |
| 104 | """ |
Jon Hall | 3957026 | 2020-11-17 12:18:19 -0800 | [diff] [blame] | 105 | Ping between ipv4 and ipv6 hosts and external hosts that is not configured in |
Andreas Pantelopoulos | 2eae324 | 2018-03-06 13:47:20 -0800 | [diff] [blame] | 106 | external router config, but reachable through the use of route-add |
| 107 | command. |
| 108 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 109 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 110 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 111 | main.case( "Ping between from ipv4 and ipv6 hosts to external host configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 112 | setupTest( main, test_idx=9, onosNodes=3, external=False, static=True ) |
| 113 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 114 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 115 | verify( main, internal=False, disconnected=False ) |
| 116 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 117 | |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 118 | def CASE101( self, main ): |
| 119 | """ |
| 120 | Kill and recover links |
| 121 | Ping between all ipv4 hosts in the topology. |
| 122 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 123 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 124 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 125 | main.case( "Test link failures with IPv4 hosts" ) |
| 126 | setupTest( main, test_idx=101, onosNodes=3, ipv6=False, external=False ) |
| 127 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 128 | verifyLinkFailure( main, ipv6=False, external=False ) |
| 129 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 130 | |
| 131 | def CASE102( self, main ): |
| 132 | """ |
| 133 | Kill and recover links |
| 134 | Ping between all ipv6 hosts in the topology. |
| 135 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 136 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 137 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 138 | main.case( "Test link failures with IPv6 hosts" ) |
| 139 | setupTest( main, test_idx=102, onosNodes=3, ipv4=False, external=False ) |
| 140 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 141 | verifyLinkFailure( main, ipv4=False, external=False ) |
| 142 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 143 | |
| 144 | def CASE103( self, main ): |
| 145 | """ |
| 146 | Kill and recover links |
| 147 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 148 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 149 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 150 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 151 | main.case( "Test link failures with IPv4 and IPv6 hosts" ) |
| 152 | setupTest( main, test_idx=103, onosNodes=3, external=False ) |
| 153 | verify( main, external=False, disconnected=False ) |
| 154 | verifyLinkFailure( main, external=False ) |
| 155 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 156 | |
| 157 | def CASE104( self, main ): |
| 158 | """ |
| 159 | Kill and recover links |
| 160 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 161 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 162 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 163 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 164 | main.case( "Test link failures with IPv4 hosts including external hosts" ) |
| 165 | setupTest( main, test_idx=104, onosNodes=3, ipv6=False ) |
| 166 | verify( main, ipv6=False, disconnected=False ) |
| 167 | verifyLinkFailure( main, ipv6=False ) |
| 168 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 169 | |
| 170 | def CASE105( self, main ): |
| 171 | """ |
| 172 | Kill and recover links |
| 173 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 174 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 175 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 176 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 177 | main.case( "Test link failures with IPv6 hosts including external hosts" ) |
| 178 | setupTest( main, test_idx=105, onosNodes=3, ipv4=False ) |
| 179 | verify( main, ipv4=False, disconnected=False ) |
| 180 | verifyLinkFailure( main, ipv4=False ) |
| 181 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 182 | |
| 183 | def CASE106( self, main ): |
| 184 | """ |
| 185 | Kill and recover links |
| 186 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 187 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 188 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 189 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 190 | main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts" ) |
| 191 | setupTest( main, test_idx=106, onosNodes=3 ) |
| 192 | verify( main, disconnected=False ) |
| 193 | verifyLinkFailure( main ) |
| 194 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 195 | |
| 196 | def CASE107( self, main ): |
| 197 | """ |
| 198 | Kill and recover links |
| 199 | Ping between ipv4 hosts and an external host that is not configured in |
| 200 | external router config, but reachable through the use of route-add command. |
| 201 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 202 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 203 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 204 | main.case( "Test link failures with IPv4 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 205 | setupTest( main, test_idx=107, onosNodes=3, ipv6=False, external=False, static=True ) |
| 206 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 207 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 208 | verify( main, ipv6=False, disconnected=False ) |
| 209 | verifyLinkFailure( main, ipv6=False, internal=False ) |
| 210 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 211 | |
| 212 | def CASE108( self, main ): |
| 213 | """ |
| 214 | Kill and recover links |
| 215 | Ping between ipv6 hosts and an external host that is not configured in |
| 216 | external router config, but reachable through the use of route-add command. |
| 217 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 218 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 219 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 220 | main.case( "Test link failures with IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 221 | setupTest( main, test_idx=108, onosNodes=3, ipv4=False, external=False, static=True ) |
| 222 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 223 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 224 | verify( main, ipv4=False, disconnected=False ) |
| 225 | verifyLinkFailure( main, ipv4=False, internal=False ) |
| 226 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 227 | |
| 228 | def CASE109( self, main ): |
| 229 | """ |
| 230 | Kill and recover links |
| 231 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 232 | external router config, but reachable through the use of route-add command. |
| 233 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 234 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 235 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 236 | main.case( "Test link failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 237 | setupTest( main, test_idx=109, onosNodes=3, external=False, static=True ) |
| 238 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 239 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 240 | verify( main, disconnected=False ) |
| 241 | verifyLinkFailure( main, internal=False ) |
| 242 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 243 | |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 244 | def CASE201( self, main ): |
| 245 | """ |
| 246 | Kill and recover spine switches |
| 247 | Ping between all ipv4 hosts in the topology. |
| 248 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 249 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 250 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 251 | main.case( "Test switch failures with IPv4 hosts" ) |
| 252 | setupTest( main, test_idx=201, onosNodes=3, ipv6=False, external=False ) |
| 253 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 254 | verifySwitchFailure( main, ipv6=False, external=False ) |
| 255 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 256 | |
| 257 | def CASE202( self, main ): |
| 258 | """ |
| 259 | Kill and recover spine switches |
| 260 | Ping between all ipv6 hosts in the topology. |
| 261 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 262 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 263 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 264 | main.case( "Test switch failures with IPv6 hosts" ) |
| 265 | setupTest( main, test_idx=202, onosNodes=3, ipv4=False, external=False ) |
| 266 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 267 | verifySwitchFailure( main, ipv4=False, external=False ) |
| 268 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 269 | |
| 270 | def CASE203( self, main ): |
| 271 | """ |
| 272 | Kill and recover spine switches |
| 273 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 274 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 275 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 276 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 277 | main.case( "Test switch failures with IPv4 and IPv6 hosts" ) |
| 278 | setupTest( main, test_idx=203, onosNodes=3, external=False ) |
| 279 | verify( main, external=False, disconnected=False ) |
| 280 | verifySwitchFailure( main, external=False ) |
| 281 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 282 | |
| 283 | def CASE204( self, main ): |
| 284 | """ |
| 285 | Kill and recover spine switches |
| 286 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 287 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 288 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 289 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 290 | main.case( "Test switch failures with IPv4 hosts including external hosts" ) |
| 291 | setupTest( main, test_idx=204, onosNodes=3, ipv6=False ) |
| 292 | verify( main, ipv6=False, disconnected=False ) |
| 293 | verifySwitchFailure( main, ipv6=False ) |
| 294 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 295 | |
| 296 | def CASE205( self, main ): |
| 297 | """ |
| 298 | Kill and recover spine switches |
| 299 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 300 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 301 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 302 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 303 | main.case( "Test switch failures with IPv6 hosts including external hosts" ) |
| 304 | setupTest( main, test_idx=205, onosNodes=3, ipv4=False ) |
| 305 | verify( main, ipv4=False, disconnected=False ) |
| 306 | verifySwitchFailure( main, ipv4=False ) |
| 307 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 308 | |
| 309 | def CASE206( self, main ): |
| 310 | """ |
| 311 | Kill and recover spine switches |
| 312 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 313 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 314 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 315 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 316 | main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts" ) |
| 317 | setupTest( main, test_idx=206, onosNodes=3 ) |
| 318 | verify( main, disconnected=False ) |
| 319 | verifySwitchFailure( main ) |
| 320 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 321 | |
| 322 | def CASE207( self, main ): |
| 323 | """ |
| 324 | Kill and recover spine switches |
| 325 | Ping between ipv4 hosts and an external host that is not configured in |
| 326 | external router config, but reachable through the use of route-add command. |
| 327 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 328 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 329 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 330 | main.case( "Test switch failures with IPv4 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 331 | setupTest( main, test_idx=207, onosNodes=3, ipv6=False, external=False, static=True ) |
| 332 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 333 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 334 | verify( main, ipv6=False, disconnected=False ) |
| 335 | verifySwitchFailure( main, ipv6=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 CASE208( self, main ): |
| 339 | """ |
| 340 | Kill and recover spine switches |
| 341 | Ping between ipv6 hosts and an external host 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 IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 347 | setupTest( main, test_idx=208, onosNodes=3, ipv4=False, external=False, static=True ) |
| 348 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 349 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 350 | verify( main, ipv4=False, disconnected=False ) |
| 351 | verifySwitchFailure( main, ipv4=False, internal=False ) |
| 352 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 2731757 | 2018-03-06 12:13:11 -0800 | [diff] [blame] | 353 | |
| 354 | def CASE209( self, main ): |
| 355 | """ |
| 356 | Kill and recover spine switches |
| 357 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 358 | external router config, but reachable through the use of route-add command. |
| 359 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 360 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 361 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 362 | main.case( "Test switch failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 363 | setupTest( main, test_idx=209, onosNodes=3, external=False, static=True ) |
| 364 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 365 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 366 | verify( main, disconnected=False ) |
| 367 | verifySwitchFailure( main, internal=False ) |
| 368 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 369 | |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 370 | def CASE301( self, main ): |
| 371 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 372 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 373 | Ping between all ipv4 hosts in the topology. |
| 374 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 375 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 376 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 377 | main.case( "Test onos failures with IPv4 hosts" ) |
| 378 | setupTest( main, test_idx=301, onosNodes=3, ipv6=False, external=False ) |
| 379 | verify( main, ipv6=False, external=False, disconnected=False ) |
| 380 | verifyOnosFailure( main, ipv6=False, external=False ) |
| 381 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 382 | |
| 383 | def CASE302( self, main ): |
| 384 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 385 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 386 | Ping between all ipv6 hosts in the topology. |
| 387 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 388 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 389 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 390 | main.case( "Test onos failures with IPv6 hosts" ) |
| 391 | setupTest( main, test_idx=302, onosNodes=3, ipv4=False, external=False ) |
| 392 | verify( main, ipv4=False, external=False, disconnected=False ) |
| 393 | verifyOnosFailure( main, ipv4=False, external=False ) |
| 394 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 395 | |
| 396 | def CASE303( self, main ): |
| 397 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 398 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 399 | Ping between all ipv4 and ipv6 hosts in the topology. |
| 400 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 401 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 402 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 403 | main.case( "Test onos failures with IPv4 and IPv6 hosts" ) |
| 404 | setupTest( main, test_idx=303, onosNodes=3, external=False ) |
| 405 | verify( main, external=False, disconnected=False ) |
| 406 | verifyOnosFailure( main, external=False ) |
| 407 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 408 | |
| 409 | def CASE304( self, main ): |
| 410 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 411 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 412 | Ping between all ipv4 hosts in the topology and check connectivity to external ipv4 hosts |
| 413 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 414 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 415 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 416 | main.case( "Test onos failures with IPv4 hosts including external hosts" ) |
| 417 | setupTest( main, test_idx=304, onosNodes=3, ipv6=False ) |
| 418 | verify( main, ipv6=False, disconnected=False ) |
| 419 | verifyOnosFailure( main, ipv6=False ) |
| 420 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 421 | |
| 422 | def CASE305( self, main ): |
| 423 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 424 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 425 | Ping between all ipv6 hosts in the topology and check connectivity to external ipv6 hosts |
| 426 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 427 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 428 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 429 | main.case( "Test onos failures with IPv6 hosts including external hosts" ) |
| 430 | setupTest( main, test_idx=305, onosNodes=3, ipv4=False ) |
| 431 | verify( main, ipv4=False, disconnected=False ) |
| 432 | verifyOnosFailure( main, ipv4=False ) |
| 433 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 434 | |
| 435 | def CASE306( self, main ): |
| 436 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 437 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 438 | Ping between all ipv4 and ipv6 hosts in the topology and check connectivity to external ipv4 and ipv6 hosts |
| 439 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 440 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 441 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 442 | main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts" ) |
| 443 | setupTest( main, test_idx=306, onosNodes=3 ) |
| 444 | verify( main, disconnected=False ) |
| 445 | verifyOnosFailure( main ) |
| 446 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 447 | |
| 448 | def CASE307( self, main ): |
| 449 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 450 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 451 | Ping between ipv4 hosts and an external host that is not configured in |
| 452 | external router config, but reachable through the use of route-add command. |
| 453 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 454 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 455 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 456 | main.case( "Test onos failures with IPv4 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 457 | setupTest( main, test_idx=307, onosNodes=3, ipv6=False, external=False, static=True ) |
| 458 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 459 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 460 | verify( main, ipv6=False, disconnected=False ) |
| 461 | verifyOnosFailure( main, ipv6=False, internal=False ) |
| 462 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 463 | |
| 464 | def CASE308( self, main ): |
| 465 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 466 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 467 | Ping between ipv6 hosts and an external host that is not configured in |
| 468 | external router config, but reachable through the use of route-add command. |
| 469 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 470 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 471 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 472 | main.case( "Test onos failures with IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 473 | setupTest( main, test_idx=308, onosNodes=3, ipv4=False, external=False, static=True ) |
| 474 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 475 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 476 | verify( main, ipv4=False, disconnected=False ) |
| 477 | verifyOnosFailure( main, ipv4=False, internal=False ) |
| 478 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 479 | |
| 480 | def CASE309( self, main ): |
| 481 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 482 | Kill and recover onos nodes |
Jon Hall | 3c91016 | 2018-03-07 14:42:16 -0800 | [diff] [blame] | 483 | Ping between ipv4 and pv6 hosts and external hosts that is not configured in |
| 484 | external router config, but reachable through the use of route-add command. |
| 485 | """ |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 486 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 487 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 488 | main.case( "Test onos failures with IPv4 and IPv6 hosts including external hosts configured with route-add command" ) |
You Wang | 4efd66b | 2018-06-12 14:47:26 -0700 | [diff] [blame] | 489 | setupTest( main, test_idx=309, onosNodes=3, external=False, static=True ) |
| 490 | main.externalIpv4Hosts = main.staticIpv4Hosts |
| 491 | main.externalIpv6Hosts = main.staticIpv6Hosts |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 492 | verify( main, disconnected=False ) |
| 493 | verifyOnosFailure( main, internal=False ) |
| 494 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Andreas Pantelopoulos | fab6bf3 | 2018-03-06 18:56:35 -0800 | [diff] [blame] | 495 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 496 | def CASE601( self, main ): |
| 497 | """ |
| 498 | Bring down all switches |
| 499 | Verify Topology |
| 500 | Bring up all switches |
| 501 | Verify |
| 502 | |
| 503 | repeat x3 |
| 504 | """ |
| 505 | import time |
| 506 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 507 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 508 | main.case( "Bring down all switches then recover" ) |
| 509 | setupTest( main, test_idx=601, external=False ) |
| 510 | main.Cluster.next().CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 511 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 512 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 513 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 514 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 515 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 516 | switchList = [ 'spine101', 'spine102', 'spine103', 'spine104', |
| 517 | 'leaf1', 'leaf2', 'leaf3', 'leaf4', 'leaf5', 'leaf6' ] |
| 518 | verify( main, disconnected=False, external=False ) |
| 519 | for i in range( 1, 4 ): |
| 520 | main.log.info( "Beginning iteration {} of stopping then starting all switches".format( i ) ) |
| 521 | main.log.debug( main.Cluster.next().summary() ) |
| 522 | # Bring down all switches |
| 523 | main.step( "Stopping switches - iteration " + str( i ) ) |
| 524 | switchStop = main.TRUE |
| 525 | for switch in switchList: |
| 526 | switchStop = switchStop and main.Network.switch( SW=switch, OPTION="stop" ) |
| 527 | utilities.assert_equals( expect=main.TRUE, actual=switchStop, |
| 528 | onpass="All switches stopped", |
| 529 | onfail="Failed to stop all switches" ) |
| 530 | |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 531 | main.log.debug( "sleeping %i seconds" % float( 60 ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 532 | time.sleep( 60 ) |
| 533 | lib.verifyTopology( main, 0, 0, main.Cluster.numCtrls ) |
| 534 | # Bring up all switches |
| 535 | main.log.debug( main.Cluster.next().summary() ) |
| 536 | main.step( "Starting switches - iteration " + str( i ) ) |
| 537 | switchStart = main.TRUE |
| 538 | for switch in switchList: |
| 539 | switchStart = switchStart and main.Network.switch( SW=switch, OPTION="start" ) |
| 540 | utilities.assert_equals( expect=main.TRUE, actual=switchStart, |
| 541 | onpass="All switches started", |
| 542 | onfail="Failed to start all switches" ) |
| 543 | |
| 544 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 545 | lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls ) |
| 546 | main.log.debug( main.Cluster.next().summary() ) |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 547 | main.log.debug( "sleeping %i seconds" % float( 60 ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 548 | time.sleep( 60 ) |
| 549 | main.log.debug( main.Cluster.next().summary() ) |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 550 | main.log.debug( "sleeping %i seconds" % float( 60 ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 551 | time.sleep( 60 ) |
| 552 | main.log.debug( main.Cluster.next().summary() ) |
| 553 | verifyPing( main ) |
| 554 | verify( main, disconnected=False, external=False ) |
| 555 | verify( main, disconnected=False, external=False ) |
| 556 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 557 | |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 558 | def CASE602( self, main ): |
| 559 | """" |
| 560 | Take down a leaf switch that is paired and has a dual homed host |
| 561 | Restore the leaf switch |
| 562 | Repeat for various dual homed hosts and paired switches |
| 563 | """ |
| 564 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 565 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 566 | main.case( "Drop a leaf switch that is paired and has a dual homed host." ) |
| 567 | setupTest( main, test_idx=602, onosNodes=3 ) |
| 568 | verify( main, disconnected=False ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 569 | # We need to disable ports toward dual-homed hosts before killing the leaf switch |
| 570 | portsToDisable = [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 571 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ] |
| 572 | lib.disablePortBatch( main, portsToDisable, 10, 48, 5 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 573 | # Kill leaf-2 |
| 574 | lib.killSwitch( main, "leaf2", 9, 38 ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 575 | # FIXME: the downed interfaces on h4v6 and h5v6 won't disappear because they are |
| 576 | # configured by netcfg |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 577 | hostLocations = { "h4v6": "of:0000000000000003/6", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 578 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 579 | "h4v4": "of:0000000000000003/10", |
| 580 | "h5v4": "of:0000000000000003/11" } |
| 581 | lib.verifyHostLocations( main, hostLocations ) |
| 582 | main.disconnectedIpv4Hosts = [ "h3v4" ] |
| 583 | main.disconnectedIpv6Hosts = [ "h3v6" ] |
| 584 | verify( main ) |
| 585 | # Recover leaf-2 |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 586 | lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 587 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 588 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 589 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 590 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 591 | lib.verifyHostLocations( main, hostLocations ) |
| 592 | main.disconnectedIpv4Hosts = [] |
| 593 | main.disconnectedIpv6Hosts = [] |
| 594 | verify( main, disconnected=False ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 595 | # We need to disable ports toward dual-homed hosts before killing the leaf switch |
| 596 | portsToDisable = [ [ "of:0000000000000004", 7 ], [ "of:0000000000000004", 8 ], |
| 597 | [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ] ] |
| 598 | lib.disablePortBatch( main, portsToDisable, 10, 48, 5 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 599 | # Kill leaf-4 |
| 600 | lib.killSwitch( main, "leaf4", 9, 38 ) |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 601 | hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ], |
| 602 | "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ], |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 603 | "h9v4": "of:0000000000000005/9", |
| 604 | "h10v4": "of:0000000000000005/10" } |
| 605 | lib.verifyHostLocations( main, hostLocations ) |
| 606 | main.disconnectedIpv4Hosts = [ "h8v4" ] |
| 607 | main.disconnectedIpv6Hosts = [ "h8v6" ] |
| 608 | verify( main ) |
| 609 | # Recover leaf-4 |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 610 | lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 611 | hostLocations = { "h9v6": [ "of:0000000000000004/7", "of:0000000000000005/6" ], |
| 612 | "h10v6": [ "of:0000000000000004/8", "of:0000000000000005/7" ], |
| 613 | "h9v4": [ "of:0000000000000004/10", "of:0000000000000005/9" ], |
| 614 | "h10v4": [ "of:0000000000000004/11", "of:0000000000000005/10" ] } |
| 615 | lib.verifyHostLocations( main, hostLocations ) |
| 616 | main.disconnectedIpv4Hosts = [] |
| 617 | main.disconnectedIpv6Hosts = [] |
| 618 | verify( main, disconnected=False ) |
| 619 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 620 | |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 621 | def CASE603( self, main ): |
| 622 | """" |
| 623 | Drop HAGG-1 device and test connectivity. |
| 624 | Drop DAAS-1 device and test connectivity (some hosts lost it) |
| 625 | Bring up DAAS-1 and test connectivity (all hosts gained it again) |
| 626 | |
| 627 | Repeat the same with HAGG-2 and DAAS-2. |
| 628 | """ |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 629 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 630 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 631 | main.case( "Drop hagg spine switch along with dass leaf switch." ) |
| 632 | setupTest( main, test_idx=603, onosNodes=3 ) |
| 633 | main.disconnectedIpv4Hosts = [] |
| 634 | main.disconnectedIpv6Hosts = [] |
| 635 | |
| 636 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 637 | lib.killSwitch( main, "spine103", |
| 638 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 639 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 640 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 641 | lib.killSwitch( main, "leaf6", |
| 642 | int( main.params[ "TOPO" ]["switchNum" ] ) - 2, |
| 643 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 644 | main.disconnectedIpv4Hosts = [ 'h12v4', 'h13v4'] |
| 645 | main.disconnectedIpv6Hosts = [ 'h12v6', 'h13v6'] |
| 646 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 647 | lib.recoverSwitch( main, "leaf6", |
| 648 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 649 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, |
| 650 | rediscoverHosts=True) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 651 | main.disconnectedIpv4Hosts = [] |
| 652 | main.disconnectedIpv6Hosts = [] |
| 653 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 654 | lib.recoverSwitch( main, "spine103", |
| 655 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 656 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 657 | verify( main ) |
| 658 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 659 | lib.killSwitch( main, "spine104", |
| 660 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 661 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 662 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 663 | lib.killSwitch( main, "leaf1", |
| 664 | int( main.params[ "TOPO" ]["switchNum" ] ) - 2, |
| 665 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 8 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 666 | main.disconnectedIpv4Hosts = [ 'h1v4', 'h2v4'] |
| 667 | main.disconnectedIpv6Hosts = [ 'h1v6', 'h2v6'] |
| 668 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 669 | lib.recoverSwitch( main, "leaf1", |
| 670 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 671 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6, |
| 672 | rediscoverHosts=True ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 673 | main.disconnectedIpv4Hosts = [] |
| 674 | main.disconnectedIpv6Hosts = [] |
| 675 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 676 | lib.recoverSwitch( main, "spine104", |
| 677 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 678 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 679 | verify( main ) |
| 680 | |
| 681 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 682 | |
| 683 | def CASE604( self, main ): |
| 684 | """" |
| 685 | Drop HAGG-1 device and test connectivity. |
| 686 | Bring up HAGG-1 and test connectivity. |
| 687 | Drop HAGG-2 device and test connectivity. |
| 688 | Bring up HAGG-2 device and test connectivity |
| 689 | """ |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 690 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 691 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 692 | main.case( "Drop hagg spine switches." ) |
| 693 | setupTest( main, test_idx=604, onosNodes=3 ) |
| 694 | main.disconnectedIpv4Hosts = [] |
| 695 | main.disconnectedIpv6Hosts = [] |
| 696 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 697 | lib.killSwitch( main, "spine103", |
| 698 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 699 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 700 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 701 | lib.recoverSwitch( main, "spine103", |
| 702 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 703 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 704 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 705 | lib.killSwitch( main, "spine104", |
| 706 | int( main.params[ "TOPO" ]["switchNum" ] ) - 1, |
| 707 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 708 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 709 | lib.recoverSwitch( main, "spine104", |
| 710 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 711 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Andreas Pantelopoulos | 74c7ff2 | 2018-05-01 15:42:02 -0700 | [diff] [blame] | 712 | verify( main ) |
| 713 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 714 | |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 715 | def CASE605( self, main ): |
| 716 | """ |
| 717 | Drop HAGG-1 and test connectivity (expect no failure) |
| 718 | Drop all leafs in big fabric and test connectivity (expect some failures) |
| 719 | Bring up HAGG-1 and test connectivity (still expect some failures) |
| 720 | Bring up all leafs in big fabric and test connectivity (expect no failure) |
| 721 | Repeat above with HAGG-2 |
| 722 | """ |
| 723 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 724 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 725 | main.case( "Drop one hagg and all leafs in big fabric" ) |
| 726 | setupTest( main, test_idx=605, onosNodes=3 ) |
| 727 | main.disconnectedIpv4Hosts = [] |
| 728 | main.disconnectedIpv6Hosts = [] |
| 729 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 730 | lib.killSwitch( main, "spine103", |
| 731 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, |
| 732 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 733 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 734 | lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 735 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 5, |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 736 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 ) |
| 737 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 738 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 739 | main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ] |
| 740 | main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ] |
| 741 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 742 | lib.recoverSwitch( main, "spine103", |
| 743 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, |
| 744 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 745 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 746 | lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 747 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 748 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
| 749 | main.disconnectedIpv4Hosts = [] |
| 750 | main.disconnectedIpv6Hosts = [] |
| 751 | main.disconnectedExternalIpv4Hosts = [ ] |
| 752 | main.disconnectedExternalIpv6Hosts = [ ] |
| 753 | verify( main ) |
| 754 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 755 | lib.killSwitch( main, "spine104", |
| 756 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 1, |
| 757 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 6 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 758 | verify( main ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 759 | lib.killSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 760 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 5, |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 761 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 42 ) |
| 762 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 763 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 764 | main.disconnectedExternalIpv4Hosts = [ "rh1v4", "rh2v4", "rh5v4" ] |
| 765 | main.disconnectedExternalIpv6Hosts = [ "rh1v6", "rh11v6", "rh5v6", "rh2v6", "rh22v6" ] |
| 766 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 767 | lib.recoverSwitch( main, "spine104", |
| 768 | int( main.params[ "TOPO" ][ "switchNum" ] ) - 4, |
| 769 | int( main.params[ "TOPO" ][ "linkNum" ] ) - 36 ) |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 770 | verify( main, disconnected=True ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 771 | lib.recoverSwitch( main, [ "leaf2", "leaf3", "leaf4", "leaf5" ], |
| 772 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
Jonghwan Hyun | 3759e47 | 2018-05-01 15:40:08 -0700 | [diff] [blame] | 773 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
| 774 | main.disconnectedIpv4Hosts = [] |
| 775 | main.disconnectedIpv6Hosts = [] |
| 776 | main.disconnectedExternalIpv4Hosts = [ ] |
| 777 | main.disconnectedExternalIpv6Hosts = [ ] |
| 778 | verify( main ) |
| 779 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 780 | |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 781 | def CASE606( self, main ): |
| 782 | """ |
| 783 | Drop SPINE-1 and test connectivity |
| 784 | Drop paired leaf and test connectivity (expect some failures) |
| 785 | Bring up SPINE-1 and test connectivity (still expect some failures) |
| 786 | Bring up the paired leaf and test connectivity |
| 787 | Repeat above with SPINE-2 and a different paired leaf |
| 788 | """ |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 789 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 790 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 791 | main.case( "Drop spine and paired leaf" ) |
| 792 | setupTest( main, test_idx=606, onosNodes=3 ) |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 793 | verify( main, disconnected=False ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 794 | # Drop spine101 and leaf-2/3 |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 795 | lib.killSwitch( main, "spine101", 9, 30 ) |
| 796 | verify( main, disconnected=False ) |
| 797 | lib.killSwitch( main, "leaf2", 8, 24 ) |
| 798 | lib.killSwitch( main, "leaf3", 7, 20 ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 799 | main.disconnectedIpv4Hosts = [ "h3v4", "h4v4", "h5v4", "h6v4", "h7v4" ] |
| 800 | main.disconnectedIpv6Hosts = [ "h3v6", "h4v6", "h5v6", "h6v6", "h7v6" ] |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 801 | verify( main ) |
| 802 | lib.recoverSwitch( main, "spine101", 8, 30 ) |
| 803 | verify( main ) |
| 804 | lib.recoverSwitch( main, "leaf3", 9, 38 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 805 | lib.recoverSwitch( main, "leaf2", 10, 48, rediscoverHosts=True, |
| 806 | hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 807 | main.disconnectedIpv4Hosts = [] |
| 808 | main.disconnectedIpv6Hosts = [] |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 809 | verify( main, disconnected=False ) |
| 810 | # Drop spine102 and leaf-4/5 |
| 811 | lib.killSwitch( main, "spine102", 9, 30 ) |
| 812 | verify( main, disconnected=False ) |
| 813 | lib.killSwitch( main, "leaf4", 8, 24 ) |
| 814 | lib.killSwitch( main, "leaf5", 7, 20 ) |
| 815 | main.disconnectedIpv4Hosts = [ "h8v4", "h9v4", "h10v4", "h11v4" ] |
| 816 | main.disconnectedIpv6Hosts = [ "h8v6", "h9v6", "h10v6", "h11v6" ] |
| 817 | verify( main, external=False ) |
| 818 | lib.recoverSwitch( main, "spine102", 8, 30 ) |
| 819 | verify( main, external=False ) |
| 820 | lib.recoverSwitch( main, "leaf5", 9, 38 ) |
| 821 | lib.recoverSwitch( main, "leaf4", 10, 48, rediscoverHosts=True, |
| 822 | hostsToDiscover=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
| 823 | main.disconnectedIpv4Hosts = [] |
| 824 | main.disconnectedIpv6Hosts = [] |
| 825 | verify( main, disconnected=False ) |
| 826 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 827 | |
| 828 | def CASE620( self, main ): |
| 829 | """ |
| 830 | Take down one of double links towards the spine from all leaf switches and |
| 831 | check that buckets in select groups change accordingly |
| 832 | Bring up links again and check that buckets in select groups change accordingly |
| 833 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 834 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 835 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 836 | main.case( "Take down one of double links towards the spine" ) |
| 837 | setupTest( main, test_idx=620, onosNodes=3 ) |
| 838 | verify( main, disconnected=False ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 839 | groupBuckets = { "of:0000000000000002": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 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": 4, "10.2.40.0/24": 4, |
| 842 | "10.3.0.0/24": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8, |
| 843 | "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 844 | "of:0000000000000003": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 845 | "10.2.0.0/24": 4, "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": 4, "10.3.10.0/24": 8, "10.3.30.0/24": 8, |
| 848 | "10.3.20.0/24": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 849 | "of:0000000000000004": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 850 | "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8, |
| 851 | "10.2.10.0/24": 4, "10.2.40.0/24": 4, |
| 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": 4, "10.5.10.0/24": 4, "10.5.20.0/24": 4 }, |
| 854 | "of:0000000000000005": { "10.1.0.0/24": 4, "10.1.10.0/24": 4, |
| 855 | "10.2.0.0/24": 4, "10.2.30.0/24": 8, "10.2.20.0/24": 8, |
| 856 | "10.2.10.0/24": 4, "10.2.40.0/24": 4, |
| 857 | "10.3.0.0/24": 4, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 858 | "10.3.20.0/24": 1, "10.5.10.0/24": 4, "10.5.20.0/24": 4 } } |
| 859 | for switch, subnets in groupBuckets.items(): |
| 860 | lib.checkGroupsForBuckets( main, switch, subnets ) |
| 861 | # Take down one of double links |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 862 | portsToDisable = [ [ "of:0000000000000002", 1 ], [ "of:0000000000000002", 3 ], |
| 863 | [ "of:0000000000000003", 1 ], [ "of:0000000000000003", 3 ], |
| 864 | [ "of:0000000000000004", 1 ], [ "of:0000000000000004", 3 ], |
| 865 | [ "of:0000000000000005", 1 ], [ "of:0000000000000005", 3 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 866 | lib.disablePortBatch( main, portsToDisable, 10, 32 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 867 | groupBucketsNew = { "of:0000000000000002": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 868 | "10.2.0.0/24": 1, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 869 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 870 | "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4, |
| 871 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 872 | "of:0000000000000003": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 873 | "10.2.0.0/24": 2, "10.2.30.0/24": 1, "10.2.20.0/24": 1, |
| 874 | "10.2.10.0/24": 1, "10.2.40.0/24": 1, |
| 875 | "10.3.0.0/24": 2, "10.3.10.0/24": 4, "10.3.30.0/24": 4, |
| 876 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 877 | "of:0000000000000004": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 878 | "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4, |
| 879 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 880 | "10.3.0.0/24": 1, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 881 | "10.3.20.0/24": 2, "10.5.10.0/24": 2, "10.5.20.0/24": 2 }, |
| 882 | "of:0000000000000005": { "10.1.0.0/24": 2, "10.1.10.0/24": 2, |
| 883 | "10.2.0.0/24": 2, "10.2.30.0/24": 4, "10.2.20.0/24": 4, |
| 884 | "10.2.10.0/24": 2, "10.2.40.0/24": 2, |
| 885 | "10.3.0.0/24": 2, "10.3.10.0/24": 1, "10.3.30.0/24": 1, |
| 886 | "10.3.20.0/24": 1, "10.5.10.0/24": 2, "10.5.20.0/24": 2 } } |
| 887 | for switch, subnets in groupBucketsNew.items(): |
| 888 | lib.checkGroupsForBuckets( main, switch, subnets ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 889 | verify( main, disconnected=False ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 890 | # Bring up the links |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 891 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 892 | for switch, subnets in groupBuckets.items(): |
| 893 | lib.checkGroupsForBuckets( main, switch, subnets ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 894 | verify( main, disconnected=False ) |
| 895 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 896 | |
| 897 | def CASE621( self, main ): |
| 898 | """ |
| 899 | Remove all the links in the network and restore all Links (repeat x3) |
| 900 | """ |
| 901 | import time |
| 902 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 903 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 904 | main.case( "Remove all the links in the network and restore all Links" ) |
| 905 | setupTest( main, test_idx=621, onosNodes=3 ) |
| 906 | verify( main, disconnected=False ) |
| 907 | linksToRemove = [ ["spine101", "spine103"], ["spine102", "spine104"], |
| 908 | ["spine103", "leaf6"], ["spine103", "leaf1"], |
| 909 | ["spine104", "leaf6"], ["spine104", "leaf1"], |
| 910 | ["spine101", "leaf2"], ["spine101", "leaf3"], ["spine101", "leaf4"], ["spine101", "leaf5"], |
| 911 | ["spine102", "leaf2"], ["spine102", "leaf3"], ["spine102", "leaf4"], ["spine102", "leaf5"], |
| 912 | ["leaf2", "leaf3"], ["leaf4", "leaf5"] ] |
| 913 | portsToDisable = [ [ "of:0000000000000001", 3 ], [ "of:0000000000000001", 4 ], |
| 914 | [ "of:0000000000000001", 5 ], [ "of:0000000000000001", 6 ], |
| 915 | [ "of:0000000000000002", 6 ], [ "of:0000000000000002", 7 ], |
| 916 | [ "of:0000000000000002", 8 ], [ "of:0000000000000002", 9 ], |
| 917 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ], |
| 918 | [ "of:0000000000000003", 6 ], [ "of:0000000000000003", 7 ], |
| 919 | [ "of:0000000000000003", 8 ], [ "of:0000000000000003", 9 ], |
| 920 | [ "of:0000000000000003", 10 ], [ "of:0000000000000003", 11 ], |
| 921 | [ "of:0000000000000003", 12 ], [ "of:0000000000000003", 13 ], |
| 922 | [ "of:0000000000000004", 6 ], [ "of:0000000000000004", 7 ], |
| 923 | [ "of:0000000000000004", 8 ], [ "of:0000000000000004", 9 ], |
| 924 | [ "of:0000000000000004", 10 ], [ "of:0000000000000004", 11 ], |
| 925 | [ "of:0000000000000004", 12 ], [ "of:0000000000000004", 13 ], [ "of:0000000000000004", 14 ], |
| 926 | [ "of:0000000000000005", 6 ], [ "of:0000000000000005", 7 ], |
| 927 | [ "of:0000000000000005", 8 ], [ "of:0000000000000005", 9 ], |
| 928 | [ "of:0000000000000005", 10 ], [ "of:0000000000000005", 11 ], |
| 929 | [ "of:0000000000000005", 12 ], [ "of:0000000000000005", 13 ], |
| 930 | [ "of:0000000000000005", 14 ], [ "of:0000000000000005", 15 ], |
| 931 | [ "of:0000000000000006", 3 ], [ "of:0000000000000006", 4 ], |
| 932 | [ "of:0000000000000006", 5 ], [ "of:0000000000000006", 6 ] ] |
| 933 | for i in range( 0, 3 ): |
| 934 | lib.killLinkBatch( main, linksToRemove, 0, 10 ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 935 | lib.disablePortBatch( main, portsToDisable, 10, 0 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 936 | main.disconnectedIpv4Hosts = main.internalIpv4Hosts |
| 937 | main.disconnectedIpv6Hosts = main.internalIpv6Hosts |
| 938 | verify( main ) |
| 939 | lib.restoreLinkBatch( main, linksToRemove, 48, 10 ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 940 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 941 | main.Network.discoverHosts( hostList=main.disconnectedIpv4Hosts + main.disconnectedIpv6Hosts ) |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 942 | main.log.debug( "sleeping %i seconds" % float( 10 ) ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 943 | time.sleep( 10 ) |
| 944 | main.disconnectedIpv4Hosts = [] |
| 945 | main.disconnectedIpv6Hosts = [] |
| 946 | verify( main ) |
| 947 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 948 | |
| 949 | def CASE622( self, main ): |
| 950 | """ |
| 951 | Take down all uplinks from a paired leaf switch |
| 952 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 953 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 954 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 955 | from core import utilities |
| 956 | main.case( "Take down all uplinks from a paired leaf switch" ) |
| 957 | setupTest( main, test_idx=622, onosNodes=3 ) |
| 958 | verify( main, disconnected=False ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 959 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 960 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 961 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 962 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 963 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 964 | linksToRemove = [ ["spine101", "leaf2"], ["spine102", "leaf2"] ] |
| 965 | lib.killLinkBatch( main, linksToRemove, 40, 10 ) |
| 966 | # TODO: more verifications are required |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 967 | main.disconnectedIpv4Hosts = [ "h3v4" ] |
| 968 | main.disconnectedIpv6Hosts = [ "h3v6" ] |
You Wang | d66de19 | 2018-04-30 17:30:12 -0700 | [diff] [blame] | 969 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 970 | hostLocations = { "h4v6": "of:0000000000000003/6", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 971 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 972 | "h4v4": "of:0000000000000003/10", |
| 973 | "h5v4": "of:0000000000000003/11" } |
| 974 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 975 | lib.restoreLinkBatch( main, linksToRemove, 48, 10 ) |
You Wang | c02f3be | 2018-05-18 12:14:23 -0700 | [diff] [blame] | 976 | main.disconnectedIpv4Hosts = [] |
| 977 | main.disconnectedIpv6Hosts = [] |
| 978 | verify( main, disconnected=False ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 979 | hostLocations = { "h4v6": [ "of:0000000000000002/7", "of:0000000000000003/6" ], |
| 980 | "h5v6": [ "of:0000000000000002/8", "of:0000000000000003/7" ], |
| 981 | "h4v4": [ "of:0000000000000002/10", "of:0000000000000003/10" ], |
| 982 | "h5v4": [ "of:0000000000000002/11", "of:0000000000000003/11" ] } |
| 983 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 984 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 985 | |
| 986 | def CASE630( self, main ): |
| 987 | """ |
| 988 | Bring an instance down |
| 989 | Drop a device |
| 990 | Bring that same instance up again and observe that this specific instance sees that the device is down. |
| 991 | """ |
You Wang | 6d2d631 | 2018-05-08 12:02:02 -0700 | [diff] [blame] | 992 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 993 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 994 | from core import utilities |
| 995 | main.case( "Bring an instance down and drop a device" ) |
| 996 | setupTest( main, test_idx=630, onosNodes=3 ) |
| 997 | onosToKill = 0 |
| 998 | deviceToDrop = "spine101" |
| 999 | lib.killOnos( main, [ onosToKill ], 10, 48, 2 ) |
| 1000 | lib.killSwitch( main, deviceToDrop, 9, 30 ) |
| 1001 | lib.recoverOnos( main, [ onosToKill ], 9, 30, 3 ) |
| 1002 | result = main.Cluster.runningNodes[ onosToKill ].CLI.checkStatus( 9, 30, 3 ) |
| 1003 | utilities.assert_equals( expect=main.TRUE, actual=result, |
| 1004 | onpass="ONOS instance {} sees correct device numbers".format( onosToKill ), |
| 1005 | onfail="ONOS instance {} doesn't see correct device numbers".format( onosToKill ) ) |
You Wang | 5da39c8 | 2018-04-26 22:55:08 -0700 | [diff] [blame] | 1006 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1007 | |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1008 | def CASE640( self, main ): |
| 1009 | """ |
| 1010 | Controller instance going down and switch coming down at the same time and then we bring them up together |
| 1011 | |
| 1012 | A. Instance goes down and SPINE-1 goes down |
| 1013 | - All connectivity should be there |
| 1014 | - Bring them up together |
| 1015 | - All connectivity should be there |
| 1016 | B. Instance goes down and HAGG-1 goes down |
| 1017 | - All connectivity should be there |
| 1018 | - Bring them up together |
| 1019 | - All connectivity should be there |
| 1020 | C. Instance goes down and a paired leaf switch goes down |
| 1021 | - Single homed hosts in this leaf should lose connectivity all others should be ok |
| 1022 | - Bring them up together |
| 1023 | - Test connectivity |
| 1024 | """ |
| 1025 | import time |
| 1026 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1027 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1028 | main.case( "Drop an ONOS instance and switch(es) at the same time" ) |
| 1029 | caseDict = { 'A': { 'switches': "spine101", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1030 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1031 | 'disconnectedV4': [], |
| 1032 | 'disconnectedV6': [], |
| 1033 | 'expectedSwitches': 9, |
| 1034 | 'expectedLinks': 30 }, |
| 1035 | 'B': { 'switches': "spine103", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1036 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1037 | 'disconnectedV4': [], |
| 1038 | 'disconnectedV6': [], |
| 1039 | 'expectedSwitches': 9, |
| 1040 | 'expectedLinks': 42 }, |
| 1041 | 'C': { 'switches': "leaf2", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1042 | 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 1043 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1044 | 'disconnectedV4': [ "h3v4" ], |
| 1045 | 'disconnectedV6': [ "h3v6" ], |
| 1046 | 'expectedSwitches': 9, |
| 1047 | 'expectedLinks': 38 } } |
| 1048 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 1049 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 1050 | nodeIndex = 0 |
| 1051 | cases = sorted( caseDict.keys() ) |
| 1052 | for case in cases: |
| 1053 | switches = caseDict[ case ][ 'switches' ] |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1054 | ports = caseDict[ case ][ 'ports' ] |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1055 | expectedSwitches = caseDict[ case ][ 'expectedSwitches' ] |
| 1056 | expectedLinks = caseDict[ case ][ 'expectedLinks' ] |
| 1057 | main.step( "\n640{}: Drop ONOS{} and switch(es) {} at the same time".format( case, |
| 1058 | nodeIndex + 1, |
| 1059 | switches ) ) |
| 1060 | setupTest( main, test_idx=640 ) |
| 1061 | main.Cluster.next().CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1062 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1063 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1064 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1065 | instance = main.Cluster.controllers[ nodeIndex ] |
| 1066 | verify( main, disconnected=False, external=False ) |
| 1067 | |
| 1068 | # Simultaneous failures |
| 1069 | main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) ) |
| 1070 | killResult = main.ONOSbench.onosDie( instance.ipAddress ) |
| 1071 | utilities.assert_equals( expect=main.TRUE, actual=killResult, |
| 1072 | onpass="ONOS node killed", |
| 1073 | onfail="Failed to kill ONOS node" ) |
| 1074 | instance.active = False |
| 1075 | main.Cluster.reset() |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1076 | if ports: |
| 1077 | lib.disablePortBatch( main, ports, 10, 48, 0 ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1078 | # TODO: Remove sleeps from the concurrent events |
| 1079 | lib.killSwitch( main, switches, expectedSwitches, expectedLinks ) |
| 1080 | main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ] |
| 1081 | main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ] |
| 1082 | |
| 1083 | # verify functionality |
| 1084 | main.log.debug( main.Cluster.next().summary() ) |
| 1085 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1086 | main.log.debug( main.Cluster.next().summary() ) |
| 1087 | lib.verifyTopology( main, expectedSwitches, expectedLinks, main.Cluster.numCtrls - 1 ) |
| 1088 | lib.verifyNodes( main ) |
| 1089 | verify( main, external=False ) |
| 1090 | |
| 1091 | # Bring everything back up |
| 1092 | lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True ) |
| 1093 | main.disconnectedIpv4Hosts = [] |
| 1094 | main.disconnectedIpv6Hosts = [] |
| 1095 | lib.recoverOnos( main, [ nodeIndex ], expectedSwitches, expectedLinks, main.Cluster.numCtrls ) |
| 1096 | |
| 1097 | # Verify functionality |
| 1098 | lib.verifyNodes( main ) |
| 1099 | verify( main, disconnected=False, external=False ) |
| 1100 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1101 | nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls |
| 1102 | |
| 1103 | def CASE641( self, main ): |
| 1104 | """ |
| 1105 | Controller instance going down while switch comes up at the same time |
| 1106 | |
| 1107 | A. Take down SPINE-1 |
| 1108 | - Test connectivity |
| 1109 | - Bring up SPINE-1 and drop an instance at the same time |
| 1110 | - Test connectivity |
| 1111 | - Bring up instance one |
| 1112 | - Test connectivity |
| 1113 | B. Take down HAGG-1 |
| 1114 | - Test connectivity |
| 1115 | - Bring up HAGG-1 and drop an instance at the same time |
| 1116 | - Test connectivity |
| 1117 | - Bring up instance one |
| 1118 | - Test connectivity |
| 1119 | C. Take down a paired leaf switch |
| 1120 | - Test connectivity ( single homed hosts on this leaf will lose it ) |
| 1121 | - Bring up paired leaf switch and drop a controller instance at the same time |
| 1122 | - Test connectivity |
| 1123 | - Bring up the instance |
| 1124 | - Test connectivity |
| 1125 | """ |
| 1126 | import time |
| 1127 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1128 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1129 | main.case( "Drop an ONOS instance and recover switch(es) at the same time" ) |
| 1130 | caseDict = { 'A': { 'switches': "spine101", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1131 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1132 | 'disconnectedV4': [], |
| 1133 | 'disconnectedV6': [], |
| 1134 | 'expectedSwitches': 9, |
| 1135 | 'expectedLinks': 30 }, |
| 1136 | 'B': { 'switches': "spine103", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1137 | 'ports': [], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1138 | 'disconnectedV4': [], |
| 1139 | 'disconnectedV6': [], |
| 1140 | 'expectedSwitches': 9, |
| 1141 | 'expectedLinks': 42 }, |
| 1142 | 'C': { 'switches': "leaf2", |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1143 | 'ports': [ [ "of:0000000000000002", 7 ], [ "of:0000000000000002", 8 ], |
| 1144 | [ "of:0000000000000002", 10 ], [ "of:0000000000000002", 11 ] ], |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1145 | 'disconnectedV4': [ "h3v4" ], |
| 1146 | 'disconnectedV6': [ "h3v6" ], |
| 1147 | 'expectedSwitches': 9, |
| 1148 | 'expectedLinks': 38 } } |
| 1149 | totalSwitches = int( main.params[ 'TOPO' ][ 'switchNum' ] ) |
| 1150 | totalLinks = int( main.params[ 'TOPO' ][ 'linkNum' ] ) |
| 1151 | nodeIndex = 0 |
| 1152 | cases = sorted( caseDict.keys() ) |
| 1153 | for case in cases: |
| 1154 | switches = caseDict[ case ][ 'switches' ] |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1155 | ports = caseDict[ case ][ 'ports' ] |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1156 | expectedSwitches = caseDict[ case ][ 'expectedSwitches' ] |
| 1157 | expectedLinks = caseDict[ case ][ 'expectedLinks' ] |
| 1158 | main.step( "\n641{}: Drop ONOS{} and recover switch(es) {} at the same time".format( case, |
| 1159 | nodeIndex + 1, |
| 1160 | switches ) ) |
| 1161 | setupTest( main, test_idx=641 ) |
| 1162 | main.Cluster.next().CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1163 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1164 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1165 | main.Network.discoverHosts( hostList=main.internalIpv4Hosts + main.internalIpv6Hosts ) |
| 1166 | instance = main.Cluster.controllers[ nodeIndex ] |
| 1167 | verify( main, disconnected=False, external=False ) |
| 1168 | # Drop the switch to setup scenario |
You Wang | be98fb1 | 2018-05-24 16:15:17 -0700 | [diff] [blame] | 1169 | if ports: |
| 1170 | lib.disablePortBatch( main, ports, 10, 48, 5 ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1171 | lib.killSwitch( main, switches, expectedSwitches, expectedLinks ) |
| 1172 | main.disconnectedIpv4Hosts = caseDict[ case ][ 'disconnectedV4' ] |
| 1173 | main.disconnectedIpv6Hosts = caseDict[ case ][ 'disconnectedV6' ] |
| 1174 | verify( main, external=False ) |
| 1175 | |
| 1176 | # Simultaneous node failure and switch recovery |
| 1177 | main.step( "Kill ONOS{}: {}".format( nodeIndex + 1, instance.ipAddress ) ) |
| 1178 | killResult = main.ONOSbench.onosDie( instance.ipAddress ) |
| 1179 | utilities.assert_equals( expect=main.TRUE, actual=killResult, |
| 1180 | onpass="ONOS node killed", |
| 1181 | onfail="Failed to kill ONOS node" ) |
| 1182 | instance.active = False |
| 1183 | main.Cluster.reset() |
| 1184 | # TODO: Remove sleeps from the concurrent events |
| 1185 | lib.recoverSwitch( main, switches, totalSwitches, totalLinks, rediscoverHosts=True ) |
| 1186 | main.disconnectedIpv4Hosts = [] |
| 1187 | main.disconnectedIpv6Hosts = [] |
| 1188 | |
| 1189 | # verify functionality |
| 1190 | main.log.debug( main.Cluster.next().summary() ) |
Jon Hall | a604fd4 | 2018-05-04 14:27:27 -0700 | [diff] [blame] | 1191 | lib.verifyTopology( main, totalSwitches, totalLinks, main.Cluster.numCtrls - 1 ) |
| 1192 | lib.verifyNodes( main ) |
| 1193 | verify( main, disconnected=False, external=False ) |
| 1194 | |
| 1195 | # Bring everything back up and verify functionality |
| 1196 | lib.recoverOnos( main, [ nodeIndex ], totalSwitches, totalLinks, main.Cluster.numCtrls ) |
| 1197 | lib.verifyNodes( main ) |
| 1198 | verify( main, external=False ) |
| 1199 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1200 | nodeIndex = ( nodeIndex + 1 ) % main.Cluster.numCtrls |
| 1201 | |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1202 | def CASE642( self, main ): |
| 1203 | """ |
| 1204 | Drop one link from each double link |
| 1205 | Drop a link between DAAS-1 and HAAG-1 |
| 1206 | Drop a link between HAGG-2 and SPINE-2 |
| 1207 | Drop one ONOS instance |
| 1208 | Test connectivity (expect no failure) |
| 1209 | Bring up all links and ONOS instance |
| 1210 | Test connectivity (expect no failure) |
| 1211 | """ |
| 1212 | import time |
| 1213 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1214 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1215 | main.case( "Drop ONOS instance and links at the same time" ) |
| 1216 | setupTest( main, test_idx=642, onosNodes=3 ) |
| 1217 | main.Cluster.active( 0 ).CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1218 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1219 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1220 | verify( main ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1221 | portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ], |
| 1222 | [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ], |
| 1223 | [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ], |
| 1224 | [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ], |
| 1225 | [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ], |
| 1226 | [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ], |
| 1227 | [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ], |
| 1228 | [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ], |
| 1229 | [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ], |
| 1230 | [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ], |
| 1231 | [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1232 | lib.disablePortBatch( main, portsToDisable, |
| 1233 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1234 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), |
| 1235 | sleep=0 ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1236 | lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1237 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ), 2 ) |
| 1238 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1239 | lib.enablePortBatch( main, portsToDisable, |
| 1240 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1241 | int( main.params[ "TOPO" ][ "linkNum" ] ), |
| 1242 | sleep=0 ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1243 | lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1244 | int( main.params[ "TOPO" ][ "linkNum" ] ), 3 ) |
| 1245 | verify( main ) |
| 1246 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1247 | |
| 1248 | def CASE643( self, main ): |
| 1249 | """ |
| 1250 | Drop one link from each double link |
| 1251 | Drop a link between DAAS-1 and HAAG-1 |
| 1252 | Drop a link between HAGG-2 and SPINE-2 |
| 1253 | Test connectivity (expect no failure) |
| 1254 | Bring up all links |
| 1255 | Drop one ONOS instance |
| 1256 | Test connectivity (expect no failure) |
| 1257 | Bring up ONOS instance |
| 1258 | Test connectivity (expect no failure) |
| 1259 | """ |
| 1260 | import time |
| 1261 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1262 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1263 | main.case( "Drop ONOS instances and bring up links at the same time" ) |
| 1264 | setupTest( main, test_idx=643, onosNodes=3 ) |
| 1265 | main.Cluster.active( 0 ).CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1266 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1267 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1268 | verify( main ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1269 | portsToDisable = [ [ "of:0000000000000001", 1 ], [ "of:0000000000000103", 1 ], |
| 1270 | [ "of:0000000000000006", 1 ], [ "of:0000000000000103", 2 ], |
| 1271 | [ "of:0000000000000101", 9 ], [ "of:0000000000000103", 3 ], |
| 1272 | [ "of:0000000000000002", 1 ], [ "of:0000000000000101", 1 ], |
| 1273 | [ "of:0000000000000003", 1 ], [ "of:0000000000000101", 3 ], |
| 1274 | [ "of:0000000000000004", 1 ], [ "of:0000000000000101", 5 ], |
| 1275 | [ "of:0000000000000005", 1 ], [ "of:0000000000000101", 7 ], |
| 1276 | [ "of:0000000000000002", 3 ], [ "of:0000000000000102", 1 ], |
| 1277 | [ "of:0000000000000003", 3 ], [ "of:0000000000000102", 3 ], |
| 1278 | [ "of:0000000000000004", 3 ], [ "of:0000000000000102", 5 ], |
| 1279 | [ "of:0000000000000005", 3 ], [ "of:0000000000000102", 7 ] ] |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1280 | lib.disablePortBatch( main, portsToDisable, |
| 1281 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1282 | int( main.params[ "TOPO" ][ "linkNum" ] ) - len( portsToDisable ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1283 | verify( main ) |
You Wang | 8574776 | 2018-05-11 15:51:50 -0700 | [diff] [blame] | 1284 | lib.enablePortBatch( main, portsToDisable, |
| 1285 | int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1286 | int( main.params[ "TOPO" ][ "linkNum" ] ) ) |
Jonghwan Hyun | 25c98a6 | 2018-05-04 13:59:09 -0700 | [diff] [blame] | 1287 | lib.killOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1288 | int( main.params[ "TOPO" ][ "linkNum" ] ), 2 ) |
| 1289 | verify( main ) |
| 1290 | lib.recoverOnos( main, [ 2, ], int( main.params[ "TOPO" ][ "switchNum" ] ), |
| 1291 | int( main.params[ "TOPO" ][ "linkNum" ] ), 3 ) |
| 1292 | verify( main ) |
| 1293 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1294 | |
| 1295 | def CASE651( self, main ): |
| 1296 | """ |
| 1297 | Move a single-homed host from port A to port B in DAAS-1 |
| 1298 | Test connectivity (expect no failure) |
| 1299 | |
| 1300 | Repeat with DAAS-2 |
| 1301 | """ |
| 1302 | import time |
| 1303 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1304 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1305 | main.case( "Move a single-homed host to another port in the same DAAS" ) |
| 1306 | setupTest( main, test_idx=651, onosNodes=3 ) |
| 1307 | main.Cluster.active( 0 ).CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1308 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1309 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1310 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1311 | # Move an untagged IPv4 host on DAAS-1 |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1312 | h1v4cfg = '{"of:0000000000000001/7" : { "interfaces" : [ { "ips" : [ "10.1.0.254/24" ], "vlan-untagged": 10 } ] } }' |
| 1313 | lib.moveHost( main, "h1v4", "leaf1", "leaf1", "10.1.0.254", prefixLen=24, cfg=h1v4cfg ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1314 | hostLocations = { "h1v4": "of:0000000000000001/7" } |
| 1315 | lib.verifyHostLocations( main, hostLocations ) |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1316 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1317 | # Move an untagged IPv6 host on DAAS-1 |
You Wang | 6260ed5 | 2018-07-18 17:54:25 -0700 | [diff] [blame] | 1318 | h1v6cfg = '{"of:0000000000000001/8" : { "interfaces" : [ { "ips" : [ "1000::3ff/120" ], "vlan-untagged": 21 } ] } }' |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1319 | lib.moveHost( main, "h1v6", "leaf1", "leaf1", "1000::3ff", prefixLen=128, cfg=h1v6cfg, ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1320 | hostLocations = { "h1v6": "of:0000000000000001/8" } |
| 1321 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6260ed5 | 2018-07-18 17:54:25 -0700 | [diff] [blame] | 1322 | verify( main ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1323 | # FIXME: We don't have any tagged hosts on DAAS-1 |
| 1324 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1325 | # Move an untagged IPv4 host on DAAS-2 |
You Wang | 6260ed5 | 2018-07-18 17:54:25 -0700 | [diff] [blame] | 1326 | h13v4cfg = '{"of:0000000000000006/7" : { "interfaces" : [ { "ips" : [ "10.5.20.254/24" ], "vlan-untagged": 20 } ] } }' |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1327 | lib.moveHost( main, "h13v4", "leaf6", "leaf6", "10.5.20.254", prefixLen=24, cfg=h13v4cfg ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1328 | hostLocations = { "h13v4": "of:0000000000000006/7" } |
| 1329 | lib.verifyHostLocations( main, hostLocations ) |
Jonghwan Hyun | 785471d | 2018-05-14 14:48:19 -0700 | [diff] [blame] | 1330 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1331 | # Move an untagged IPv6 host on DAAS-2 |
You Wang | 6260ed5 | 2018-07-18 17:54:25 -0700 | [diff] [blame] | 1332 | h13v6cfg = '{"of:0000000000000006/8" : { "interfaces" : [ { "ips" : [ "1012::3ff/120" ], "vlan-untagged": 26 } ] } }' |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1333 | lib.moveHost( main, "h13v6", "leaf6", "leaf6", "1012::3ff", prefixLen=128, cfg=h13v6cfg, ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1334 | hostLocations = { "h13v6": "of:0000000000000006/8" } |
| 1335 | lib.verifyHostLocations( main, hostLocations ) |
You Wang | 6260ed5 | 2018-07-18 17:54:25 -0700 | [diff] [blame] | 1336 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1337 | # Move a tagged IPv4 host on DAAS-2 |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1338 | h12v4cfg = '{"of:0000000000000006/9" : { "interfaces" : [ { "ips" : [ "10.5.10.254/24" ], "vlan-tagged": [80] } ] } }' |
| 1339 | lib.moveHost( main, "h12v4", "leaf6", "leaf6", "10.5.10.254", prefixLen=24, cfg=h12v4cfg, vlan=80 ) |
| 1340 | hostLocations = { "h12v4": "of:0000000000000006/9" } |
| 1341 | lib.verifyHostLocations( main, hostLocations ) |
| 1342 | verify( main ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1343 | # FIXME: Due to CORD-3079, we are not able to test movement of tagged IPv6 hosts at the moment |
| 1344 | ''' |
| 1345 | h12v6cfg = '{"of:0000000000000006/10" : { "interfaces" : [ { "ips" : [ "1011::3ff/120" ], "vlan-tagged": [127] } ] } }' |
| 1346 | lib.moveHost( main, "h12v6", "leaf6", "leaf6", "1011::3ff", prefixLen=128, cfg=h12v6cfg, ipv6=True, vlan=127 ) |
| 1347 | hostLocations = { "h12v6": "of:0000000000000006/10" } |
| 1348 | lib.verifyHostLocations( main, hostLocations ) |
| 1349 | verify( main ) |
| 1350 | ''' |
| 1351 | |
You Wang | b254981 | 2018-07-23 11:56:46 -0700 | [diff] [blame] | 1352 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1353 | |
| 1354 | def CASE652( self, main ): |
| 1355 | """ |
Jon Hall | 3957026 | 2020-11-17 12:18:19 -0800 | [diff] [blame] | 1356 | Move a dual-homed host from ports 1A and 1B to ports 2A and 2B |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1357 | Host retains the same MAC and IP address |
| 1358 | Test connectivity (expect no failure) |
| 1359 | """ |
| 1360 | import time |
| 1361 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1362 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1363 | main.case( "Move a dual-homed host from porst 1A and 1B to ports 2A and 2B with the same MAC and IP" ) |
| 1364 | setupTest( main, test_idx=652, onosNodes=3 ) |
| 1365 | main.Cluster.active( 0 ).CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1366 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1367 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1368 | verify( main ) |
| 1369 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1370 | # Move an untagged IPv4 host |
| 1371 | lib.addStaticOnosRoute( main, "10.2.31.0/24", "10.2.30.1" ) |
| 1372 | lib.startScapyHosts( main, scapyNames=[ 'h4v4Scapy' ], mininetNames=[ 'h4v4' ] ) |
| 1373 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.31.1", "h4v4Scapy", "h4v4-bond0" ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1374 | h4v4cfg = '''{"of:0000000000000002/12" : { "interfaces" : [ { "ips" : [ "10.2.30.254/24" ], "vlan-untagged": 16 } ] }, |
| 1375 | "of:0000000000000003/14" : { "interfaces" : [ { "ips" : [ "10.2.30.254/24" ], "vlan-untagged": 16 } ] } }''' |
| 1376 | lib.moveDualHomedHost( main, "h4v4", "leaf2", "leaf3", "leaf2", "leaf3", "10.2.30.254", prefixLen=24, cfg=h4v4cfg ) |
| 1377 | hostLocations = { "h4v4": [ "of:0000000000000002/12", "of:0000000000000003/14" ] } |
| 1378 | lib.verifyHostLocations( main, hostLocations ) |
| 1379 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1380 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.31.1", "h4v4Scapy", "h4v4-bond1" ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1381 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1382 | # Move an untagged IPv6 host |
| 1383 | lib.addStaticOnosRoute( main, "1003::400/120", "1003::3fe" ) |
| 1384 | lib.startScapyHosts( main, scapyNames=[ 'h4v6Scapy' ], mininetNames=[ 'h4v6' ] ) |
| 1385 | lib.verifyTraffic( main, main.internalIpv6Hosts, "1003::4fe", "h4v6Scapy", "h4v6-bond0", ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1386 | h4v6cfg = '''{"of:0000000000000002/13" : { "interfaces" : [ { "ips" : [ "1003::3ff/120" ], "vlan-untagged": 24 } ] }, |
| 1387 | "of:0000000000000003/15" : { "interfaces" : [ { "ips" : [ "1003::3ff/120" ], "vlan-untagged": 24 } ] } }''' |
| 1388 | lib.moveDualHomedHost( main, "h4v6", "leaf2", "leaf3", "leaf2", "leaf3", "1003::3fe", prefixLen=128, cfg=h4v6cfg, ipv6=True ) |
| 1389 | hostLocations = { "h4v6": [ "of:0000000000000002/13", "of:0000000000000003/15" ] } |
| 1390 | lib.verifyHostLocations( main, hostLocations ) |
| 1391 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1392 | lib.verifyTraffic( main, main.internalIpv6Hosts, "1003::4fe", "h4v6Scapy", "h4v6-bond1", ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1393 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1394 | # Move a tagged IPv4 host |
| 1395 | lib.addStaticOnosRoute( main, "10.2.21.0/24", "10.2.20.1" ) |
| 1396 | lib.startScapyHosts( main, scapyNames=[ 'h5v4Scapy' ], mininetNames=[ 'h5v4' ] ) |
| 1397 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.21.1", "h5v4Scapy", "h5v4-bond0" ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1398 | h5v4cfg = '''{"of:0000000000000002/14" : { "interfaces" : [ { "ips" : [ "10.2.20.254/24" ], "vlan-tagged": [30] } ] }, |
| 1399 | "of:0000000000000003/16" : { "interfaces" : [ { "ips" : [ "10.2.20.254/24" ], "vlan-tagged": [30] } ] } }''' |
| 1400 | lib.moveDualHomedHost( main, "h5v4", "leaf2", "leaf3", "leaf2", "leaf3", "10.2.20.254", prefixLen=24, cfg=h5v4cfg, vlan=30 ) |
| 1401 | hostLocations = { "h5v4": [ "of:0000000000000002/14", "of:0000000000000003/16" ] } |
| 1402 | lib.verifyHostLocations( main, hostLocations ) |
| 1403 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1404 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.21.1", "h5v4Scapy", "h5v4-bond1" ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1405 | |
You Wang | b254981 | 2018-07-23 11:56:46 -0700 | [diff] [blame] | 1406 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1407 | |
| 1408 | def CASE653( self, main ): |
| 1409 | """ |
| 1410 | Move a dual-homed host from porst 1A and 1B to ports 2A and 2B |
| 1411 | Host retains the same IP but MAC address changes |
| 1412 | Test connectivity (expect no failure) |
| 1413 | """ |
| 1414 | import time |
| 1415 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1416 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1417 | main.case( "Move a dual-homed host from porst 1A and 1B to ports 2A and 2B with the same IP and different MAC" ) |
| 1418 | setupTest( main, test_idx=653, onosNodes=3 ) |
| 1419 | main.Cluster.active( 0 ).CLI.balanceMasters() |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 1420 | main.log.debug( "sleeping %i seconds" % float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1421 | time.sleep( float( main.params[ 'timers' ][ 'balanceMasterSleep' ] ) ) |
| 1422 | verify( main ) |
| 1423 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1424 | # Move an untagged IPv4 host |
| 1425 | lib.addStaticOnosRoute( main, "10.2.31.0/24", "10.2.30.1" ) |
| 1426 | lib.startScapyHosts( main, scapyNames=[ 'h4v4Scapy' ], mininetNames=[ 'h4v4' ] ) |
| 1427 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.31.1", "h4v4Scapy", "h4v4-bond0" ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1428 | h4v4cfg = '''{"of:0000000000000002/12" : { "interfaces" : [ { "ips" : [ "10.2.30.254/24" ], "vlan-untagged": 16 } ] }, |
| 1429 | "of:0000000000000003/14" : { "interfaces" : [ { "ips" : [ "10.2.30.254/24" ], "vlan-untagged": 16 } ] } }''' |
| 1430 | lib.moveDualHomedHost( main, "h4v4", "leaf2", "leaf3", "leaf2", "leaf3", "10.2.30.254", macAddr="00:aa:01:00:00:03", prefixLen=24, cfg=h4v4cfg ) |
| 1431 | hostLocations = { "h4v4": [ "of:0000000000000002/12", "of:0000000000000003/14" ] } |
| 1432 | lib.verifyHostLocations( main, hostLocations ) |
| 1433 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1434 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.31.1", "h4v4Scapy", "h4v4-bond1" ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1435 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1436 | # Move an untagged IPv6 host |
| 1437 | lib.addStaticOnosRoute( main, "1003::400/120", "1003::3fe" ) |
| 1438 | lib.startScapyHosts( main, scapyNames=[ 'h4v6Scapy' ], mininetNames=[ 'h4v6' ] ) |
| 1439 | lib.verifyTraffic( main, main.internalIpv6Hosts, "1003::4fe", "h4v6Scapy", "h4v6-bond0", ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1440 | h4v6cfg = '''{"of:0000000000000002/13" : { "interfaces" : [ { "ips" : [ "1003::3ff/120" ], "vlan-untagged": 24 } ] }, |
| 1441 | "of:0000000000000003/15" : { "interfaces" : [ { "ips" : [ "1003::3ff/120" ], "vlan-untagged": 24 } ] } }''' |
| 1442 | lib.moveDualHomedHost( main, "h4v6", "leaf2", "leaf3", "leaf2", "leaf3", "1003::3fe", macAddr="00:bb:01:00:00:03", prefixLen=128, cfg=h4v6cfg, ipv6=True ) |
| 1443 | hostLocations = { "h4v6": [ "of:0000000000000002/13", "of:0000000000000003/15" ] } |
| 1444 | lib.verifyHostLocations( main, hostLocations ) |
| 1445 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1446 | lib.verifyTraffic( main, main.internalIpv6Hosts, "1003::4fe", "h4v6Scapy", "h4v6-bond1", ipv6=True ) |
You Wang | 7ea9058 | 2018-07-19 15:27:58 -0700 | [diff] [blame] | 1447 | |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1448 | # Move a tagged IPv4 host |
| 1449 | lib.addStaticOnosRoute( main, "10.2.21.0/24", "10.2.20.1" ) |
| 1450 | lib.startScapyHosts( main, scapyNames=[ 'h5v4Scapy' ], mininetNames=[ 'h5v4' ] ) |
| 1451 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.21.1", "h5v4Scapy", "h5v4-bond0" ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1452 | h5v4cfg = '''{"of:0000000000000002/14" : { "interfaces" : [ { "ips" : [ "10.2.20.254/24" ], "vlan-tagged": [30] } ] }, |
| 1453 | "of:0000000000000003/16" : { "interfaces" : [ { "ips" : [ "10.2.20.254/24" ], "vlan-tagged": [30] } ] } }''' |
| 1454 | lib.moveDualHomedHost( main, "h5v4", "leaf2", "leaf3", "leaf2", "leaf3", "10.2.20.254", macAddr="00:aa:01:00:00:04", prefixLen=24, cfg=h5v4cfg, vlan=30 ) |
| 1455 | hostLocations = { "h5v4": [ "of:0000000000000002/14", "of:0000000000000003/16" ] } |
| 1456 | lib.verifyHostLocations( main, hostLocations ) |
| 1457 | verify( main ) |
You Wang | 2cb7017 | 2018-07-25 16:44:13 -0700 | [diff] [blame] | 1458 | lib.verifyTraffic( main, main.internalIpv4Hosts, "10.2.21.1", "h5v4Scapy", "h5v4-bond1" ) |
You Wang | 6e5b48e | 2018-07-23 16:17:38 -0700 | [diff] [blame] | 1459 | |
You Wang | b254981 | 2018-07-23 11:56:46 -0700 | [diff] [blame] | 1460 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
You Wang | 0f745de | 2018-07-27 15:49:22 -0700 | [diff] [blame] | 1461 | |
| 1462 | def CASE660( self, main ): |
| 1463 | """ |
| 1464 | External router failure |
| 1465 | - Bring down quagga external router-1. Hosts that are behind router-2 should still be reachable. Hosts that are behind router-1 should not be reachable. |
| 1466 | - Bring router up again, all external hosts are reachable again. |
| 1467 | - Repeat this with external router-2. |
| 1468 | """ |
| 1469 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1470 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1471 | main.case( "External router failure with cross-link" ) |
| 1472 | setupTest( main, test_idx=660, onosNodes=3, static=True ) |
| 1473 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1474 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1475 | verify( main, disconnected=False ) |
| 1476 | # Bring down/up external router-1 |
| 1477 | verifyRouterFailure( main, "r1", [ "rh5v4" ], [ "rh11v6", "rh5v6" ] ) |
| 1478 | # Bring down/up external router-2 |
| 1479 | verifyRouterFailure( main, "r2", [], [ "rh22v6" ] ) |
| 1480 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1481 | |
| 1482 | def CASE661( self, main ): |
| 1483 | """ |
| 1484 | External router link failure |
| 1485 | - Drop a non-cross-link for external router-1. All external hosts should be reachable (via cross-link). |
| 1486 | - Bring up the link. All external hosts should be reachable. |
| 1487 | - Repeat the steps above with the cross-link of external router-1 |
| 1488 | - Repeat all steps above with external router-2 |
| 1489 | """ |
| 1490 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1491 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1492 | main.case( "External router link failure with cross-link" ) |
| 1493 | setupTest( main, test_idx=661, onosNodes=3, static=True ) |
| 1494 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1495 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1496 | verify( main, disconnected=False ) |
| 1497 | # Bring down/up a non-cross-link for external router-1 |
| 1498 | portsToDisable = [ [ "of:0000000000000005", 13 ] ] |
| 1499 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1500 | verify( main, disconnected=False, internal=False ) |
| 1501 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1502 | verify( main, disconnected=False, internal=False ) |
| 1503 | # Bring down/up a cross-link for external router-1 |
| 1504 | portsToDisable = [ [ "of:0000000000000005", 14 ] ] |
| 1505 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1506 | verify( main, disconnected=False, internal=False ) |
| 1507 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1508 | verify( main, disconnected=False, internal=False ) |
| 1509 | # Bring down/up a non-cross-link for external router-2 |
| 1510 | portsToDisable = [ [ "of:0000000000000004", 14 ] ] |
| 1511 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1512 | verify( main, disconnected=False, internal=False ) |
| 1513 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1514 | verify( main, disconnected=False, internal=False ) |
| 1515 | # Bring down/up a cross-link for external router-2 |
| 1516 | portsToDisable = [ [ "of:0000000000000004", 13 ] ] |
| 1517 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1518 | verify( main, disconnected=False, internal=False ) |
| 1519 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1520 | verify( main, disconnected=False, internal=False ) |
| 1521 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1522 | |
| 1523 | def CASE662( self, main ): |
| 1524 | """ |
| 1525 | Internal router failure |
| 1526 | - Bring down quagga internal router-1. All external hosts should be reachable (via cross-link). |
| 1527 | - Bring the router up. All external hosts should be reachable. |
| 1528 | - Repeat this with internal router-2. |
| 1529 | """ |
| 1530 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1531 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1532 | main.case( "Internal router failure with cross-link" ) |
| 1533 | setupTest( main, test_idx=662, onosNodes=3, static=True ) |
| 1534 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1535 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1536 | verify( main, disconnected=False ) |
| 1537 | # Bring down/up internal router-1 |
| 1538 | verifyRouterFailure( main, "bgp1" ) |
| 1539 | # Bring down/up internal router-2 |
| 1540 | verifyRouterFailure( main, "bgp2" ) |
| 1541 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1542 | |
| 1543 | def CASE663( self, main ): |
| 1544 | """ |
| 1545 | External router failure without cross-link |
| 1546 | - Drop the cross-link for both external routers. All external hosts should be reachable. |
| 1547 | - Bring down quagga external router-1. Hosts that are behind router-2 should still be reachable. Hosts that are behind router-1 should not be reachable. |
| 1548 | - Bring router up again, all external hosts are reachable again. |
| 1549 | - Repeat this with external router-2. |
| 1550 | """ |
| 1551 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1552 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1553 | main.case( "External router failure without cross-link" ) |
| 1554 | setupTest( main, test_idx=663, onosNodes=3, static=True ) |
| 1555 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1556 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1557 | verify( main, disconnected=False ) |
| 1558 | # Drop the cross-link |
| 1559 | portsToDisable = [ [ "of:0000000000000004", 13 ], [ "of:0000000000000005", 14 ] ] |
| 1560 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1561 | verify( main, disconnected=False, internal=False ) |
| 1562 | # Bring down/up external router-1 |
| 1563 | verifyRouterFailure( main, "r1", [ "rh5v4" ], [ "rh11v6", "rh5v6" ] ) |
| 1564 | # Bring down/up external router-2 |
| 1565 | verifyRouterFailure( main, "r2", [], [ "rh22v6" ] ) |
| 1566 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1567 | |
| 1568 | def CASE664( self, main ): |
| 1569 | """ |
| 1570 | External router link failure without cross-link |
| 1571 | - Drop the cross-link for both external routers. All external hosts should be reachable. |
| 1572 | - Drop an extra link for external router-1. Only hosts connected to router-2 should be reachable. |
| 1573 | - Bring up single link for external router-1. All external hosts should be reachable. |
| 1574 | - Repeat the two steps above with external router-2 |
| 1575 | """ |
| 1576 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1577 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1578 | main.case( "External router link failure without cross-link" ) |
| 1579 | setupTest( main, test_idx=664, onosNodes=3, static=True ) |
| 1580 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1581 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1582 | verify( main, disconnected=False ) |
| 1583 | # Drop the cross-link |
| 1584 | portsToDisable = [ [ "of:0000000000000004", 13 ], [ "of:0000000000000005", 14 ] ] |
| 1585 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1586 | verify( main, disconnected=False, internal=False ) |
| 1587 | # Bring down/up a non-cross-link for external router-1 |
| 1588 | portsToDisable = [ [ "of:0000000000000005", 13 ] ] |
| 1589 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1590 | main.disconnectedExternalIpv4Hosts = [ 'rh5v4' ] |
| 1591 | main.disconnectedExternalIpv6Hosts = [ "rh11v6", "rh5v6" ] |
| 1592 | verify( main, internal=False ) |
| 1593 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1594 | main.disconnectedExternalIpv4Hosts = [] |
| 1595 | main.disconnectedExternalIpv6Hosts = [] |
| 1596 | verify( main, disconnected=False, internal=False ) |
| 1597 | # Bring down/up a non-cross-link for external router-2 |
| 1598 | portsToDisable = [ [ "of:0000000000000004", 14 ] ] |
| 1599 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1600 | main.disconnectedExternalIpv6Hosts = [ "rh22v6" ] |
| 1601 | verify( main, internal=False ) |
| 1602 | lib.enablePortBatch( main, portsToDisable, 10, 48 ) |
| 1603 | main.disconnectedExternalIpv6Hosts = [] |
| 1604 | verify( main, disconnected=False, internal=False ) |
| 1605 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |
| 1606 | |
| 1607 | def CASE665( self, main ): |
| 1608 | """ |
| 1609 | Internal router failure without cross-link |
| 1610 | - Drop the cross-link for both external routers. All external hosts should be reachable. |
| 1611 | - Bring down quagga internal router-1. Hosts that are behind router-2 should still be reachable. Hosts that are behind router-1 should not be reachable. |
| 1612 | - Bring router up again, all external hosts are reachable again. |
| 1613 | - Repeat this with internal router-2. |
| 1614 | """ |
| 1615 | from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import * |
| 1616 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib |
| 1617 | main.case( "Internal router failure without cross-link" ) |
| 1618 | setupTest( main, test_idx=665, onosNodes=3, static=True ) |
| 1619 | main.externalIpv4Hosts += main.staticIpv4Hosts |
| 1620 | main.externalIpv6Hosts += main.staticIpv6Hosts |
| 1621 | verify( main, disconnected=False ) |
| 1622 | # Drop the cross-link |
| 1623 | portsToDisable = [ [ "of:0000000000000004", 13 ], [ "of:0000000000000005", 14 ] ] |
| 1624 | lib.disablePortBatch( main, portsToDisable, 10, 48 ) |
| 1625 | verify( main, disconnected=False, internal=False ) |
| 1626 | # Bring down/up internal router-1 |
| 1627 | verifyRouterFailure( main, "bgp1", [], [ "rh22v6" ] ) |
| 1628 | # Bring down/up internal router-2 |
| 1629 | verifyRouterFailure( main, "bgp2", [ "rh5v4" ], [ "rh11v6", "rh5v6" ] ) |
| 1630 | lib.cleanup( main, copyKarafLog=False, removeHostComponent=True ) |