From 2417d16aa6767a4c1bb6f28104076bb4b11d5e10 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Tue, 13 Dec 2016 10:55:35 +0200 Subject: Encapsulate some functionality in Results class - Move adding actions taken during tests to summary in a method in Results - Provide add_success/failure methods that hide the column size manipulation Change-Id: If7416f3f9399125fe21632328a49af285a4b6cc6 Signed-off-by: Romanos Skiadas --- test/functest/testcase_1.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'test/functest/testcase_1.py') diff --git a/test/functest/testcase_1.py b/test/functest/testcase_1.py index eba39bb..a84478f 100644 --- a/test/functest/testcase_1.py +++ b/test/functest/testcase_1.py @@ -135,8 +135,7 @@ def main(): vm_1_ip = vm_1.networks.itervalues().next()[0] msg = ("Create VPN with eRT<>iRT") - logger.info(msg) - results.add_to_summary(1, msg) + results.record_action(msg) vpn_name = "sdnvpn-" + str(randint(100000, 999999)) kwargs = { "import_targets": TESTCASE_CONFIG.targets1, @@ -149,8 +148,7 @@ def main(): logger.debug("VPN created details: %s" % bgpvpn) msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_1_name) - logger.info(msg) - results.add_to_summary(1, msg) + results.record_action(msg) results.add_to_summary(0, "-") os_utils.create_network_association( @@ -176,9 +174,8 @@ def main(): expected="FAIL", timeout=30) msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_2_name) - logger.info(msg) results.add_to_summary(0, "-") - results.add_to_summary(1, msg) + results.record_action(msg) results.add_to_summary(0, "-") os_utils.create_network_association( neutron_client, bgpvpn_id, network_2_id) @@ -203,9 +200,8 @@ def main(): expected="FAIL", timeout=30) msg = ("Update VPN with eRT=iRT ...") - logger.info(msg) results.add_to_summary(0, "-") - results.add_to_summary(1, msg) + results.record_action(msg) results.add_to_summary(0, "-") kwargs = {"import_targets": TESTCASE_CONFIG.targets1, "export_targets": TESTCASE_CONFIG.targets1, -- cgit 1.2.3-korg