From defde0f87067eb473660794cbd4a2da69fdd191d Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Thu, 6 Dec 2018 07:46:13 -0800 Subject: Tests: Cleanup @skip decorator. The runnning environment is static as of module load time, so only evalute the conditions once at module load time. Track-by: VPP-1518 Change-Id: I73b0d17ae1ff90789e70307f168d43921829aec8 Signed-off-by: Paul Vinciguerra --- test/framework.py | 16 ++++++--- test/run_tests.py | 2 +- test/test_acl_plugin_conns.py | 2 +- test/test_bfd.py | 70 ++++++++++++++++++++-------------------- test/test_bier.py | 16 ++++----- test/test_container.py | 2 +- test/test_flowprobe.py | 8 ++--- test/test_gbp.py | 4 +-- test/test_jvpp.py | 2 +- test/test_l2bd_multi_instance.py | 2 +- test/test_nat.py | 20 ++++++------ test/test_reassembly.py | 2 +- test/test_vapi.py | 4 +-- test/test_vcl.py | 16 ++++----- test/test_vom.py | 2 +- test/test_vxlan_gpe.py | 2 +- 16 files changed, 89 insertions(+), 81 deletions(-) diff --git a/test/framework.py b/test/framework.py index a0dd538e5b0..e3cf68d4aa5 100644 --- a/test/framework.py +++ b/test/framework.py @@ -132,23 +132,31 @@ def pump_output(testclass): # flag will take care of properly terminating the loop -def is_skip_aarch64_set(): +def _is_skip_aarch64_set(): return os.getenv('SKIP_AARCH64', 'n').lower() in ('yes', 'y', '1') +is_skip_aarch64_set = _is_skip_aarch64_set() -def is_platform_aarch64(): + +def _is_platform_aarch64(): return platform.machine() == 'aarch64' +is_platform_aarch64 = _is_platform_aarch64() + -def running_extended_tests(): +def _running_extended_tests(): s = os.getenv("EXTENDED_TESTS", "n") return True if s.lower() in ("y", "yes", "1") else False +running_extended_tests = _running_extended_tests() -def running_on_centos(): + +def _running_on_centos(): os_id = os.getenv("OS_ID", "") return True if "centos" in os_id.lower() else False +running_on_centos = _running_on_centos + class KeepAliveReporter(object): """ diff --git a/test/run_tests.py b/test/run_tests.py index 0af57ac46b8..2940f9e3608 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -782,7 +782,7 @@ if __name__ == '__main__': print("%s out of %s tests match specified filters" % ( tests_amount, tests_amount + cb.filtered.countTestCases())) - if not running_extended_tests(): + if not running_extended_tests: print("Not running extended tests (some tests will be skipped)") attempts = retries + 1 diff --git a/test/test_acl_plugin_conns.py b/test/test_acl_plugin_conns.py index ea643e04709..d3c8581396d 100644 --- a/test/test_acl_plugin_conns.py +++ b/test/test_acl_plugin_conns.py @@ -124,7 +124,7 @@ class Conn(L4_Conn): return new_rule -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class ACLPluginConnTestCase(VppTestCase): """ ACL plugin connection-oriented extended testcases """ diff --git a/test/test_bfd.py b/test/test_bfd.py index 635e7e12a76..f40bcc65c22 100644 --- a/test/test_bfd.py +++ b/test/test_bfd.py @@ -47,7 +47,7 @@ class AuthKeyFactory(object): conf_key_id=conf_key_id, key=key) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDAPITestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD) - API""" @@ -302,7 +302,7 @@ class BFDAPITestCase(VppTestCase): self.assertFalse(echo_source.have_usable_ip6) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDTestSession(object): """ BFD session as seen from test framework side """ @@ -664,7 +664,7 @@ def wait_for_bfd_packet(test, timeout=1, pcap_time_min=None): return p -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFD4TestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD)""" @@ -748,7 +748,7 @@ class BFD4TestCase(VppTestCase): bfd_session_up(self) bfd_session_down(self) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_hold_up(self): """ hold BFD session up """ bfd_session_up(self) @@ -758,7 +758,7 @@ class BFD4TestCase(VppTestCase): self.assert_equal(len(self.vapi.collect_events()), 0, "number of bfd events") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_slow_timer(self): """ verify slow periodic control frames while session down """ packet_count = 3 @@ -773,7 +773,7 @@ class BFD4TestCase(VppTestCase): time_diff, 0.70, 1.05, "time between slow packets") prev_packet = next_packet - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_zero_remote_min_rx(self): """ no packets when zero remote required min rx interval """ bfd_session_up(self) @@ -798,7 +798,7 @@ class BFD4TestCase(VppTestCase): self.assert_equal( len(self.vapi.collect_events()), 0, "number of bfd events") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_conn_down(self): """ verify session goes down after inactivity """ bfd_session_up(self) @@ -808,7 +808,7 @@ class BFD4TestCase(VppTestCase): e = self.vapi.wait_for_event(1, "bfd_udp_session_details") verify_event(self, e, expected_state=BFDState.down) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_large_required_min_rx(self): """ large remote required min rx interval """ bfd_session_up(self) @@ -838,7 +838,7 @@ class BFD4TestCase(VppTestCase): break self.assert_equal(count, 0, "number of packets received") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_immediate_remote_min_rx_reduction(self): """ immediately honor remote required min rx reduction """ self.vpp_session.remove_vpp_config() @@ -871,7 +871,7 @@ class BFD4TestCase(VppTestCase): "time between BFD packets") reference_packet = p - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_modify_req_min_rx_double(self): """ modify session - double required min rx """ bfd_session_up(self) @@ -901,7 +901,7 @@ class BFD4TestCase(VppTestCase): self.assert_in_range(time_to_event, .9 * timeout, 1.1 * timeout, "session timeout") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_modify_req_min_rx_halve(self): """ modify session - halve required min rx """ self.vpp_session.modify_parameters( @@ -944,7 +944,7 @@ class BFD4TestCase(VppTestCase): "time before bfd session goes down") verify_event(self, e, expected_state=BFDState.down) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_modify_detect_mult(self): """ modify detect multiplier """ bfd_session_up(self) @@ -968,7 +968,7 @@ class BFD4TestCase(VppTestCase): self.assertNotIn("P", p.sprintf("%BFD.flags%"), "Poll bit not set in BFD packet") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_queued_poll(self): """ test poll sequence queueing """ bfd_session_up(self) @@ -1034,7 +1034,7 @@ class BFD4TestCase(VppTestCase): self.assertNotIn("P", p.sprintf("%BFD.flags%"), "Poll bit set in BFD packet") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_poll_response(self): """ test correct response to control frame with poll bit set """ bfd_session_up(self) @@ -1045,7 +1045,7 @@ class BFD4TestCase(VppTestCase): self, pcap_time_min=time.time() - self.vpp_clock_offset) self.assertIn("F", final.sprintf("%BFD.flags%")) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_no_periodic_if_remote_demand(self): """ no periodic frames outside poll sequence if remote demand set """ bfd_session_up(self) @@ -1172,7 +1172,7 @@ class BFD4TestCase(VppTestCase): self.test_session.send_packet() self.assertTrue(echo_seen, "No echo packets received") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_echo_fail(self): """ session goes down if echo function fails """ bfd_session_up(self) @@ -1212,7 +1212,7 @@ class BFD4TestCase(VppTestCase): self.assert_equal(events[0].state, BFDState.down, BFDState) self.assertTrue(verified_diag, "Incorrect diagnostics code received") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_echo_stop(self): """ echo function stops if peer sets required min echo rx zero """ bfd_session_up(self) @@ -1244,7 +1244,7 @@ class BFD4TestCase(VppTestCase): events = self.vapi.collect_events() self.assert_equal(len(events), 0, "number of bfd events") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_echo_source_removed(self): """ echo function stops if echo source is removed """ bfd_session_up(self) @@ -1276,7 +1276,7 @@ class BFD4TestCase(VppTestCase): events = self.vapi.collect_events() self.assert_equal(len(events), 0, "number of bfd events") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_stale_echo(self): """ stale echo packets don't keep a session up """ bfd_session_up(self) @@ -1329,7 +1329,7 @@ class BFD4TestCase(VppTestCase): self.test_session.send_packet() self.assertTrue(timeout_ok, "Expected timeout event didn't occur") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_invalid_echo_checksum(self): """ echo packets with invalid checksum don't keep a session up """ bfd_session_up(self) @@ -1379,7 +1379,7 @@ class BFD4TestCase(VppTestCase): self.test_session.send_packet() self.assertTrue(timeout_ok, "Expected timeout event didn't occur") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_admin_up_down(self): """ put session admin-up and admin-down """ bfd_session_up(self) @@ -1417,7 +1417,7 @@ class BFD4TestCase(VppTestCase): e = self.vapi.wait_for_event(1, "bfd_udp_session_details") verify_event(self, e, expected_state=BFDState.up) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_config_change_remote_demand(self): """ configuration change while peer in demand mode """ bfd_session_up(self) @@ -1470,7 +1470,7 @@ class BFD4TestCase(VppTestCase): self.assertFalse(vpp_session.query_vpp_config()) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFD6TestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD) (IPv6) """ @@ -1551,7 +1551,7 @@ class BFD6TestCase(VppTestCase): self.test_session.send_packet() self.assert_equal(self.vpp_session.state, BFDState.up, BFDState) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_hold_up(self): """ hold BFD session up """ bfd_session_up(self) @@ -1680,7 +1680,7 @@ class BFD6TestCase(VppTestCase): self.assertFalse(vpp_session.query_vpp_config()) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDFIBTestCase(VppTestCase): """ BFD-FIB interactions (IPv6) """ @@ -1782,7 +1782,7 @@ class BFDFIBTestCase(VppTestCase): packet[IPv6].dst) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDSHA1TestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD) (SHA1 auth) """ @@ -1831,7 +1831,7 @@ class BFDSHA1TestCase(VppTestCase): bfd_key_id=self.vpp_session.bfd_key_id) bfd_session_up(self) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_hold_up(self): """ hold BFD session up """ key = self.factory.create_random_key(self) @@ -1850,7 +1850,7 @@ class BFDSHA1TestCase(VppTestCase): self.test_session.send_packet() self.assert_equal(self.vpp_session.state, BFDState.up, BFDState) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_hold_up_meticulous(self): """ hold BFD session up - meticulous auth """ key = self.factory.create_random_key( @@ -1872,7 +1872,7 @@ class BFDSHA1TestCase(VppTestCase): self.test_session.send_packet() self.assert_equal(self.vpp_session.state, BFDState.up, BFDState) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_send_bad_seq_number(self): """ session is not kept alive by msgs with bad sequence numbers""" key = self.factory.create_random_key( @@ -1935,7 +1935,7 @@ class BFDSHA1TestCase(VppTestCase): wait_for_bfd_packet(self) self.assert_equal(self.vpp_session.state, BFDState.up, BFDState) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_mismatch_auth(self): """ session is not brought down by unauthenticated msg """ key = self.factory.create_random_key(self) @@ -1950,7 +1950,7 @@ class BFDSHA1TestCase(VppTestCase): legitimate_test_session, rogue_test_session) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_mismatch_bfd_key_id(self): """ session is not brought down by msg with non-existent key-id """ key = self.factory.create_random_key(self) @@ -1970,7 +1970,7 @@ class BFDSHA1TestCase(VppTestCase): legitimate_test_session, rogue_test_session) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_mismatched_auth_type(self): """ session is not brought down by msg with wrong auth type """ key = self.factory.create_random_key(self) @@ -1987,7 +1987,7 @@ class BFDSHA1TestCase(VppTestCase): vpp_session, legitimate_test_session, rogue_test_session, {'auth_type': BFDAuthType.keyed_md5}) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_restart(self): """ simulate remote peer restart and resynchronization """ key = self.factory.create_random_key( @@ -2016,7 +2016,7 @@ class BFDSHA1TestCase(VppTestCase): bfd_session_up(self) -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDAuthOnOffTestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD) (changing auth) """ @@ -2225,7 +2225,7 @@ class BFDAuthOnOffTestCase(VppTestCase): "number of bfd events") -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class BFDCLITestCase(VppTestCase): """Bidirectional Forwarding Detection (BFD) (CLI) """ pg0 = None diff --git a/test/test_bier.py b/test/test_bier.py index cc4c9b3ea0c..93f0e36b604 100644 --- a/test/test_bier.py +++ b/test/test_bier.py @@ -178,22 +178,22 @@ class TestBier(VppTestCase): for nhr in nh_routes: nhr.remove_vpp_config() - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_midpoint_1024(self): """BIER midpoint BSL:1024""" self.bier_midpoint(BIERLength.BIER_LEN_1024, 128, 1024) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_midpoint_512(self): """BIER midpoint BSL:512""" self.bier_midpoint(BIERLength.BIER_LEN_512, 64, 512) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_midpoint_256(self): """BIER midpoint BSL:256""" self.bier_midpoint(BIERLength.BIER_LEN_256, 32, 256) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_midpoint_128(self): """BIER midpoint BSL:128""" self.bier_midpoint(BIERLength.BIER_LEN_128, 16, 128) @@ -653,22 +653,22 @@ class TestBier(VppTestCase): self.assertEqual(rx[0][IP].src, "1.1.1.1") self.assertEqual(rx[0][IP].dst, "232.1.1.2") - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_e2e_1024(self): """ BIER end-to-end BSL:1024""" self.bier_e2e(BIERLength.BIER_LEN_1024, 128, 1024) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_e2e_512(self): """ BIER end-to-end BSL:512""" self.bier_e2e(BIERLength.BIER_LEN_512, 64, 512) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_e2e_256(self): """ BIER end-to-end BSL:256""" self.bier_e2e(BIERLength.BIER_LEN_256, 32, 256) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_bier_e2e_128(self): """ BIER end-to-end BSL:128""" self.bier_e2e(BIERLength.BIER_LEN_128, 16, 128) diff --git a/test/test_container.py b/test/test_container.py index 5e38f2a192d..66b7748630f 100644 --- a/test/test_container.py +++ b/test/test_container.py @@ -21,7 +21,7 @@ class Conn(L4_Conn): pass -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class ContainerIntegrationTestCase(VppTestCase): """ Container integration extended testcases """ diff --git a/test/test_flowprobe.py b/test/test_flowprobe.py index cd6fd1c1947..bb5062755f9 100644 --- a/test/test_flowprobe.py +++ b/test/test_flowprobe.py @@ -824,7 +824,7 @@ class Datapath(MethodHolder): self.logger.info("FFP_TEST_FINISH_0002") -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class DisableIPFIX(MethodHolder): """Disable IPFIX""" @@ -865,7 +865,7 @@ class DisableIPFIX(MethodHolder): self.logger.info("FFP_TEST_FINISH_0001") -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class ReenableIPFIX(MethodHolder): """Re-enable IPFIX""" @@ -926,7 +926,7 @@ class ReenableIPFIX(MethodHolder): self.logger.info("FFP_TEST_FINISH_0001") -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class DisableFP(MethodHolder): """Disable Flowprobe feature""" @@ -966,7 +966,7 @@ class DisableFP(MethodHolder): self.logger.info("FFP_TEST_FINISH_0001") -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class ReenableFP(MethodHolder): """Re-enable Flowprobe feature""" diff --git a/test/test_gbp.py b/test/test_gbp.py index d587759fffa..9e930242026 100644 --- a/test/test_gbp.py +++ b/test/test_gbp.py @@ -1822,7 +1822,7 @@ class TestGBP(VppTestCase): self.logger.info(self.vapi.cli("sh int")) self.logger.info(self.vapi.cli("sh gbp vxlan")) - @unittest.skipIf(is_skip_aarch64_set() and is_platform_aarch64(), + @unittest.skipIf(is_skip_aarch64_set and is_platform_aarch64, "test doesn't work on aarch64") def test_gbp_learn_vlan_l2(self): """ GBP L2 Endpoint w/ VLANs""" @@ -1992,7 +1992,7 @@ class TestGBP(VppTestCase): self.pg2.unconfig_ip4() self.pg3.unconfig_ip4() - @unittest.skipIf(is_skip_aarch64_set() and is_platform_aarch64(), + @unittest.skipIf(is_skip_aarch64_set and is_platform_aarch64, "test doesn't work on aarch64") def test_gbp_learn_l3(self): """ GBP L3 Endpoint Learning """ diff --git a/test/test_jvpp.py b/test/test_jvpp.py index 595f03a3942..b716af39205 100644 --- a/test/test_jvpp.py +++ b/test/test_jvpp.py @@ -13,7 +13,7 @@ API_FILES_PATH = "japi/java" REGISTRY_JAR_PREFIX = "jvpp-registry" -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class TestJVpp(VppTestCase): """ JVPP Core Test Case """ diff --git a/test/test_l2bd_multi_instance.py b/test/test_l2bd_multi_instance.py index 04ba570c21d..18967149260 100644 --- a/test/test_l2bd_multi_instance.py +++ b/test/test_l2bd_multi_instance.py @@ -460,7 +460,7 @@ class TestL2bdMultiInst(VppTestCase): # self.vapi.cli("clear trace") self.run_verify_test() - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_l2bd_inst_05(self): """ L2BD Multi-instance test 5 - delete 5 BDs """ diff --git a/test/test_nat.py b/test/test_nat.py index 516961739b8..81aae4bd59e 100644 --- a/test/test_nat.py +++ b/test/test_nat.py @@ -2719,7 +2719,7 @@ class TestNAT44(MethodHolder): data = ipfix.decode_data_set(p.getlayer(Set)) self.verify_ipfix_addr_exhausted(data) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ipfix_max_sessions(self): """ IPFIX logging maximum session entries exceeded """ self.nat44_add_address(self.nat_addr) @@ -3698,7 +3698,7 @@ class TestNAT44(MethodHolder): self.pg1.resolve_arp() self.pg2.resolve_arp() - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_timeout(self): """ NAT44 session timeouts """ self.nat44_add_address(self.nat_addr) @@ -4260,7 +4260,7 @@ class TestNAT44EndpointDependent(MethodHolder): sessions = self.vapi.nat44_user_session_dump(server.ip4n, 0) self.assertEqual(len(sessions), 0) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_static_lb_multi_clients(self): """ NAT44 local service load balancing - multiple clients""" @@ -5853,7 +5853,7 @@ class TestNAT44EndpointDependent(MethodHolder): self.logger.error(ppp("Unexpected or invalid packet:", p)) raise - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_timeout(self): """ NAT44 session timeouts """ self.nat44_add_address(self.nat_addr) @@ -5895,7 +5895,7 @@ class TestNAT44EndpointDependent(MethodHolder): nsessions = nsessions + user.nsessions self.assertLess(nsessions, 2 * max_sessions) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_rst_timeout(self): """ NAT44 session RST timeouts """ self.nat44_add_address(self.nat_addr) @@ -5931,7 +5931,7 @@ class TestNAT44EndpointDependent(MethodHolder): self.assertEqual(users[0].ip_address, self.pg0.remote_ip4n) self.assertEqual(users[0].nsessions, 1) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_limit_per_user(self): """ Maximum sessions per user limit """ self.nat44_add_address(self.nat_addr) @@ -6626,7 +6626,7 @@ class TestDeterministicNAT(MethodHolder): self.logger.error("TCP session termination failed") raise - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_timeout(self): """ Deterministic NAT session timeouts """ self.vapi.nat_det_add_del_map(self.pg0.remote_ip4n, @@ -6649,7 +6649,7 @@ class TestDeterministicNAT(MethodHolder): dms = self.vapi.nat_det_map_dump() self.assertEqual(0, dms[0].ses_num) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_limit_per_user(self): """ Deterministic NAT maximum sessions per user limit """ self.vapi.nat_det_add_del_map(self.pg0.remote_ip4n, @@ -7127,7 +7127,7 @@ class TestNAT64(MethodHolder): self.assertEqual(ses_num_end - ses_num_start, 3) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_session_timeout(self): """ NAT64 session timeout """ self.icmp_id_in = 1234 @@ -7788,7 +7788,7 @@ class TestNAT64(MethodHolder): addresses = self.vapi.nat64_pool_addr_dump() self.assertEqual(0, len(adresses)) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ipfix_max_bibs_sessions(self): """ IPFIX logging maximum session and BIB entries exceeded """ max_bibs = 1280 diff --git a/test/test_reassembly.py b/test/test_reassembly.py index 828c4d1a56e..353433c5558 100644 --- a/test/test_reassembly.py +++ b/test/test_reassembly.py @@ -275,7 +275,7 @@ class TestIPv4Reassembly(VppTestCase): # self.assert_packet_counter_equal( # "/err/ip4-reassembly-feature/malformed packets", 1) - @unittest.skipIf(is_skip_aarch64_set() and is_platform_aarch64(), + @unittest.skipIf(is_skip_aarch64_set and is_platform_aarch64, "test doesn't work on aarch64") def test_random(self): """ random order reassembly """ diff --git a/test/test_vapi.py b/test/test_vapi.py index 35fb8e795b3..ebd189cd7c8 100644 --- a/test/test_vapi.py +++ b/test/test_vapi.py @@ -8,7 +8,7 @@ from framework import VppTestCase, running_extended_tests, \ running_on_centos, VppTestRunner, Worker -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class VAPITestCase(VppTestCase): """ VAPI test """ @@ -41,7 +41,7 @@ class VAPITestCase(VppTestCase): "Timeout! Worker did not finish in %ss" % timeout) self.assert_equal(worker.result, 0, "Binary test return code") - @unittest.skipIf(running_on_centos(), "Centos's gcc can't compile our C++") + @unittest.skipIf(running_on_centos, "Centos's gcc can't compile our C++") def test_vapi_cpp(self): """ run C++ VAPI tests """ var = "TEST_DIR" diff --git a/test/test_vcl.py b/test/test_vcl.py index 5bdc8e9b342..34cf0e2a391 100644 --- a/test/test_vcl.py +++ b/test/test_vcl.py @@ -247,7 +247,7 @@ class LDPCutThruTestCase(VCLTestCase): super(LDPCutThruTestCase, self).tearDown() - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_cut_thru_echo(self): """ run LDP cut thru echo test """ @@ -268,7 +268,7 @@ class LDPCutThruTestCase(VCLTestCase): self.cut_thru_test("iperf3", self.server_iperf3_args, "iperf3", self.client_iperf3_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_cut_thru_uni_dir_nsock(self): """ run LDP cut thru uni-directional (multiple sockets) test """ @@ -277,7 +277,7 @@ class LDPCutThruTestCase(VCLTestCase): "sock_test_client", self.client_uni_dir_nsock_test_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_cut_thru_bi_dir_nsock(self): """ run LDP cut thru bi-directional (multiple sockets) test """ @@ -581,7 +581,7 @@ class LDPIpv6CutThruTestCase(VCLTestCase): "sock_test_client", self.client_ipv6_echo_test_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_ipv6_cut_thru_iperf3(self): """ run LDP IPv6 cut thru iperf3 test """ @@ -597,7 +597,7 @@ class LDPIpv6CutThruTestCase(VCLTestCase): self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args, "iperf3", self.client_ipv6_iperf3_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_ipv6_cut_thru_uni_dir_nsock(self): """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """ @@ -606,7 +606,7 @@ class LDPIpv6CutThruTestCase(VCLTestCase): "sock_test_client", self.client_ipv6_uni_dir_nsock_test_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_ldp_ipv6_cut_thru_bi_dir_nsock(self): """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """ @@ -652,7 +652,7 @@ class VCLIpv6CutThruTestCase(VCLTestCase): "vcl_test_client", self.client_ipv6_echo_test_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_vcl_ipv6_cut_thru_uni_dir_nsock(self): """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """ @@ -661,7 +661,7 @@ class VCLIpv6CutThruTestCase(VCLTestCase): "vcl_test_client", self.client_ipv6_uni_dir_nsock_test_args) - @unittest.skipUnless(running_extended_tests(), "part of extended tests") + @unittest.skipUnless(running_extended_tests, "part of extended tests") def test_vcl_ipv6_cut_thru_bi_dir_nsock(self): """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """ diff --git a/test/test_vom.py b/test/test_vom.py index 6aba555a9c9..222d72c1238 100644 --- a/test/test_vom.py +++ b/test/test_vom.py @@ -8,7 +8,7 @@ from framework import VppTestCase, running_extended_tests, \ VppTestRunner, Worker -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class VOMTestCase(VppTestCase): """ VPP Object Model Test """ diff --git a/test/test_vxlan_gpe.py b/test/test_vxlan_gpe.py index cf24652a257..7c2df4cf38a 100644 --- a/test/test_vxlan_gpe.py +++ b/test/test_vxlan_gpe.py @@ -12,7 +12,7 @@ from scapy.layers.vxlan import VXLAN from scapy.utils import atol -@unittest.skipUnless(running_extended_tests(), "part of extended tests") +@unittest.skipUnless(running_extended_tests, "part of extended tests") class TestVxlanGpe(BridgeDomain, VppTestCase): """ VXLAN-GPE Test Case """ -- cgit 1.2.3-korg