Maor Lipchuk has uploaded a new change for review. Change subject: core: Fix fixtures tests ......................................................................
core: Fix fixtures tests disk id 1b26a52b-b60f-44cb-9f46-3ef333b04a35 has rows in images table therefore it could not be also in disk_lun_map. Adding a new id for new lun disk instead of the old one Change-Id: I58b8bbad985ffe236a3b1a58a465a260477b84a8 Signed-off-by: Maor Lipchuk <mlipc...@redhat.com> --- M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/FixturesTool.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java M backend/manager/modules/dal/src/test/resources/fixtures.xml 6 files changed, 42 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/18183/1 diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java index 3e71838..c81accb 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java @@ -16,7 +16,7 @@ public class BaseDiskDaoTest extends BaseGenericDaoTestCase<Guid, BaseDisk, BaseDiskDao> { private static final Guid EXISTING_DISK_ID = new Guid("1b26a52b-b60f-44cb-9f46-3ef333b04a34"); - private static final int TOTAL_DISKS = 6; + private static final int TOTAL_DISKS = 7; @Override protected Guid generateNonExistingId() { diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java index 1fed675..2f0f333 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java @@ -191,7 +191,8 @@ * The result to check */ private static void assertPluggedGetAllForVMResult(List<Disk> disks) { - assertEquals("VM should have only one plugged disk", 1, disks.size()); + Integer numberOfDisks = 2; + assertEquals("VM should have " + numberOfDisks + " plugged disk", numberOfDisks.intValue(), disks.size()); } /** diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java index 26c3244..b6fee3e 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java @@ -14,7 +14,7 @@ public class DiskLunMapDaoTest extends BaseGenericDaoTestCase<DiskLunMapId, DiskLunMap, DiskLunMapDao> { private static final DiskLunMapId EXISTING_DISK_LUN_MAP_ID = - new DiskLunMapId(new Guid("1b26a52b-b60f-44cb-9f46-3ef333b04a35"), "1IET_00180002"); + new DiskLunMapId(FixturesTool.LUN_DISK_ID, FixturesTool.LUN_ID_FOR_DISK); protected static final int TOTAL_DISK_LUN_MAPS = 3; @Override diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/FixturesTool.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/FixturesTool.java index 0195c09..7035c5d 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/FixturesTool.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/FixturesTool.java @@ -256,6 +256,17 @@ protected static final Guid FLOATING_LUN_ID = new Guid("1b26a52b-b60f-44cb-9f46-3ef333b04a37"); /** + * Predefined disk id based on LUN for testing.<BR/> + * LUN ID: 1IET_00180002 + */ + protected static final Guid LUN_DISK_ID = new Guid("1b26a52b-b60f-44cb-9f46-3ef333b04a41"); + + /** + * Predefined LUN ID + */ + protected static final String LUN_ID_FOR_DISK = "1IET_00180002"; + + /** * Predefined boot LUN disk attached to VM_RHEL5_POOL_57 */ protected static final Guid BOOTABLE_DISK_ID = new Guid("1b26a52b-b60f-44cb-9f46-3ef333b04a40"); diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java index 23476f8..80c5aa4 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java @@ -26,8 +26,8 @@ private static final Guid EXISTING_VM_ID = new Guid("77296e00-0cad-4e5a-9299-008a7b6f4355"); private static final Guid EXISTING_DEVICE_ID = new Guid("e14ed6f0-3b12-11e1-b614-63d00126418d"); - private static final int TOTAL_DEVICES = 10; - private static final int TOTAL_DEVICES_FOR_EXISTING_VM = 3; + private static final int TOTAL_DEVICES = 11; + private static final int TOTAL_DEVICES_FOR_EXISTING_VM = 4; @Override diff --git a/backend/manager/modules/dal/src/test/resources/fixtures.xml b/backend/manager/modules/dal/src/test/resources/fixtures.xml index 4a631fc..d33e30e 100644 --- a/backend/manager/modules/dal/src/test/resources/fixtures.xml +++ b/backend/manager/modules/dal/src/test/resources/fixtures.xml @@ -2963,13 +2963,23 @@ <value>false</value> <value>true</value> </row> + <row> + <value>1b26a52b-b60f-44cb-9f46-3ef333b04a41</value> + <value>VirtIO</value> + <value>4</value> + <value>Off</value> + <value>false</value> + <value>New Description</value> + <value>false</value> + <value>true</value> + </row> </table> <table name="disk_lun_map"> <column>disk_id</column> <column>lun_id</column> <row> - <value>1b26a52b-b60f-44cb-9f46-3ef333b04a35</value> + <value>1b26a52b-b60f-44cb-9f46-3ef333b04a41</value> <value>1IET_00180002</value> </row> <row> @@ -4393,6 +4403,20 @@ <value>alias</value> <null /> </row> + <row> + <value>1b26a52b-b60f-44cb-9f46-3ef333b04a41</value> + <value>77296e00-0cad-4e5a-9299-008a7b6f4355</value> + <value>disk</value> + <value>disk</value> + <value>sample</value> + <value>1</value> + <value>{}</value> + <value>true</value> + <value>true</value> + <value>false</value> + <value>alias</value> + <null /> + </row> </table> <table name="job"> -- To view, visit http://gerrit.ovirt.org/18183 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58b8bbad985ffe236a3b1a58a465a260477b84a8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches