summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
diff options
context:
space:
mode:
authorNicolas Vollmar <nvollmar@gmail.com>2024-04-19 23:59:17 +0200
committerChristian Breunig <christian@breunig.cc>2024-04-21 12:53:42 +0200
commit98a0fdbef343c20c5054abea478a81e5b86c254f (patch)
tree791414e77bccd814e505051fd2306d3deb8f35fc /smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
parent5a8310147b858ab85ed5a00fa6cb1f2e856f6a0c (diff)
downloadvyos-1x-98a0fdbef343c20c5054abea478a81e5b86c254f.tar.gz
vyos-1x-98a0fdbef343c20c5054abea478a81e5b86c254f.zip
T6246: improve haproxy http check configuration
(cherry picked from commit 050f24770aec7a74c1a07ba64cf2cb83afb72f1a)
Diffstat (limited to 'smoketest/scripts/cli/test_load-balancing_reverse-proxy.py')
-rwxr-xr-xsmoketest/scripts/cli/test_load-balancing_reverse-proxy.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py b/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
index 8ccf2cf97..737c07401 100755
--- a/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
+++ b/smoketest/scripts/cli/test_load-balancing_reverse-proxy.py
@@ -304,15 +304,34 @@ class TestLoadBalancingReverseProxy(VyOSUnitTestSHIM.TestCase):
# Set http-check
self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'method', 'get'])
- self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'uri', '/health'])
- self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'expect', 'status 200'])
self.cli_commit()
# Test http-check
config = read_file(HAPROXY_CONF)
self.assertIn('option httpchk', config)
+ self.assertIn('http-check send meth GET', config)
+
+ # Set http-check with uri and status
+ self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'uri', '/health'])
+ self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'expect', 'status', '200'])
+ self.cli_commit()
+
+ # Test http-check with uri and status
+ config = read_file(HAPROXY_CONF)
+ self.assertIn('option httpchk', config)
self.assertIn('http-check send meth GET uri /health', config)
self.assertIn('http-check expect status 200', config)
+ # Set http-check with string
+ self.cli_delete(base_path + ['backend', 'bk-01', 'http-check', 'expect', 'status', '200'])
+ self.cli_set(base_path + ['backend', 'bk-01', 'http-check', 'expect', 'string', 'success'])
+ self.cli_commit()
+
+ # Test http-check with string
+ config = read_file(HAPROXY_CONF)
+ self.assertIn('option httpchk', config)
+ self.assertIn('http-check send meth GET uri /health', config)
+ self.assertIn('http-check expect string success', config)
+
if __name__ == '__main__':
unittest.main(verbosity=2)