sureshanaparti commented on code in PR #10708:
URL: https://github.com/apache/cloudstack/pull/10708#discussion_r2048948397


##########
vmware-base/src/test/java/com/cloud/hypervisor/vmware/mo/HypervisorHostHelperTest.java:
##########
@@ -578,10 +578,40 @@ public void 
testComposeCloudNetworkNameUnTaggedVlanGuestTraffic() throws Excepti
         networkRateMbps = 512;
         prefix = "cloud.guest";
         vSwitchName = "vSwitch2";
-        String cloudNetworkName = 
HypervisorHostHelper.composeCloudNetworkName(prefix, vlanId, svlanId, 
networkRateMbps, vSwitchName);
+        String cloudNetworkName = 
HypervisorHostHelper.composeCloudNetworkName(prefix, vlanId, svlanId, 
networkRateMbps, vSwitchName, VirtualSwitchType.StandardVirtualSwitch);
         assertEquals("cloud.guest.400.s123.512.1-vSwitch2", cloudNetworkName);
     }
 
+    @Test
+    public void testComposeCloudNetworkNameVlanRangeGuestTrafficDvSwitch() {
+        vlanId = "400-500";
+        networkRateMbps = 512;
+        prefix = "cloud.guest";
+        vSwitchName = "dvSwitch0";
+        String cloudNetworkName = 
HypervisorHostHelper.composeCloudNetworkName(prefix, vlanId, null, 
networkRateMbps, vSwitchName, VirtualSwitchType.VMwareDistributedVirtualSwitch);
+        assertEquals("cloud.guest.400-500.512.1-dvSwitch0", cloudNetworkName);
+    }
+
+    @Test
+    public void testComposeCloudNetworkNameVlanNumbersGuestTrafficDvSwitch() {
+        vlanId = 
"3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020";
+        networkRateMbps = 512;
+        prefix = "cloud.guest";
+        vSwitchName = "dvSwitch0";
+        String cloudNetworkName = 
HypervisorHostHelper.composeCloudNetworkName(prefix, vlanId, null, 
networkRateMbps, vSwitchName, VirtualSwitchType.VMwareDistributedVirtualSwitch);
+        assertEquals("cloud.guest.3001-3020.512.1-dvSwitch0", 
cloudNetworkName);
+    }
+
+    @Test
+    public void 
testComposeCloudNetworkNameVlanNumbersAndRangeGuestTrafficDvSwitch() {
+        vlanId = 
"3001,3004-3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3020";

Review Comment:
   @weizhouapache the vans are re-ordered without any overlaps, and with proper 
ranges. we can add test case for that.



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