summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-08-07 19:02:31 +0200
committerChristian Breunig <christian@breunig.cc>2024-08-07 19:02:31 +0200
commitbba60fdca4d5aaaa14d540ce5d5496ac519b4015 (patch)
tree5681771116de45f0a7648e107584b62c5c1cfd35 /smoketest
parent2312ac1574dbc2d0d0d24cc701be4d5da019e55b (diff)
downloadvyos-1x-bba60fdca4d5aaaa14d540ce5d5496ac519b4015.tar.gz
vyos-1x-bba60fdca4d5aaaa14d540ce5d5496ac519b4015.zip
smoketest: T6539: remove explicit test for non existing global log entry
Commit dd5908eac ("T6539: add logging options to load-balancer reverse-proxy") added CLI commands to add custom log entries for frontend and backend servers as well as a global log directive. Remove explicit test code for no longer always present "global log" directive. (cherry picked from commit b71481f7de93d43ff7208ff76cbc6b829b8951b2)
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_load-balancing_reverse-proxy.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py b/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
index aa796f59f..34f77b95d 100755
--- a/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
+++ b/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
@@ -458,6 +458,45 @@ class TestLoadBalancingReverseProxy(VyOSUnitTestSHIM.TestCase):
config = read_file(HAPROXY_CONF)
self.assertIn(f'option smtpchk', config)
+ def test_09_lb_reverse_proxy_logging(self):
+ # Setup base
+ self.base_config()
+ self.cli_commit()
+
+ # Ensure default logging configuration is present
+ config = read_file(HAPROXY_CONF)
+
+ # Test global-parameters logging options
+ self.cli_set(base_path + ['global-parameters', 'logging', 'facility', 'local1', 'level', 'err'])
+ self.cli_set(base_path + ['global-parameters', 'logging', 'facility', 'local2', 'level', 'warning'])
+ self.cli_commit()
+
+ # Test global logging parameters are generated in configuration file
+ config = read_file(HAPROXY_CONF)
+ self.assertIn('log /dev/log local1 err', config)
+ self.assertIn('log /dev/log local2 warning', config)
+
+ # Test backend logging options
+ backend_path = base_path + ['backend', 'bk-01']
+ self.cli_set(backend_path + ['logging', 'facility', 'local3', 'level', 'debug'])
+ self.cli_set(backend_path + ['logging', 'facility', 'local4', 'level', 'info'])
+ self.cli_commit()
+
+ # Test backend logging parameters are generated in configuration file
+ config = read_file(HAPROXY_CONF)
+ self.assertIn('log /dev/log local3 debug', config)
+ self.assertIn('log /dev/log local4 info', config)
+
+ # Test service logging options
+ service_path = base_path + ['service', 'https_front']
+ self.cli_set(service_path + ['logging', 'facility', 'local5', 'level', 'notice'])
+ self.cli_set(service_path + ['logging', 'facility', 'local6', 'level', 'crit'])
+ self.cli_commit()
+
+ # Test service logging parameters are generated in configuration file
+ config = read_file(HAPROXY_CONF)
+ self.assertIn('log /dev/log local5 notice', config)
+ self.assertIn('log /dev/log local6 crit', config)
if __name__ == '__main__':
unittest.main(verbosity=2)