summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-11-19 21:47:31 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-11-20 14:55:03 +0000
commit30bbf2278f2b30d4cb67331292c27d09f9a81bf0 (patch)
tree040497c258d79dfd0828874eaaf21dda8dbfbd07 /smoketest
parentf9b1323a1464af2da539bf279bec77fdea771b0c (diff)
downloadvyos-1x-30bbf2278f2b30d4cb67331292c27d09f9a81bf0.tar.gz
vyos-1x-30bbf2278f2b30d4cb67331292c27d09f9a81bf0.zip
dhcp-client: T5760: add CLI option to pass user-class parameter
Example: set interfaces ethernet eth0 dhcp-options user-class VyOS or set interfaces ethernet eth0 dhcp-options user-class 56:79:4f:53 (cherry picked from commit 260645d0c6ff078cc89601f3a586195902f9c18e)
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index 81240f78b..6862207e3 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -162,6 +162,7 @@ class BasicInterfaceTest:
distance = '100'
hostname = 'vyos'
vendor_class_id = 'vyos-vendor'
+ user_class = 'vyos'
for interface in self._interfaces:
for option in self._options.get(interface, []):
@@ -172,6 +173,7 @@ class BasicInterfaceTest:
self.cli_set(self._base_path + [interface, 'dhcp-options', 'default-route-distance', distance])
self.cli_set(self._base_path + [interface, 'dhcp-options', 'host-name', hostname])
self.cli_set(self._base_path + [interface, 'dhcp-options', 'vendor-class-id', vendor_class_id])
+ self.cli_set(self._base_path + [interface, 'dhcp-options', 'user-class', user_class])
self.cli_commit()
@@ -186,6 +188,7 @@ class BasicInterfaceTest:
self.assertIn(f'send host-name "{hostname}";', dhclient_config)
self.assertIn(f'send dhcp-client-identifier "{client_id}";', dhclient_config)
self.assertIn(f'send vendor-class-identifier "{vendor_class_id}";', dhclient_config)
+ self.assertIn(f'send user-class "{user_class}";', dhclient_config)
# and the commandline has the appropriate options
cmdline = read_file(f'/proc/{dhclient_pid}/cmdline')