summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-04-09 11:56:04 +0200
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-04-12 07:56:25 +0000
commit501ce432cc19dddfa0720cf6c104f09e81813367 (patch)
tree099536db8f1f8234630ee0e65e666cf8fa6a7038
parentcc10bd492affb033b68d3b8f4cb1d8c9d554f995 (diff)
testcase_10 intermittent failure
There are vm monitor threads running incorrectly which causes this testcase to fail intermittently. It is fixed properly now. Change-Id: I61abf7e33700abdcb2e9ab7cfa72f6e3ad6c7a67 Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com> (cherry picked from commit 592c41bd3f46da98162999a3aaf1a8456036ecf7)
-rw-r--r--sdnvpn/test/functest/testcase_10.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/sdnvpn/test/functest/testcase_10.py b/sdnvpn/test/functest/testcase_10.py
index d33437a..d4ab664 100644
--- a/sdnvpn/test/functest/testcase_10.py
+++ b/sdnvpn/test/functest/testcase_10.py
@@ -32,7 +32,7 @@ TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig(
def monitor(in_data, out_data, vm):
# At the beginning of ping we might have some
# failures, so we ignore the first 10 pings
- lines_offset = 10
+ lines_offset = 20
while in_data["stop_thread"] is False:
try:
time.sleep(1)
@@ -114,7 +114,7 @@ def main():
compute_node=av_zone_1)
vm2_ip = test_utils.get_instance_ip(vm_2)
- u1 = test_utils.generate_ping_userdata([vm2_ip], 1)
+ u1 = test_utils.generate_ping_userdata([vm2_ip])
vm_1 = test_utils.create_instance(
nova_client,
TESTCASE_CONFIG.instance_1_name,
@@ -126,7 +126,7 @@ def main():
userdata=u1)
vm1_ip = test_utils.get_instance_ip(vm_1)
- u3 = test_utils.generate_ping_userdata([vm1_ip, vm2_ip], 1)
+ u3 = test_utils.generate_ping_userdata([vm1_ip, vm2_ip])
vm_3 = test_utils.create_instance(
nova_client,
TESTCASE_CONFIG.instance_3_name,
@@ -196,8 +196,15 @@ def main():
logging.error("Fail to delete vm_2 instance during "
"testing process")
raise Exception("Fail to delete instance vm_2.")
+ for thread_input in thread_inputs:
+ thread_input["stop_thread"] = True
+ for thread in threads:
+ thread.join()
+ threads = []
+ thread_inputs = []
+ thread_outputs = []
# Create a new vm (vm_4) on compute 1 node
- u4 = test_utils.generate_ping_userdata([vm1_ip, vm3_ip], 1)
+ u4 = test_utils.generate_ping_userdata([vm1_ip, vm3_ip])
vm_4 = test_utils.create_instance(
nova_client,
TESTCASE_CONFIG.instance_4_name,
@@ -226,7 +233,7 @@ def main():
thread_inputs.append(monitor_input4)
thread_outputs.append(monitor_output4)
logging.info("Starting monitor thread of vm_4")
- threads[3].start()
+ threads[0].start()
test_utils.wait_before_subtest()
monitor_err_msg = ""
for thread_output in thread_outputs: