summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_ipoe-server.py
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2024-08-15 13:20:31 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2024-08-15 19:12:37 +0300
commit663e468de2b431f771534b4e3a2d00a5924b98fe (patch)
treef9f1f890dc859480a0e9abdeeae14c31c334a120 /smoketest/scripts/cli/test_service_ipoe-server.py
parente229d7498cc77298c79af9811a742f3ad54edf4c (diff)
downloadvyos-1x-663e468de2b431f771534b4e3a2d00a5924b98fe.tar.gz
vyos-1x-663e468de2b431f771534b4e3a2d00a5924b98fe.zip
T6649: Accel-ppp separate vlan-mon from listen interfaces
Diffstat (limited to 'smoketest/scripts/cli/test_service_ipoe-server.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_ipoe-server.py32
1 files changed, 32 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