summaryrefslogtreecommitdiffstats
path: root/sdnvpn/lib/results.py
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-11-20 13:15:26 +0100
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-01-09 12:49:06 +0100
commitd61955e655416c97be7a5030ae5ae23542a28a9e (patch)
tree2515d6beb04e42fb3738f3671befb8751e22c37a /sdnvpn/lib/results.py
parent3717c701d12936aec96eaf3d8b369ba52a8a287f (diff)
Intra-Data Center ECMP testcase
This testcase add a scenario in which one extra route can be reachable through two VMs which are in a same network attached to a router which is later associated to a BGPVPN instance. This extra route ip address is different from subnet of VMs. After the extra route is configured with VM ips as nexthops, then when third VM is trying to reach extra route, traffic would split between two VMs. The traffic split can happen only in heavy loaded scenario, so this testcase would test only reachability. JIRA: SDNVPN-23 Change-Id: I4bb4e94f5c98c0f3c22bff7a6998af2a7a919f16 Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'sdnvpn/lib/results.py')
-rw-r--r--sdnvpn/lib/results.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/sdnvpn/lib/results.py b/sdnvpn/lib/results.py
index 679284e..790a916 100644
--- a/sdnvpn/lib/results.py
+++ b/sdnvpn/lib/results.py
@@ -29,11 +29,17 @@ class Results(object):
vm_source,
vm_target,
expected="PASS", timeout=30):
+ ip_target = vm_target.networks.itervalues().next()[0]
+ self.get_ping_status_target_ip(vm_source, vm_target.name,
+ ip_target, expected, timeout)
+
+ def get_ping_status_target_ip(self,
+ vm_source,
+ target_name,
+ ip_target,
+ expected="PASS", timeout=30):
console_log = vm_source.get_console_output()
-
ip_source = vm_source.networks.itervalues().next()[0]
- ip_target = vm_target.networks.itervalues().next()[0]
-
if "request failed" in console_log:
# Normally, cirros displays this message when userdata fails
logger.debug("It seems userdata is not supported in "
@@ -46,11 +52,11 @@ class Results(object):
test_case_name = ("'%s' %s '%s'" %
(vm_source.name,
expected_result,
- vm_target.name))
+ target_name))
logger.debug("%sPing\n%sfrom '%s' (%s)\n%sto '%s' (%s).\n"
"%s-->Expected result: %s.\n"
% (tab, tab, vm_source.name, ip_source,
- tab, vm_target.name, ip_target,
+ tab, target_name, ip_target,
tab, expected_result))
while True:
console_log = vm_source.get_console_output()
@@ -60,7 +66,7 @@ class Results(object):
last_n_lines = lines[-5:]
if ("ping %s OK" % ip_target) in last_n_lines:
msg = ("'%s' can ping '%s'"
- % (vm_source.name, vm_target.name))
+ % (vm_source.name, target_name))
if expected == "PASS":
logger.debug("[PASS] %s" % msg)
self.add_success(test_case_name)
@@ -71,7 +77,7 @@ class Results(object):
break
elif ("ping %s KO" % ip_target) in last_n_lines:
msg = ("'%s' cannot ping '%s'" %
- (vm_source.name, vm_target.name))
+ (vm_source.name, target_name))
if expected == "FAIL":
logger.debug("[PASS] %s" % msg)
self.add_success(test_case_name)