diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-12 08:02:58 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-12 08:02:58 +0200 |
commit | f0f7d0658a7b48f7885916cd27ef499c780c3f4f (patch) | |
tree | 6da991579c72878a41ab66ea23780f0da344d0e4 /smoketest | |
parent | 8fab454559a8d8791cbb24b18f23634f66e8064b (diff) | |
download | vyos-1x-f0f7d0658a7b48f7885916cd27ef499c780c3f4f.tar.gz vyos-1x-f0f7d0658a7b48f7885916cd27ef499c780c3f4f.zip |
smoketest: tftp-server: listen on dummy interface address rather then loopback
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_service_tftp-server.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/smoketest/scripts/cli/test_service_tftp-server.py b/smoketest/scripts/cli/test_service_tftp-server.py index 5ffb61192..92333392a 100755 --- a/smoketest/scripts/cli/test_service_tftp-server.py +++ b/smoketest/scripts/cli/test_service_tftp-server.py @@ -28,32 +28,36 @@ from vyos.validate import is_ipv6 PROCESS_NAME = 'in.tftpd' base_path = ['service', 'tftp-server'] +dummy_if_path = ['interfaces', 'dummy', 'dum69'] +address_ipv4 = '192.0.2.1' +address_ipv6 = '2001:db8::1' class TestServiceTFTPD(unittest.TestCase): def setUp(self): self.session = ConfigSession(os.getpid()) - self.session.delete(base_path) + self.session.set(dummy_if_path + ['address', address_ipv4 + '/32']) + self.session.set(dummy_if_path + ['address', address_ipv6 + '/128']) def tearDown(self): self.session.delete(base_path) + self.session.delete(dummy_if_path) self.session.commit() del self.session - def test_tftpd_single(self): + def test_01_tftpd_single(self): directory = '/tmp' - address = '127.0.0.1' port = '69' # default port self.session.set(base_path + ['allow-upload']) self.session.set(base_path + ['directory', directory]) - self.session.set(base_path + ['listen-address', address]) + self.session.set(base_path + ['listen-address', address_ipv4]) # commit changes self.session.commit() config = read_file('/etc/default/tftpd0') # verify listen IP address - self.assertIn(f'{address}:{port} -4', config) + self.assertIn(f'{address_ipv4}:{port} -4', config) # verify directory self.assertIn(directory, config) # verify upload @@ -62,9 +66,9 @@ class TestServiceTFTPD(unittest.TestCase): # Check for running process self.assertTrue(process_named_running(PROCESS_NAME)) - def test_tftpd_multi(self): + def test_02_tftpd_multi(self): directory = '/tmp' - address = ['127.0.0.1', '::1'] + address = [address_ipv4, address_ipv6] port = '70' self.session.set(base_path + ['directory', directory]) |