diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-06-02 14:42:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-02 14:42:26 +0100 |
| commit | e238afbd6bc272b02b426f1b16fe8d16f6069c05 (patch) | |
| tree | 187e47c095186bcb27873851df99dfe5497b530d /smoketest/scripts/cli | |
| parent | 09240f799565f12a13de6f718e36fa6165d9e865 (diff) | |
| parent | 960e730bdde2f3561aa3cff8941e2f9db8eb32d8 (diff) | |
| download | vyos-1x-e238afbd6bc272b02b426f1b16fe8d16f6069c05.tar.gz vyos-1x-e238afbd6bc272b02b426f1b16fe8d16f6069c05.zip | |
Merge pull request #5236 from c-po/nat66
nat: T8939: fix KeyError: 'group' exception
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_nat66.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_nat66.py b/smoketest/scripts/cli/test_nat66.py index 8bec2f998..9072e78dd 100755 --- a/smoketest/scripts/cli/test_nat66.py +++ b/smoketest/scripts/cli/test_nat66.py @@ -110,11 +110,13 @@ class TestNAT66(VyOSUnitTestSHIM.TestCase): destination_address = 'fc00::1' translation_address = 'fc01::1' source_address = 'fc02::1' - self.cli_set(dst_path + ['rule', '1', 'inbound-interface', 'name', 'eth1']) + in_interface = 'eth1' + + self.cli_set(dst_path + ['rule', '1', 'inbound-interface', 'name', in_interface]) self.cli_set(dst_path + ['rule', '1', 'destination', 'address', destination_address]) self.cli_set(dst_path + ['rule', '1', 'translation', 'address', translation_address]) - self.cli_set(dst_path + ['rule', '2', 'inbound-interface', 'name', 'eth1']) + self.cli_set(dst_path + ['rule', '2', 'inbound-interface', 'name', in_interface]) self.cli_set(dst_path + ['rule', '2', 'destination', 'address', destination_address]) self.cli_set(dst_path + ['rule', '2', 'source', 'address', source_address]) self.cli_set(dst_path + ['rule', '2', 'exclude']) @@ -123,10 +125,19 @@ class TestNAT66(VyOSUnitTestSHIM.TestCase): self.cli_commit() nftables_search = [ - ['iifname "eth1"', 'ip6 daddr fc00::1', 'dnat to fc01::1'], - ['iifname "eth1"', 'ip6 saddr fc02::1', 'ip6 daddr fc00::1', 'return'] + [f'iifname "{in_interface}"', 'ip6 daddr fc00::1', 'dnat to fc01::1'], + [f'iifname "{in_interface}"', 'ip6 saddr fc02::1', 'ip6 daddr fc00::1', 'return'] ] + self.verify_nftables(nftables_search, 'ip6 vyos_nat') + # T8939 - remove inbound-interface name + self.cli_delete(dst_path + ['rule', '2', 'inbound-interface', 'name']) + self.cli_commit() + + nftables_search = [ + [f'iifname "{in_interface}"', 'ip6 daddr fc00::1', 'dnat to fc01::1'], + ['ip6 saddr fc02::1', 'ip6 daddr fc00::1', 'return'] + ] self.verify_nftables(nftables_search, 'ip6 vyos_nat') def test_destination_nat66_protocol(self): |
