diff options
author | 2016-02-09 16:01:13 +0200 | |
---|---|---|
committer | 2016-02-09 16:01:13 +0200 | |
commit | 09210b41c07fd42e89c63cf5a402d9dcd9a812a5 (patch) | |
tree | 13c9edd3a0b860bb8eca94067339866c5c936bdb /scripts/automation/regression | |
parent | 1ab9a175ca7d49f7ae843d46a76c36baa16ff39d (diff) |
add more simulation tests
Diffstat (limited to 'scripts/automation/regression')
-rw-r--r-- | scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py | 31 |
1 files changed, 30 insertions, 1 deletions
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): |