DaanHoogland commented on code in PR #12586:
URL: https://github.com/apache/cloudstack/pull/12586#discussion_r2817211893


##########
core/src/test/java/com/cloud/network/HAProxyConfiguratorTest.java:
##########
@@ -79,13 +79,24 @@ public void 
testGenerateConfigurationLoadBalancerConfigCommand() {
         LoadBalancerTO[] lba = new LoadBalancerTO[1];
         lba[0] = lb;
         HAProxyConfigurator hpg = new HAProxyConfigurator();
-        LoadBalancerConfigCommand cmd = new LoadBalancerConfigCommand(lba, 
"10.0.0.1", "10.1.0.1", "10.1.1.1", null, 1L, "12", false);
+        LoadBalancerConfigCommand cmd = new LoadBalancerConfigCommand(lba, 
"10.0.0.1", "10.1.0.1", "10.1.1.1", null, 1L, "12", false, 0L);
         String result = genConfig(hpg, cmd);
         assertTrue("keepalive disabled should result in 'option httpclose' in 
the resulting haproxy config", result.contains("\toption httpclose"));
 
-        cmd = new LoadBalancerConfigCommand(lba, "10.0.0.1", "10.1.0.1", 
"10.1.1.1", null, 1L, "4", true);
+        cmd = new LoadBalancerConfigCommand(lba, "10.0.0.1", "10.1.0.1", 
"10.1.1.1", null, 1L, "4", true, 0L);
         result = genConfig(hpg, cmd);
         assertTrue("keepalive enabled should result in 'no option httpclose' 
in the resulting haproxy config", result.contains("\tno option httpclose"));
+
+        cmd = new LoadBalancerConfigCommand(lba, "10.0.0.1", "10.1.0.1", 
"10.1.1.1", null, 1L, "4", true, 0L);
+        result = genConfig(hpg, cmd);
+        assertTrue("idleTimeout of 0 should not generate 'timeout server' in 
the resulting haproxy config", !result.contains("\ttimeout server"));
+        assertTrue("idleTimeout of 0 should not generate 'timeout client' in 
the resulting haproxy config", !result.contains("\ttimeout client"));
+
+        cmd = new LoadBalancerConfigCommand(lba, "10.0.0.1", "10.1.0.1", 
"10.1.1.1", null, 1L, "4", true, 1234L);
+        result = genConfig(hpg, cmd);
+        assertTrue("idleTimeout of 1234 should result in 'timeout server     
1234' in the resulting haproxy config", result.contains("\ttimeout server     
1234"));
+        assertTrue("idleTimeout of 1234 should result in 'timeout client     
1234' in the resulting haproxy config", result.contains("\ttimeout client     
1234"));

Review Comment:
   only if you feel like it ;)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to