summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-14 17:08:56 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-14 17:08:56 +0100
commit30cc4199e20dea75779f7fed3e760f1abefa6f61 (patch)
treec7c8504786efa7c9301fc6ac8aed58ca8a88233e
parentc941700b71793b02815d5b7a51f0e00726937294 (diff)
downloadvyos-1x-30cc4199e20dea75779f7fed3e760f1abefa6f61.tar.gz
vyos-1x-30cc4199e20dea75779f7fed3e760f1abefa6f61.zip
smoketest: webproxy: test cache-peer config
-rwxr-xr-xsmoketest/scripts/cli/test_service_webproxy.py31
1 files changed, 30 insertions, 1 deletions
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']