diff options
author | Christian Breunig <christian@breunig.cc> | 2024-10-07 17:22:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-07 17:22:17 +0200 |
commit | e8c65fafc1ea5c8682b717302a876fcff2067f3d (patch) | |
tree | 804002269ae2dcfa2f0225ded4bc473f6c6d8a58 /smoketest/scripts/cli/base_vyostest_shim.py | |
parent | 09a4b463bf1c4b87832039f2c1d868a6c1d9c4f9 (diff) | |
parent | 9c291d115d987cc635d1ef56898119c7d2bdfee6 (diff) | |
download | vyos-1x-e8c65fafc1ea5c8682b717302a876fcff2067f3d.tar.gz vyos-1x-e8c65fafc1ea5c8682b717302a876fcff2067f3d.zip |
Merge pull request #3938 from talmakion/feature/T6430-local-pbr
pbr: T6430: Local IP rules targeting VRFs by name as well as route table IDs
Diffstat (limited to 'smoketest/scripts/cli/base_vyostest_shim.py')
-rw-r--r-- | smoketest/scripts/cli/base_vyostest_shim.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_vyostest_shim.py b/smoketest/scripts/cli/base_vyostest_shim.py index 940306ac3..a383e596c 100644 --- a/smoketest/scripts/cli/base_vyostest_shim.py +++ b/smoketest/scripts/cli/base_vyostest_shim.py @@ -147,6 +147,18 @@ class VyOSUnitTestSHIM: break self.assertTrue(not matched if inverse else matched, msg=search) + # Verify ip rule output + def verify_rules(self, rules_search, inverse=False, addr_family='inet'): + rule_output = cmd(f'ip -family {addr_family} rule show') + + for search in rules_search: + matched = False + for line in rule_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) + # standard construction; typing suggestion: https://stackoverflow.com/a/70292317 def ignore_warning(warning: Type[Warning]): import warnings |