From e1f34b0c019b9771ace1d6c723d4d84658be5cd8 Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:29:08 +0100 Subject: smoketest: T5160: Deduplicate nftables verify functions to testcase class, remove obsolete imports (cherry picked from commit bc9ccaeda54279022b73a806fa8aa77c523fbecc) --- smoketest/scripts/cli/test_system_conntrack.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'smoketest/scripts/cli/test_system_conntrack.py') diff --git a/smoketest/scripts/cli/test_system_conntrack.py b/smoketest/scripts/cli/test_system_conntrack.py index 02473da95..950619e1a 100755 --- a/smoketest/scripts/cli/test_system_conntrack.py +++ b/smoketest/scripts/cli/test_system_conntrack.py @@ -21,7 +21,6 @@ import unittest from base_vyostest_shim import VyOSUnitTestSHIM from vyos.firewall import find_nftables_rule -from vyos.utils.process import cmd from vyos.utils.file import read_file base_path = ['system', 'conntrack'] @@ -35,17 +34,6 @@ class TestSystemConntrack(VyOSUnitTestSHIM.TestCase): self.cli_delete(base_path) self.cli_commit() - def verify_nftables(self, nftables_search, table, inverse=False, args=''): - nftables_output = cmd(f'sudo nft {args} list table {table}') - - for search in nftables_search: - matched = False - for line in nftables_output.split("\n"): - if all(item in line for item in search): - matched = True - break - self.assertTrue(not matched if inverse else matched, msg=search) - def test_conntrack_options(self): conntrack_config = { 'net.netfilter.nf_conntrack_expect_max' : { -- cgit v1.2.3