Skip to content

Commit fb7eb06

Browse files
author
Prasanna Santhanam
committed
get host credentials from marvin configuration for ssvm test
(cherry picked from commit 6371d3b98c56784e4a3588c2546be18aa79cb595)
1 parent e826956 commit fb7eb06

1 file changed

Lines changed: 35 additions & 28 deletions

File tree

test/integration/smoke/test_ssvm.py

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ class Services:
3737

3838
def __init__(self):
3939
self.services = {
40-
"host": {
41-
"username": 'root', # Credentials for SSH
42-
"password": 'password',
43-
"publicport": 22,
44-
},
4540
"sleep": 60,
4641
"timeout": 10,
4742
}
@@ -346,14 +341,18 @@ def test_03_ssvm_internals(self):
346341
hypervisor=self.apiclient.hypervisor
347342
)
348343
else:
349-
result = get_process_status(
350-
host.ipaddress,
351-
self.services['host']["publicport"],
352-
self.services['host']["username"],
353-
self.services['host']["password"],
354-
ssvm.linklocalip,
355-
"/usr/local/cloud/systemvm/ssvm-check.sh |grep -e ERROR -e WARNING -e FAIL"
344+
try:
345+
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
346+
result = get_process_status(
347+
host.ipaddress,
348+
22,
349+
host.user,
350+
host.passwd,
351+
ssvm.linklocalip,
352+
"/usr/local/cloud/systemvm/ssvm-check.sh |grep -e ERROR -e WARNING -e FAIL"
356353
)
354+
except KeyError:
355+
self.skipTest("Marvin configuration has no host credentials to check router services")
357356
res = str(result)
358357
self.debug("SSVM script output: %s" % res)
359358

@@ -382,14 +381,18 @@ def test_03_ssvm_internals(self):
382381
hypervisor=self.apiclient.hypervisor
383382
)
384383
else:
385-
result = get_process_status(
386-
host.ipaddress,
387-
self.services['host']["publicport"],
388-
self.services['host']["username"],
389-
self.services['host']["password"],
390-
ssvm.linklocalip,
391-
"service cloud status"
392-
)
384+
try:
385+
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
386+
result = get_process_status(
387+
host.ipaddress,
388+
22,
389+
host.user,
390+
host.passwd,
391+
ssvm.linklocalip,
392+
"service cloud status"
393+
)
394+
except KeyError:
395+
self.skipTest("Marvin configuration has no host credentials to check router services")
393396
res = str(result)
394397
self.debug("Cloud Process status: %s" % res)
395398
# cloud.com service (type=secstorage) is running: process id: 2346
@@ -462,14 +465,18 @@ def test_04_cpvm_internals(self):
462465
hypervisor=self.apiclient.hypervisor
463466
)
464467
else:
465-
result = get_process_status(
466-
host.ipaddress,
467-
self.services['host']["publicport"],
468-
self.services['host']["username"],
469-
self.services['host']["password"],
470-
cpvm.linklocalip,
471-
"service cloud status"
472-
)
468+
try:
469+
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
470+
result = get_process_status(
471+
host.ipaddress,
472+
22,
473+
host.user,
474+
host.passwd,
475+
cpvm.linklocalip,
476+
"service cloud status"
477+
)
478+
except KeyError:
479+
self.skipTest("Marvin configuration has no host credentials to check router services")
473480
res = str(result)
474481
self.debug("Cloud Process status: %s" % res)
475482
self.assertEqual(

0 commit comments

Comments
 (0)