summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
Diffstat (limited to 'smoketest/scripts/cli')
-rw-r--r--smoketest/scripts/cli/base_interfaces_test.py50
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_wireless.py31
2 files changed, 30 insertions, 51 deletions
diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py
index fd37cb2a1..0ae55a22a 100644
--- a/smoketest/scripts/cli/base_interfaces_test.py
+++ b/smoketest/scripts/cli/base_interfaces_test.py
@@ -32,23 +32,6 @@ from vyos.util import process_named_running
from vyos.validate import is_intf_addr_assigned
from vyos.validate import is_ipv6_link_local
-def read_mirror_rule(interfaces):
- Success = 0
- for interface in interfaces:
- get_tc_cmd = 'tc -j qdisc'
- tmp = cmd(get_tc_cmd, shell=True)
- data = json.loads(tmp)
- for rule in data:
- dev = rule['dev']
- handle = rule['handle']
- kind = rule['kind']
- if dev == interface and handle == "ffff:" and kind == "ingress":
- Success+=1
- elif dev == interface and handle == "1:" and kind == "prio":
- Success+=1
- return Success
-
-
dhcp6c_config_file = '/run/dhcp6c/dhcp6c.{}.conf'
def get_dhcp6c_config_value(interface, key):
tmp = read_file(dhcp6c_config_file.format(interface))
@@ -100,39 +83,6 @@ class BasicInterfaceTest:
self.session.commit()
del self.session
- def test_mirror(self):
- # Test is disabled as it contains hardcoded bond interfaces which will
- # screw up all kinds of live deployments.
- return None
-
- if self._test_mirror:
- # Create test dependency interface
- self.session.set(['interfaces','dummy','dum0'])
- self.session.set(['interfaces','dummy','dum1'])
- self.session.set(['interfaces','bonding','bond1','member','interface','dum0'])
- self.session.set(['interfaces','bonding','bond1','member','interface','dum1'])
-
- # ^- WHY? There is self._options for that :(
-
- Success = 0
- i = 0
- # Check the two-way mirror rules of ingress and egress
- for interface in self._interfaces:
- self.session.set(self._base_path + [interface, 'mirror', 'ingress', 'bond1'])
- self.session.set(self._base_path + [interface, 'mirror', 'egress', 'bond1'])
- i+=1
- self.session.commit()
- # Parse configuration
- Success = read_mirror_rule(self._interfaces)
- if Success == i*2:
- self.assertTrue(True)
- else:
- self.assertTrue(False)
- i=0
- self.session.delete(['interfaces','dummy'])
- self.session.delete(['interfaces','bonding'])
-
-
def test_add_description(self):
"""
Check if description can be added to interface
diff --git a/smoketest/scripts/cli/test_interfaces_wireless.py b/smoketest/scripts/cli/test_interfaces_wireless.py
index def989e76..70cb5190c 100755
--- a/smoketest/scripts/cli/test_interfaces_wireless.py
+++ b/smoketest/scripts/cli/test_interfaces_wireless.py
@@ -18,9 +18,10 @@ import os
import re
import unittest
-from vyos.configsession import ConfigSessionError
from base_interfaces_test import BasicInterfaceTest
+from glob import glob
+from vyos.configsession import ConfigSessionError
from vyos.util import process_named_running
from vyos.util import check_kmod
from vyos.util import read_file
@@ -207,6 +208,34 @@ class WirelessInterfaceTest(BasicInterfaceTest.BaseTest):
# Check for running process
self.assertTrue(process_named_running('hostapd'))
+ def test_access_point_bridge(self):
+ interface = 'wlan0'
+ ssid = 'VyOS-Test'
+ bridge = 'br42477'
+
+ # We need a bridge where we can hook our access-point interface to
+ bridge_path = ['interfaces', 'bridge', bridge]
+ self.session.set(bridge_path + ['member', 'interface', interface])
+
+ self.session.set(self._base_path + [interface, 'ssid', ssid])
+ self.session.set(self._base_path + [interface, 'country-code', 'se'])
+ self.session.set(self._base_path + [interface, 'type', 'access-point'])
+
+ self.session.commit()
+
+ # Check for running process
+ self.assertTrue(process_named_running('hostapd'))
+
+ bridge_members = []
+ for tmp in glob(f'/sys/class/net/{bridge}/lower_*'):
+ bridge_members.append(os.path.basename(tmp).replace('lower_', ''))
+
+ self.assertIn(interface, bridge_members)
+
+ self.session.delete(bridge_path)
+ self.session.delete(self._base_path)
+ self.session.commit()
+
if __name__ == '__main__':
check_kmod('mac80211_hwsim')
unittest.main()