diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-02-22 15:44:34 +0000 | 
|---|---|---|
| committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-02-24 10:28:33 +0000 | 
| commit | fe20eae99ebdb7781f74ada3a7c13a848ea75bcc (patch) | |
| tree | 987fea738165fdc67ea9d2ca58ffb33c1b0660ac /smoketest/scripts/cli | |
| parent | 5d9d232fd93ad5bf89ba44a2d0ec3b196599fa74 (diff) | |
| download | vyos-1x-fe20eae99ebdb7781f74ada3a7c13a848ea75bcc.tar.gz vyos-1x-fe20eae99ebdb7781f74ada3a7c13a848ea75bcc.zip  | |
T7190: Add haproxy default timeout options configurable
Add the ability to configurate default timeout and frontend
client timeout
```
set load-balancing haproxy service web timeout client '600'
set load-balancing haproxy timeout check '4'
set load-balancing haproxy timeout client '600'
set load-balancing haproxy timeout connect '12'
set load-balancing haproxy timeout server '120'
```
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_load-balancing_haproxy.py | 48 | 
1 files changed, 48 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_load-balancing_haproxy.py b/smoketest/scripts/cli/test_load-balancing_haproxy.py index 9f412aa95..077f1974f 100755 --- a/smoketest/scripts/cli/test_load-balancing_haproxy.py +++ b/smoketest/scripts/cli/test_load-balancing_haproxy.py @@ -521,5 +521,53 @@ class TestLoadBalancingReverseProxy(VyOSUnitTestSHIM.TestCase):          with self.assertRaises(ConfigSessionError) as e:              self.cli_commit() +    def test_11_lb_haproxy_timeout(self): +        t_default_check = '5' +        t_default_client = '50' +        t_default_connect = '10' +        t_default_server ='50' +        t_check = '4' +        t_client = '300' +        t_connect = '12' +        t_server ='120' +        t_front_client = '600' + +        self.base_config() +        self.cli_commit() +        # Check default timeout options +        config_entries = ( +            f'timeout check {t_default_check}s', +            f'timeout connect {t_default_connect}s', +            f'timeout client {t_default_client}s', +            f'timeout server {t_default_server}s', +        ) +        # Check default timeout options +        config = read_file(HAPROXY_CONF) +        for config_entry in config_entries: +            self.assertIn(config_entry, config) + +        # Set custom timeout options +        self.cli_set(base_path + ['timeout', 'check', t_check]) +        self.cli_set(base_path + ['timeout', 'client', t_client]) +        self.cli_set(base_path + ['timeout', 'connect', t_connect]) +        self.cli_set(base_path + ['timeout', 'server', t_server]) +        self.cli_set(base_path + ['service', 'https_front', 'timeout', 'client', t_front_client]) + +        self.cli_commit() + +        # Check custom timeout options +        config_entries = ( +            f'timeout check {t_check}s', +            f'timeout connect {t_connect}s', +            f'timeout client {t_client}s', +            f'timeout server {t_server}s', +            f'timeout client {t_front_client}s', +        ) + +        # Check configured options +        config = read_file(HAPROXY_CONF) +        for config_entry in config_entries: +            self.assertIn(config_entry, config) +  if __name__ == '__main__':      unittest.main(verbosity=2)  | 
