|
20 | 20 | """ |
21 | 21 |
|
22 | 22 | from nose.plugins.attrib import attr |
| 23 | +from marvin.cloudstackAPI import rebootRouter |
23 | 24 | from marvin.cloudstackTestCase import cloudstackTestCase, unittest |
24 | 25 | from marvin.lib.utils import (validateList, |
25 | 26 | get_host_credentials, |
@@ -106,6 +107,23 @@ def tearDown(cls): |
106 | 107 | raise Exception("Warning: Exception during cleanup : %s" % e) |
107 | 108 | return |
108 | 109 |
|
| 110 | + def get_router(self, router_id): |
| 111 | + routers = list_routers( |
| 112 | + self.apiclient, |
| 113 | + id=router_id, |
| 114 | + listall=True) |
| 115 | + self.assertEqual( |
| 116 | + isinstance(routers, list), |
| 117 | + True, |
| 118 | + "Check for list routers response return valid data" |
| 119 | + ) |
| 120 | + self.assertNotEqual( |
| 121 | + len(routers), |
| 122 | + 0, |
| 123 | + "Check list router response" |
| 124 | + ) |
| 125 | + return routers[0] |
| 126 | + |
109 | 127 | def get_routers(self, network_id): |
110 | 128 | routers = list_routers( |
111 | 129 | self.apiclient, |
@@ -672,6 +690,22 @@ def test_02_acquire_public_ips_in_isolated_network_with_redundant_vrs(self): |
672 | 690 | self.verify_ip_address_in_router(router, host, ipaddress_5.ipaddress.ipaddress, "eth4", False) |
673 | 691 | self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth4", True) |
674 | 692 |
|
| 693 | + # reboot router |
| 694 | + for router in routers: |
| 695 | + cmd = rebootRouter.rebootRouterCmd() |
| 696 | + cmd.id = router.id |
| 697 | + self.apiclient.rebootRouter(cmd) |
| 698 | + router = self.get_router(router.id) |
| 699 | + host = self.get_router_host(router) |
| 700 | + self.verify_network_interfaces_in_router(router, host, "eth0,eth1,eth2,eth3,") |
| 701 | + guestIp, controlIp, sourcenatIp = self.get_router_ips(router) |
| 702 | + self.verify_ip_address_in_router(router, host, guestIp, "eth0", True) |
| 703 | + self.verify_ip_address_in_router(router, host, controlIp, "eth1", True) |
| 704 | + self.verify_ip_address_in_router(router, host, sourcenatIp, "eth2", True) |
| 705 | + self.verify_ip_address_in_router(router, host, ipaddress_4.ipaddress.ipaddress, "eth3", False) |
| 706 | + self.verify_ip_address_in_router(router, host, ipaddress_5.ipaddress.ipaddress, "eth3", False) |
| 707 | + self.verify_ip_address_in_router(router, host, ipaddress_6.ipaddress.ipaddress, "eth3", True) |
| 708 | + |
675 | 709 | # 20. restart network with cleanup |
676 | 710 | self.network1.restart(self.apiclient, cleanup=True) |
677 | 711 | routers = self.get_routers(self.network1.id) |
|
0 commit comments