diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-08-16 07:03:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 07:03:04 +0100 |
commit | 9e740c4339d215ff7332d22d12d40f4acd75d4c8 (patch) | |
tree | b6840aa64850b1f0c9aaa30799d77250b3c9474a /smoketest | |
parent | cb1eec686cfe7b64142980963d44ae47a4eb66cc (diff) | |
parent | 663e468de2b431f771534b4e3a2d00a5924b98fe (diff) | |
download | vyos-1x-9e740c4339d215ff7332d22d12d40f4acd75d4c8.tar.gz vyos-1x-9e740c4339d215ff7332d22d12d40f4acd75d4c8.zip |
Merge pull request #3987 from natali-rs1985/T6649-current
ipoe_server: T6649: Accel-ppp separate vlan-mon from listen interfaces
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_service_ipoe-server.py | 32 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_service_pppoe-server.py | 7 |
2 files changed, 39 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_ipoe-server.py b/smoketest/scripts/cli/test_service_ipoe-server.py index 5f1cf9ad1..be03179bf 100755 --- a/smoketest/scripts/cli/test_service_ipoe-server.py +++ b/smoketest/scripts/cli/test_service_ipoe-server.py @@ -21,6 +21,7 @@ from collections import OrderedDict from base_accel_ppp_test import BasicAccelPPPTest from vyos.configsession import ConfigSessionError from vyos.utils.process import cmd +from vyos.template import range_to_regex from configparser import ConfigParser from configparser import RawConfigParser @@ -228,6 +229,37 @@ delegate={delegate_1_prefix},{delegate_mask},name={pool_name} delegate={delegate_2_prefix},{delegate_mask},name={pool_name}""" self.assertIn(pool_config, config) + def test_ipoe_server_vlan(self): + vlans = ['100', '200', '300-310'] + + # Test configuration of local authentication for PPPoE server + self.basic_config() + # cannot use "client-subnet" option with "vlan" option + # have to delete it + self.delete(['interface', interface, 'client-subnet']) + self.cli_commit() + + self.set(['interface', interface, 'vlan-mon']) + + # cannot use option "vlan-mon" if no "vlan" set + with self.assertRaises(ConfigSessionError): + self.cli_commit() + + for vlan in vlans: + self.set(['interface', interface, 'vlan', vlan]) + + # commit changes + self.cli_commit() + + # Validate configuration values + conf = ConfigParser(allow_no_value=True, delimiters='=', strict=False) + conf.read(self._config_file) + tmp = range_to_regex(vlans) + self.assertIn(f're:^{interface}\.{tmp}$', conf['ipoe']['interface']) + + tmp = ','.join(vlans) + self.assertIn(f'{interface},{tmp}', conf['ipoe']['vlan-mon']) + @unittest.skip("PPP is not a part of IPoE") def test_accel_ppp_options(self): pass diff --git a/smoketest/scripts/cli/test_service_pppoe-server.py b/smoketest/scripts/cli/test_service_pppoe-server.py index 34e45a81a..8add5ee6c 100755 --- a/smoketest/scripts/cli/test_service_pppoe-server.py +++ b/smoketest/scripts/cli/test_service_pppoe-server.py @@ -21,6 +21,7 @@ from base_accel_ppp_test import BasicAccelPPPTest from configparser import ConfigParser from vyos.utils.file import read_file from vyos.template import range_to_regex +from vyos.configsession import ConfigSessionError local_if = ['interfaces', 'dummy', 'dum667'] ac_name = 'ACN' @@ -133,6 +134,12 @@ class TestServicePPPoEServer(BasicAccelPPPTest.TestCase): # Test configuration of local authentication for PPPoE server self.basic_config() + self.set(['interface', interface, 'vlan-mon']) + + # cannot use option "vlan-mon" if no "vlan" set + with self.assertRaises(ConfigSessionError): + self.cli_commit() + for vlan in vlans: self.set(['interface', interface, 'vlan', vlan]) |