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


##########
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:
   I can definitely split this out into a different test if you want, I was 
just doing it here since there was a TODO in **_this function_** to add 
additional tests for things like maxconn.  Let me know and I can do that in 
just a couple mins.



-- 
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