Skip to content

Commit 4eece72

Browse files
Bug-Id: CS-19455 Add support for Hyper-v in regression test test_routers.py
Signed-off-by: sanjeevneelarapu <sanjeev.neelarapu@citrix.com>
1 parent 3f7b628 commit 4eece72

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎test/integration/component/test_routers.py‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,21 +1254,10 @@ def test_01_RouterStopCreateFW(self):
12541254
str(self.services["fw_rule"]["endport"]),
12551255
"Check end port of firewall rule"
12561256
)
1257-
hosts = list_hosts(
1258-
self.apiclient,
1259-
id=router.hostid,
1260-
)
1261-
self.assertEqual(
1262-
isinstance(hosts, list),
1263-
True,
1264-
"Check for list hosts response return valid data"
1265-
)
1266-
host = hosts[0]
1267-
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
1268-
12691257
# For DNS and DHCP check 'dnsmasq' process status
1270-
if self.apiclient.hypervisor.lower() == 'vmware':
1271-
result = get_process_status(
1258+
if (self.apiclient.hypervisor.lower() == 'vmware'
1259+
or self.apiclient.hypervisor.lower() == 'hyperv'):
1260+
result = get_process_status(
12721261
self.apiclient.connection.mgtSvr,
12731262
22,
12741263
self.apiclient.connection.user,
@@ -1278,6 +1267,17 @@ def test_01_RouterStopCreateFW(self):
12781267
hypervisor=self.apiclient.hypervisor
12791268
)
12801269
else:
1270+
hosts = list_hosts(
1271+
self.apiclient,
1272+
id=router.hostid,
1273+
)
1274+
self.assertEqual(
1275+
isinstance(hosts, list),
1276+
True,
1277+
"Check for list hosts response return valid data"
1278+
)
1279+
host = hosts[0]
1280+
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
12811281
try:
12821282
result = get_process_status(
12831283
host.ipaddress,

‎tools/marvin/marvin/integration/lib/utils.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def get_process_status(hostip, port, username, password, linklocalip, process, h
191191

192192
#SSH to the machine
193193
ssh = SshClient(hostip, port, username, password)
194-
if str(hypervisor).lower() == 'vmware':
194+
if (str(hypervisor).lower() == 'vmware'
195+
or str(hypervisor).lower() == 'hyperv'):
195196
ssh_command = "ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no "
196197
else:
197198
ssh_command = "ssh -i ~/.ssh/id_rsa.cloud -ostricthostkeychecking=no "

0 commit comments

Comments
 (0)