sureshanaparti commented on code in PR #10708: URL: https://github.com/apache/cloudstack/pull/10708#discussion_r2049294190
########## 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 added unit tests, please check. -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org