self.num_tests_failed = 0
def get_ping_status(self,
- vm_source, ip_source,
- vm_target, ip_target,
+ vm_source,
+ vm_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 "
def add_success(self, test):
self.add_to_summary(2, "PASS", test)
- def check_ssh_output(self, vm_source, ip_source,
- vm_target, ip_target,
+ def check_ssh_output(self, vm_source, vm_target,
expected, 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
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1,
userdata=u1)
- vm_1_ip = vm_1.networks.itervalues().next()[0]
msg = ("Create VPN with eRT<>iRT")
results.record_action(msg)
logger.error("One or more instances is down")
# TODO: Handle this appropriately
- # Ping from VM1 to VM2 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_2, vm_2_ip,
- expected="PASS", timeout=200)
- # Ping from VM1 to VM3 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_3, vm_3_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM4 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="FAIL", timeout=30)
+ results.get_ping_status(vm_1, vm_2, expected="PASS", timeout=200)
+ results.get_ping_status(vm_1, vm_3, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="FAIL", timeout=30)
msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_2_name)
results.add_to_summary(0, "-")
" updated network configuration")
test_utils.wait_before_subtest()
- # Ping from VM4 to VM5 should work
- results.get_ping_status(vm_4, vm_4_ip, vm_5, vm_5_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM4 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="FAIL", timeout=30)
- # Ping from VM1 to VM5 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_5, vm_5_ip,
- expected="FAIL", timeout=30)
+ results.get_ping_status(vm_4, vm_5, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="FAIL", timeout=30)
+ results.get_ping_status(vm_1, vm_5, expected="FAIL", timeout=30)
msg = ("Update VPN with eRT=iRT ...")
results.add_to_summary(0, "-")
" updated network configuration")
test_utils.wait_before_subtest()
- # Ping from VM1 to VM4 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM5 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_5, vm_5_ip,
- expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_5, expected="PASS", timeout=30)
return results.compile_summary(TESTCASE_CONFIG.success_criteria)
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1,
userdata=userdata_common)
- vm_2_ip = vm_2.networks.itervalues().next()[0]
vm_3 = test_utils.create_instance(
nova_client,
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2,
userdata=userdata_common)
- vm_3_ip = vm_3.networks.itervalues().next()[0]
vm_5 = test_utils.create_instance(
nova_client,
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2,
userdata=userdata_common)
- vm_5_ip = vm_5.networks.itervalues().next()[0]
# We boot vm5 first because we need vm5_ip for vm4 userdata
u4 = test_utils.generate_userdata_with_ssh(
compute_node=av_zone_1,
userdata=u4,
files=files)
- vm_4_ip = vm_4.networks.itervalues().next()[0]
# We boot VM1 at the end because we need to get the IPs first to generate
# the userdata
compute_node=av_zone_1,
userdata=u1,
files=files)
- vm_1_ip = vm_1.networks.itervalues().next()[0]
msg = ("Create VPN1 with eRT=iRT")
results.record_action(msg)
test_utils.wait_before_subtest()
# 10.10.10.12 should return sdnvpn-2 to sdnvpn-1
- results.check_ssh_output(
- vm_1, vm_1_ip,
- vm_2, vm_2_ip,
- expected=TESTCASE_CONFIG.instance_2_name,
- timeout=200)
+ results.check_ssh_output(vm_1, vm_2,
+ expected=TESTCASE_CONFIG.instance_2_name,
+ timeout=200)
# 10.10.11.13 should return sdnvpn-3 to sdnvpn-1
- results.check_ssh_output(
- vm_1, vm_1_ip,
- vm_3, vm_3_ip,
- expected=TESTCASE_CONFIG.instance_3_name,
- timeout=30)
+ results.check_ssh_output(vm_1, vm_3,
+ expected=TESTCASE_CONFIG.instance_3_name,
+ timeout=30)
results.add_to_summary(0, "-")
msg = ("Create VPN2 with eRT=iRT")
test_utils.wait_before_subtest()
# 10.10.11.13 should return sdnvpn-5 to sdnvpn-4
- results.check_ssh_output(
- vm_4, vm_4_ip,
- vm_5, vm_5_ip,
- expected=TESTCASE_CONFIG.instance_5_name,
- timeout=30)
+ results.check_ssh_output(vm_4, vm_5,
+ expected=TESTCASE_CONFIG.instance_5_name,
+ timeout=30)
# 10.10.10.11 should return "not reachable" to sdnvpn-4
- results.check_ssh_output(
- vm_4, vm_4_ip, vm_1, vm_1_ip, expected="not reachable", timeout=30)
+ results.check_ssh_output(vm_4, vm_1,
+ expected="not reachable",
+ timeout=30)
return results.compile_summary(TESTCASE_CONFIG.success_criteria)
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1,
userdata=u1)
- vm_1_ip = vm_1.networks.itervalues().next()[0]
msg = ("Create VPN with eRT<>iRT")
results.record_action(msg)
logger.error("One or more instances is down")
# TODO Handle appropriately
- # Ping from VM1 to VM2 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_2, vm_2_ip,
- expected="PASS", timeout=200)
- # Ping from VM1 to VM3 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_3, vm_3_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM4 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="FAIL", timeout=30)
+ results.get_ping_status(vm_1, vm_2, expected="PASS", timeout=200)
+ results.get_ping_status(vm_1, vm_3, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="FAIL", timeout=30)
msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_2_name)
results.add_to_summary(0, "-")
" updated network configuration")
test_utils.wait_before_subtest()
- # Ping from VM4 to VM5 should work
- results.get_ping_status(vm_4, vm_4_ip, vm_5, vm_5_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM4 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="FAIL", timeout=30)
- # Ping from VM1 to VM5 should not work
- results.get_ping_status(vm_1, vm_1_ip, vm_5, vm_5_ip,
- expected="FAIL", timeout=30)
+ results.get_ping_status(vm_4, vm_5, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="FAIL", timeout=30)
+ results.get_ping_status(vm_1, vm_5, expected="FAIL", timeout=30)
msg = ("Update VPN with eRT=iRT ...")
results.add_to_summary(0, "-")
" updated network configuration")
test_utils.wait_before_subtest()
- # Ping from VM1 to VM4 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_4, vm_4_ip,
- expected="PASS", timeout=30)
- # Ping from VM1 to VM5 should work
- results.get_ping_status(vm_1, vm_1_ip, vm_5, vm_5_ip,
- expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_4, expected="PASS", timeout=30)
+ results.get_ping_status(vm_1, vm_5, expected="PASS", timeout=30)
results.add_to_summary(0, "=")
logger.info("\n%s" % results.summary)