summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_pppoe.py4
-rwxr-xr-xsmoketest/scripts/cli/test_service_webproxy.py31
-rwxr-xr-xsmoketest/scripts/cli/test_system_login.py13
3 files changed, 40 insertions, 8 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_pppoe.py b/smoketest/scripts/cli/test_interfaces_pppoe.py
index ec256cb43..dc63a14a0 100755
--- a/smoketest/scripts/cli/test_interfaces_pppoe.py
+++ b/smoketest/scripts/cli/test_interfaces_pppoe.py
@@ -45,7 +45,7 @@ def get_dhcp6c_config_value(interface, key):
class PPPoEInterfaceTest(unittest.TestCase):
def setUp(self):
self.session = ConfigSession(os.getpid())
- self._interfaces = ['pppoe0', 'pppoe50']
+ self._interfaces = ['pppoe10', 'pppoe20', 'pppoe30']
self._source_interface = 'eth0'
def tearDown(self):
@@ -155,7 +155,7 @@ class PPPoEInterfaceTest(unittest.TestCase):
# after the PPP interface gets a link to the ISP - but we can see if
# it would be started by the scripts
tmp = read_file(f'/etc/ppp/ipv6-up.d/1000-vyos-pppoe-{interface}')
- tmp = re.findall(f'systemctl start dhcp6c@{interface}.service', tmp)
+ tmp = re.findall(f'systemctl restart dhcp6c@{interface}.service', tmp)
self.assertTrue(tmp)
if __name__ == '__main__':
diff --git a/smoketest/scripts/cli/test_service_webproxy.py b/smoketest/scripts/cli/test_service_webproxy.py
index 01716944d..ff7866a9a 100755
--- a/smoketest/scripts/cli/test_service_webproxy.py
+++ b/smoketest/scripts/cli/test_service_webproxy.py
@@ -173,7 +173,36 @@ class TestServiceWebProxy(unittest.TestCase):
# Check for running process
self.assertTrue(process_named_running(PROCESS_NAME))
- def test_04_basic_squidguard(self):
+ def test_04_cache_peer(self):
+ self.session.set(base_path + ['listen-address', listen_ip])
+
+ cache_peers = {
+ 'foo' : '192.0.2.1',
+ 'bar' : '192.0.2.2',
+ 'baz' : '192.0.2.3',
+ }
+ for peer in cache_peers:
+ self.session.set(base_path + ['cache-peer', peer, 'address', cache_peers[peer]])
+ if peer == 'baz':
+ self.session.set(base_path + ['cache-peer', peer, 'type', 'sibling'])
+
+ # commit changes
+ self.session.commit()
+
+ config = read_file(PROXY_CONF)
+ self.assertIn('never_direct allow all', config)
+
+ for peer in cache_peers:
+ address = cache_peers[peer]
+ if peer == 'baz':
+ self.assertIn(f'cache_peer {address} sibling 3128 0 no-query default', config)
+ else:
+ self.assertIn(f'cache_peer {address} parent 3128 0 no-query default', config)
+
+ # Check for running process
+ self.assertTrue(process_named_running(PROCESS_NAME))
+
+ def test_05_basic_squidguard(self):
default_cache = '100'
local_block = ['192.0.0.1', '10.0.0.1', 'block.vyos.net']
diff --git a/smoketest/scripts/cli/test_system_login.py b/smoketest/scripts/cli/test_system_login.py
index 48ae78ccf..d3324b8aa 100755
--- a/smoketest/scripts/cli/test_system_login.py
+++ b/smoketest/scripts/cli/test_system_login.py
@@ -19,6 +19,7 @@ import re
import platform
import unittest
+from distutils.version import LooseVersion
from platform import release as kernel_version
from subprocess import Popen, PIPE
@@ -72,11 +73,13 @@ class TestSystemLogin(unittest.TestCase):
kernel = platform.release()
kernel_config = read_file(f'/boot/config-{kernel}')
- # T2886 - RADIUS authentication - check for statically compiled
- # options (=y)
- for option in ['CONFIG_AUDIT', 'CONFIG_HAVE_ARCH_AUDITSYSCALL',
- 'CONFIG_AUDITSYSCALL', 'CONFIG_AUDIT_WATCH',
- 'CONFIG_AUDIT_TREE', 'CONFIG_AUDIT_ARCH']:
+ # T2886 - RADIUS authentication - check for statically compiled options
+ options = ['CONFIG_AUDIT', 'CONFIG_AUDITSYSCALL', 'CONFIG_AUDIT_ARCH']
+ if LooseVersion(kernel_version()) < LooseVersion('5.0'):
+ options.append('CONFIG_AUDIT_WATCH')
+ options.append('CONFIG_AUDIT_TREE')
+
+ for option in options:
self.assertIn(f'{option}=y', kernel_config)
def test_radius_config(self):