+ #
+ # bring down pg1 expect LB to adjust to use only those that are pu
+ #
+ self.pg1.link_down()
+
+ rx = self.send_and_expect_load_balancing(self.pg0, src_pkts,
+ [self.pg2, self.pg3,
+ self.pg4])
+ self.assertEqual(len(src_pkts), len(rx))
+
+ #
+ # bring down pg2 expect LB to adjust to use only those that are pu
+ #
+ self.pg2.link_down()
+
+ rx = self.send_and_expect_load_balancing(self.pg0, src_pkts,
+ [self.pg3, self.pg4])
+ self.assertEqual(len(src_pkts), len(rx))
+
+ #
+ # bring the links back up - expect LB over all again
+ #
+ self.pg1.link_up()
+ self.pg2.link_up()
+
+ rx = self.send_and_expect_load_balancing(self.pg0, src_pkts,
+ [self.pg1, self.pg2,
+ self.pg3, self.pg4])
+ self.assertEqual(len(src_pkts), len(rx))
+
+ #
+ # The same link-up/down but this time admin state
+ #
+ self.pg1.admin_down()
+ self.pg2.admin_down()
+ rx = self.send_and_expect_load_balancing(self.pg0, src_pkts,
+ [self.pg3, self.pg4])
+ self.assertEqual(len(src_pkts), len(rx))
+ self.pg1.admin_up()
+ self.pg2.admin_up()
+ self.pg1.resolve_arp()
+ self.pg2.resolve_arp()
+ rx = self.send_and_expect_load_balancing(self.pg0, src_pkts,
+ [self.pg1, self.pg2,
+ self.pg3, self.pg4])
+ self.assertEqual(len(src_pkts), len(rx))
+