From 09210b41c07fd42e89c63cf5a402d9dcd9a812a5 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 9 Feb 2016 16:01:13 +0200 Subject: add more simulation tests --- .../unit_tests/functional_tests/stl_basic_tests.py | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'scripts/automation/regression') diff --git a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py index 51dccd98..e55fa804 100644 --- a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py +++ b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py @@ -116,7 +116,21 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): finally: os.unlink(output_cap) - + + def run_py_profile_path (self, profile, options,silent = False, do_no_remove=False,compare =True): + output_cap = "a.pcap" + input_file = os.path.join('stl/profiles/', profile) + golden_file = os.path.join('exp',os.path.basename(profile).split('.')[0]+'.pcap'); + try: + rc = self.run_sim(input_file, output_cap, options, silent) + assert_equal(rc, True) + if compare: + self.compare_caps(output_cap, golden_file) + finally: + if not do_no_remove: + os.unlink(output_cap) + + # test for IMIX def test_imix (self): @@ -130,6 +144,21 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): def test_tuple_gen (self): self.golden_run("basic_tuple_gen", "imix_tuple_gen", "-m 50kpps --limit 500 --cores 8", silent = False) + def test_all_profiles (self): + p=[ + ["udp_1pkt_1mac_override.py","-m 1 -l 50",True], + ["syn_attack.py","-m 1 -l 50",False], # can't compare random now + ["udp_1pkt_1mac.py","-m 1 -l 50",True], + ["udp_1pkt_mac.py","-m 1 -l 50",True], + ["udp_1pkt.py","-m 1 -l 50",True], + ["udp_1pkt_tuple_gen.py","-m 1 -l 50",True], + ["udp_rand_len_9k.py","-m 1 -l 50",False] # can't do the compare + ]; + + for obj in p: + self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=False) + + # valgrind tests def test_valgrind_various_profiles (self): -- cgit 1.2.3-korg