diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2024-08-21 16:32:16 +0000 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-08-23 21:01:02 +0200 |
commit | 2947e7f2a5a48af5cb85e440fe5ef83c0e0b498a (patch) | |
tree | 9589a6fb6f9a90d412e864cb436ea595d3ae4bb3 /smoketest/scripts/cli/test_system_option.py | |
parent | 94908b75bbce9eb2d867e8347901ae23ca6d5b4e (diff) | |
download | vyos-1x-2947e7f2a5a48af5cb85e440fe5ef83c0e0b498a.tar.gz vyos-1x-2947e7f2a5a48af5cb85e440fe5ef83c0e0b498a.zip |
T6672: Fix system option ssh-client source-interfacemergify/bp/sagitta/pr-4000
Fix for system option ssh-client source-interface
For the `verify_source_interface` the key `ifname` if required
(cherry picked from commit f453b33a6056de8fc5145ca9e680361fbce68348)
Diffstat (limited to 'smoketest/scripts/cli/test_system_option.py')
-rwxr-xr-x | smoketest/scripts/cli/test_system_option.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_system_option.py b/smoketest/scripts/cli/test_system_option.py index c6f48bfc6..5e2827724 100755 --- a/smoketest/scripts/cli/test_system_option.py +++ b/smoketest/scripts/cli/test_system_option.py @@ -80,5 +80,19 @@ class TestSystemOption(VyOSUnitTestSHIM.TestCase): self.assertEqual(sysctl_read('net.ipv4.neigh.default.gc_thresh2'), gc_thresh2) self.assertEqual(sysctl_read('net.ipv4.neigh.default.gc_thresh3'), gc_thresh3) + def test_ssh_client_options(self): + loopback = 'lo' + ssh_client_opt_file = '/etc/ssh/ssh_config.d/91-vyos-ssh-client-options.conf' + + self.cli_set(['system', 'option', 'ssh-client', 'source-interface', loopback]) + self.cli_commit() + + tmp = read_file(ssh_client_opt_file) + self.assertEqual(tmp, f'BindInterface {loopback}') + + self.cli_delete(['system', 'option']) + self.cli_commit() + self.assertFalse(os.path.exists(ssh_client_opt_file)) + if __name__ == '__main__': - unittest.main(verbosity=2, failfast=True) + unittest.main(verbosity=2) |