Skip to content

Commit e94ec6b

Browse files
author
SrikanteswaraRao Talluri
committed
CLOUDSTACK-4772: modify the script to get_process_status for vmware deployment
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
1 parent c6ce74f commit e94ec6b

2 files changed

Lines changed: 42 additions & 27 deletions

File tree

‎test/integration/component/test_routers.py‎

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ def setUp(self):
11101110
self.cleanup = []
11111111
return
11121112

1113-
@attr(tags = ["advanced", "advancedns"])
1113+
@attr(tags = ["advanced", "advancedns","test"])
11141114
def test_01_RouterStopCreateFW(self):
11151115
"""Test router stop create Firewall rule
11161116
"""
@@ -1249,25 +1249,39 @@ def test_01_RouterStopCreateFW(self):
12491249
"Check for list hosts response return valid data"
12501250
)
12511251
host = hosts[0]
1252+
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
1253+
12521254
# For DNS and DHCP check 'dnsmasq' process status
1253-
try:
1254-
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
1255-
result = get_process_status(
1256-
host.ipaddress,
1257-
22,
1258-
host.user,
1259-
host.passwd,
1260-
router.linklocalip,
1261-
'iptables -t nat -L'
1262-
)
1263-
self.debug("iptables -t nat -L: %s" % result)
1264-
self.debug("Public IP: %s" % public_ip.ipaddress)
1265-
res = str(result)
1266-
self.assertEqual(
1267-
res.count(str(public_ip.ipaddress)),
1268-
1,
1269-
"Check public IP address"
1255+
if self.apiclient.hypervisor.lower() == 'vmware':
1256+
result = get_process_status(
1257+
self.apiclient.connection.mgtSvr,
1258+
22,
1259+
self.apiclient.connection.user,
1260+
self.apiclient.connection.passwd,
1261+
router.linklocalip,
1262+
'iptables -t nat -L',
1263+
hypervisor=self.apiclient.hypervisor
1264+
)
1265+
else:
1266+
try:
1267+
result = get_process_status(
1268+
host.ipaddress,
1269+
22,
1270+
host.user,
1271+
host.passwd,
1272+
router.linklocalip,
1273+
'iptables -t nat -L'
1274+
)
1275+
except KeyError:
1276+
self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName)
1277+
1278+
self.debug("iptables -t nat -L: %s" % result)
1279+
self.debug("Public IP: %s" % public_ip.ipaddress)
1280+
res = str(result)
1281+
self.assertEqual(
1282+
res.count(str(public_ip.ipaddress)),
1283+
1,
1284+
"Check public IP address"
12701285
)
1271-
except KeyError:
1272-
self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName)
1286+
12731287
return

‎test/integration/smoke/test_routers.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,17 @@ def test_01_router_internal_basic(self):
201201
router.linklocalip,
202202
"service dnsmasq status"
203203
)
204-
res = str(result)
205-
self.debug("Dnsmasq process status: %s" % res)
206204

207-
self.assertEqual(
208-
res.count("running"),
209-
1,
210-
"Check dnsmasq service is running or not"
211-
)
212205
except KeyError:
213206
self.skipTest("Marvin configuration has no host credentials to check router services")
207+
res = str(result)
208+
self.debug("Dnsmasq process status: %s" % res)
209+
210+
self.assertEqual(
211+
res.count("running"),
212+
1,
213+
"Check dnsmasq service is running or not"
214+
)
214215
return
215216

216217

0 commit comments

Comments
 (0)