CLOUDSTACK-4772: modify the script to get_process_status for vmware deployment

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
SrikanteswaraRao Talluri 2013-10-30 01:40:33 +05:30
parent f1683d0ad4
commit 3223fcf672
2 changed files with 42 additions and 27 deletions

View File

@ -1110,7 +1110,7 @@ class TestRouterStopCreateFW(cloudstackTestCase):
self.cleanup = [] self.cleanup = []
return return
@attr(tags = ["advanced", "advancedns"]) @attr(tags = ["advanced", "advancedns","test"])
def test_01_RouterStopCreateFW(self): def test_01_RouterStopCreateFW(self):
"""Test router stop create Firewall rule """Test router stop create Firewall rule
""" """
@ -1249,9 +1249,21 @@ class TestRouterStopCreateFW(cloudstackTestCase):
"Check for list hosts response return valid data" "Check for list hosts response return valid data"
) )
host = hosts[0] host = hosts[0]
# For DNS and DHCP check 'dnsmasq' process status
try:
host.user, host.passwd = get_host_credentials(self.config, host.ipaddress) host.user, host.passwd = get_host_credentials(self.config, host.ipaddress)
# For DNS and DHCP check 'dnsmasq' process status
if self.apiclient.hypervisor.lower() == 'vmware':
result = get_process_status(
self.apiclient.connection.mgtSvr,
22,
self.apiclient.connection.user,
self.apiclient.connection.passwd,
router.linklocalip,
'iptables -t nat -L',
hypervisor=self.apiclient.hypervisor
)
else:
try:
result = get_process_status( result = get_process_status(
host.ipaddress, host.ipaddress,
22, 22,
@ -1260,6 +1272,9 @@ class TestRouterStopCreateFW(cloudstackTestCase):
router.linklocalip, router.linklocalip,
'iptables -t nat -L' 'iptables -t nat -L'
) )
except KeyError:
self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName)
self.debug("iptables -t nat -L: %s" % result) self.debug("iptables -t nat -L: %s" % result)
self.debug("Public IP: %s" % public_ip.ipaddress) self.debug("Public IP: %s" % public_ip.ipaddress)
res = str(result) res = str(result)
@ -1268,6 +1283,5 @@ class TestRouterStopCreateFW(cloudstackTestCase):
1, 1,
"Check public IP address" "Check public IP address"
) )
except KeyError:
self.skipTest("Provide a marvin config file with host credentials to run %s" % self._testMethodName)
return return

View File

@ -201,6 +201,9 @@ class TestRouterServices(cloudstackTestCase):
router.linklocalip, router.linklocalip,
"service dnsmasq status" "service dnsmasq status"
) )
except KeyError:
self.skipTest("Marvin configuration has no host credentials to check router services")
res = str(result) res = str(result)
self.debug("Dnsmasq process status: %s" % res) self.debug("Dnsmasq process status: %s" % res)
@ -209,8 +212,6 @@ class TestRouterServices(cloudstackTestCase):
1, 1,
"Check dnsmasq service is running or not" "Check dnsmasq service is running or not"
) )
except KeyError:
self.skipTest("Marvin configuration has no host credentials to check router services")
return return