Arik Hadas has posted comments on this change.

Change subject: core: setting NIC boot order by NIC name
......................................................................


Patch Set 5:

(4 comments)

....................................................
File 
backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/utils/VmDeviceCommonUtilsTest.java
Line 34:     private static final String NIC_2_NAME = new String("nic2");
Line 35:     private static final Guid NIC_3_ID = new 
Guid("afce7a39-8e8c-4819-ba9c-796d316592e3");
Line 36:     private static final Guid DISK_1_ID = new 
Guid("afce7a39-8e8c-4819-ba9c-796d316592e4");
Line 37:     private static final Guid DISK_2_ID = new 
Guid("afce7a39-8e8c-4819-ba9c-796d316592e5");
Line 38:     private static final Guid CD_ID = new 
Guid("afce7a39-8e8c-4819-ba9c-796d316592e6");
Done
Line 39: 
Line 40:     @Mock
Line 41:     private VM vm;
Line 42: 


Line 48:     }
Line 49: 
Line 50:     @Test
Line 51:     public void testUpdateVmDevicesBootOrder() {
Line 52:         Map<Guid, Disk> idTodisk = new HashMap<Guid, Disk>();
Done
Line 53:         List<VmNetworkInterface> interfaces = new 
LinkedList<VmNetworkInterface>();
Line 54: 
Line 55:         VmDevice nic1 = createNetworkInterface(NIC_1_ID, true, 
NIC_1_NAME, interfaces);
Line 56:         VmDevice nic2 = createNetworkInterface(NIC_2_ID, true, 
NIC_2_NAME, interfaces);


Line 53:         List<VmNetworkInterface> interfaces = new 
LinkedList<VmNetworkInterface>();
Line 54: 
Line 55:         VmDevice nic1 = createNetworkInterface(NIC_1_ID, true, 
NIC_1_NAME, interfaces);
Line 56:         VmDevice nic2 = createNetworkInterface(NIC_2_ID, true, 
NIC_2_NAME, interfaces);
Line 57:         VmDevice nic3 = createNetworkInterface(NIC_3_ID, false, "", 
interfaces);
Done
Line 58: 
Line 59:         VmDevice disk1 = createDiskDevice(DISK_1_ID, true, idTodisk);
Line 60:         VmDevice disk2 = createDiskDevice(DISK_2_ID, false, idTodisk);
Line 61: 


Line 82:         ++index;
Line 83:         assertTrue(String.format("NIC 2 should have boot order = %d, 
actual = %d", index, nic2.getBootOrder()),
Line 84:                 nic2.getBootOrder() == index);
Line 85:         ++index;
Line 86:         assertTrue("NIC 3 should have boot order = 0", 
nic3.getBootOrder() == 0);
assertEquals - Done

regarding the suggestion to use array, I think it's an over-spec for this test. 
it will just make it more complex and I prefer to keep it simple
Line 87:         assertTrue(String.format("Disk 1 should have boot order = %d, 
actual = %d", index, disk1.getBootOrder()),
Line 88:                 disk1.getBootOrder() == index);
Line 89:         assertTrue("Disk 2 should have boot order = 0", 
disk2.getBootOrder() == 0);
Line 90:     }


-- 
To view, visit http://gerrit.ovirt.org/22560
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7916c3873361ef5bc4331ddfd3c60506f3c99fa3
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to