cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] GabrielBrascher commented on a change in pull request #2653: Generate MAC address if the MAC in command addNicToVirtualMachine is invalid
Date Sat, 19 May 2018 22:36:38 GMT
GabrielBrascher commented on a change in pull request #2653: Generate MAC address if the MAC
in command addNicToVirtualMachine is invalid
URL: https://github.com/apache/cloudstack/pull/2653#discussion_r189446407
 
 

 ##########
 File path: server/test/com/cloud/vm/UserVmManagerImplTest.java
 ##########
 @@ -217,8 +221,42 @@ private void configureDoNothingForMethodsThatWeDoNotWantToTest() throws
Resource
         Mockito.doNothing().when(userVmManagerImpl).validateInputsAndPermissionForUpdateVirtualMachineCommand(updateVmCommand);
         Mockito.doReturn(new ArrayList<Long>()).when(userVmManagerImpl).getSecurityGroupIdList(updateVmCommand);
         Mockito.doReturn(Mockito.mock(UserVm.class)).when(userVmManagerImpl).updateVirtualMachine(Mockito.anyLong(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean(),
-                Mockito.anyBoolean(), Mockito.anyLong(),
-                Mockito.anyString(), Mockito.anyBoolean(), Mockito.any(HTTPMethod.class),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyListOf(Long.class),
-                Mockito.anyMap());
+                Mockito.anyBoolean(), Mockito.anyLong(), Mockito.anyString(), Mockito.anyBoolean(),
Mockito.any(HTTPMethod.class), Mockito.anyString(), Mockito.anyString(),
+                Mockito.anyString(), Mockito.anyListOf(Long.class), Mockito.anyMap());
+    }
+
+    @Test
+    public void lookForNextAvailableMacAddressInNetworkIfMacIsInvalidTestMacAddressNotNull()
throws InsufficientAddressCapacityException {
+        configureGetNextAvailableMacAddressInNetworkIfMacIsNull(0, "00:00:00:00:00:00", "00:00:00:00:00:00");
+    }
+
+    @Test
+    public void lookForNextAvailableMacAddressInNetworkIfMacIsInvalidTestMacAddressNull()
throws InsufficientAddressCapacityException {
+        configureGetNextAvailableMacAddressInNetworkIfMacIsNull(1, null, "00:00:00:00:00:00");
+    }
+
+    @Test
+    public void lookForNextAvailableMacAddressInNetworkIfMacIsInvalidTestMacAddressBlank()
throws InsufficientAddressCapacityException {
+        configureGetNextAvailableMacAddressInNetworkIfMacIsNull(1, " ", "00:00:00:00:00:00");
+    }
+
+    @Test
+    public void lookForNextAvailableMacAddressInNetworkIfMacIsInvalidTestMacAddressEmpty()
throws InsufficientAddressCapacityException {
+        configureGetNextAvailableMacAddressInNetworkIfMacIsNull(1, "", "00:00:00:00:00:00");
+    }
+
+    @Test
+    public void lookForNextAvailableMacAddressInNetworkIfMacIsInvalidTestMacAddressNotValid()
throws InsufficientAddressCapacityException {
+        configureGetNextAvailableMacAddressInNetworkIfMacIsNull(1, "00:00:00:00:00", "00:00:00:00:00:00");
 
 Review comment:
   Yes, fixed!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message