Tal Nisan has uploaded a new change for review.

Change subject: dal: Added a mixed storage pool to fixtures.xml
......................................................................

dal: Added a mixed storage pool to fixtures.xml

Added a mixed storage pool to fixtures.xml file to allow dao tests to test
cases of mixed storage pools also

Change-Id: I285c420902ce8d28cb7e8bfcc2ad3a11c225c0fb
Bug-Url: https://bugzilla.redhat.com/1085395
Signed-off-by: Tal Nisan <tni...@redhat.com>
---
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/StorageServerConnectionDAOTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkQosDaoTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
6 files changed, 82 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/27136/1

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 3472266..f89b899 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
@@ -13,9 +13,14 @@
     protected static final Guid STORAGE_POOL_NFS = new 
Guid("72b9e200-f48b-4687-83f2-62828f249a47");
 
     /**
-     * Predefined NFS storage pool.
+     * Predefined mixed types storage pool.
      */
-    public static final Guid STORAGE_POOL_NFS_2 = new 
Guid("386bffd1-e7ed-4b08-bce9-d7df10f8c9a0");
+    public static final Guid STORAGE_POOL_MIXED_TYPES = new 
Guid("386bffd1-e7ed-4b08-bce9-d7df10f8c9a0");
+
+    /**
+     * Predefined storage pool with no domains.
+     */
+    public static final Guid STORAGE_POOL_NO_DOMAINS = new 
Guid("d9220003-8ad8-41d2-8c9e-5ea30b2e88e7");
 
     /**
      * Predefined ISCSI storage pool.
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageServerConnectionDAOTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageServerConnectionDAOTest.java
index 0b4f671..fd333d6 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageServerConnectionDAOTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageServerConnectionDAOTest.java
@@ -114,7 +114,7 @@
     @Test
     public void testGetConnectableFileStorageConnectionsByStorageType() {
         List<StorageServerConnections> conns =
-                
dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_NFS_2,
 StorageType.NFS);
+                
dao.getConnectableStorageConnectionsByStorageType(FixturesTool.STORAGE_POOL_MIXED_TYPES,
 StorageType.NFS);
 
         assertNotNull(conns);
         assertEquals(1, conns.size());
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
index 469a1ba..f762239 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmAndTemplatesGenerationsDaoTest.java
@@ -120,7 +120,7 @@
         assertEquals("templates ids for ovf update didn't contain expected 
id", guids.contains(FixturesTool.VM_TEMPLATE_RHEL5_2), true);
 
 
-        guids = 
vmAndTemplatesGenerationsDAO.getVmTemplatesIdsForOvfUpdate(FixturesTool.STORAGE_POOL_NFS_2);
+        guids = 
vmAndTemplatesGenerationsDAO.getVmTemplatesIdsForOvfUpdate(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         assertEquals("two templates should need ovf update", 2, guids.size());
         assertEquals("templates ids for ovf update didn't contain expected 
id", guids.contains(FixturesTool.VM_TEMPLATE_RHEL6_1), true);
         assertEquals("templates ids for ovf update didn't contain expected 
id", guids.contains(FixturesTool.VM_TEMPLATE_RHEL6_2), true);
@@ -182,8 +182,8 @@
         assertEquals("vms ids for ovf update didn't contain expected id", 
guids.contains(FixturesTool.VM_RHEL5_POOL_51), true);
 
 
-        guids = 
vmAndTemplatesGenerationsDAO.getVmsIdsForOvfUpdate(FixturesTool.STORAGE_POOL_NFS_2);
-        assertEquals("two vms should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_NFS_2, 2, guids.size());
+        guids = 
vmAndTemplatesGenerationsDAO.getVmsIdsForOvfUpdate(FixturesTool.STORAGE_POOL_MIXED_TYPES);
+        assertEquals("two vms should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_MIXED_TYPES, 2, guids.size());
         assertEquals("vm ids for ovf update didn't contain expected id", 
guids.contains(FixturesTool.VM_RHEL5_POOL_59), true);
         assertEquals("vm ids for ovf update didn't contain expected id", 
guids.contains(FixturesTool.VM_RHEL5_POOL_60), true);
     }
@@ -195,7 +195,7 @@
         toUpdate.add(FixturesTool.VM_TEMPLATE_RHEL5);
         toUpdate.add(FixturesTool.VM_RHEL5_POOL_50);
 
-        // POOL : STORAGE_POOL_NFS_2
+        // POOL : STORAGE_POOL_MIXED_TYPES
         toUpdate.add(FixturesTool.VM_TEMPLATE_RHEL6_1);
         toUpdate.add(FixturesTool.VM_RHEL5_POOL_60);
 
@@ -223,13 +223,13 @@
                 + FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER
                 , guids.contains(FixturesTool.VM_RHEL5_POOL_50), true);
 
-        guids = 
vmAndTemplatesGenerationsDAO.getVmTemplatesIdsForOvfUpdate(FixturesTool.STORAGE_POOL_NFS_2);
-        assertEquals("one template should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_NFS_2, 1, guids.size());
+        guids = 
vmAndTemplatesGenerationsDAO.getVmTemplatesIdsForOvfUpdate(FixturesTool.STORAGE_POOL_MIXED_TYPES);
+        assertEquals("one template should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_MIXED_TYPES, 1, guids.size());
         assertEquals("templates ids for ovf update didn't contain expected id 
in pool" + FixturesTool.STORAGE_POOL_NFS,
                 guids.contains(FixturesTool.VM_TEMPLATE_RHEL6_1), true);
 
-        guids = 
vmAndTemplatesGenerationsDAO.getVmsIdsForOvfUpdate(FixturesTool.STORAGE_POOL_NFS_2);
-        assertEquals("one vm should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_NFS_2, 1, guids.size());
+        guids = 
vmAndTemplatesGenerationsDAO.getVmsIdsForOvfUpdate(FixturesTool.STORAGE_POOL_MIXED_TYPES);
+        assertEquals("one vm should need ovf update in pool" + 
FixturesTool.STORAGE_POOL_MIXED_TYPES, 1, guids.size());
         assertEquals("vm ids for ovf update didn't contain expected id in 
pool" + FixturesTool.STORAGE_POOL_NFS,
                 guids.contains(FixturesTool.VM_RHEL5_POOL_60),
                 true);
@@ -275,7 +275,7 @@
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_50));
 
-        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_NFS_2);
+        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         assertEquals("the list of ovfs for deletion wasn't in the expected 
size", 1, guidsToDelete.size());
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_60));
@@ -295,7 +295,7 @@
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_50));
 
-        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_NFS_2);
+        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         assertEquals("the list of ovfs for deletion wasn't in the expected 
size", 2, guidsToDelete.size());
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_60));
@@ -322,7 +322,7 @@
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_50));
 
-        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_NFS_2);
+        guidsToDelete = 
vmAndTemplatesGenerationsDAO.getIdsForOvfDeletion(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         assertEquals("unexpected number of ovfs for deletion", 4, 
guidsToDelete.size());
         assertTrue("the list of guids for deletion doesn't contain an expected 
guid",
                 guidsToDelete.contains(FixturesTool.VM_RHEL5_POOL_60));
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkQosDaoTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkQosDaoTest.java
index f838519..5b4fd40 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkQosDaoTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkQosDaoTest.java
@@ -39,7 +39,7 @@
         NetworkQoS trueA = new NetworkQoS();
         trueA.setId(qosAId);
         trueA.setName("qos_a");
-        trueA.setStoragePoolId(FixturesTool.STORAGE_POOL_NFS_2);
+        trueA.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         trueA.setInboundAverage(1000);
         trueA.setInboundPeak(2000);
         trueA.setInboundBurst(500);
@@ -67,7 +67,7 @@
         NetworkQoS newB = new NetworkQoS();
         newB.setId(qosBId);
         newB.setName("newB");
-        newB.setStoragePoolId(FixturesTool.STORAGE_POOL_NFS_2);
+        newB.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         newB.setInboundAverage(30);
         newB.setInboundPeak(30);
         newB.setInboundBurst(30);
@@ -99,7 +99,7 @@
         NetworkQoS qosD = new NetworkQoS();
         qosD.setId(qosDId);
         qosD.setName("qos_d");
-        qosD.setStoragePoolId(FixturesTool.STORAGE_POOL_NFS_2);
+        qosD.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         qosD.setInboundAverage(200);
         qosD.setInboundPeak(200);
         qosD.setInboundBurst(200);
@@ -117,7 +117,7 @@
      */
     @Test
     public void testGetAllNetworkQosForStoragePool() {
-        
assertTrue(dao.getAllForStoragePoolId(FixturesTool.STORAGE_POOL_NFS_2).size() 
== 2);
+        
assertTrue(dao.getAllForStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES).size()
 == 2);
     }
 
 }
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java
index 970341b..8e7bece 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java
@@ -96,7 +96,7 @@
 
     @Test
     public void testGetAllMacsByStoragePool() throws Exception {
-        List<String> result = 
dao.getAllMacsByDataCenter(FixturesTool.STORAGE_POOL_NFS_2);
+        List<String> result = 
dao.getAllMacsByDataCenter(FixturesTool.STORAGE_POOL_MIXED_TYPES);
         assertEquals(FixturesTool.MAC_ADDRESS, result.get(0));
     }
 
diff --git a/backend/manager/modules/dal/src/test/resources/fixtures.xml 
b/backend/manager/modules/dal/src/test/resources/fixtures.xml
index 6886a84..d3586c3 100644
--- a/backend/manager/modules/dal/src/test/resources/fixtures.xml
+++ b/backend/manager/modules/dal/src/test/resources/fixtures.xml
@@ -481,8 +481,8 @@
         </row>
         <row>
             <value>386bffd1-e7ed-4b08-bce9-d7df10f8c9a0</value>
-            <value>rhel6.NFS2</value>
-            <value></value>
+            <value>rhel6.Mixed</value>
+            <value>A shared storage pool with mixed domain types</value>
             <value>false</value>
             <value>1</value>
             <value>1</value>
@@ -514,6 +514,18 @@
             <value>2.3</value>
             <value>2011-03-21 03:38:22</value>
             <value>2011-03-21 15:57:10</value>
+        </row>
+        <row>
+            <value>d9220003-8ad8-41d2-8c9e-5ea30b2e88e7</value>
+            <value>Empty_Shared_Pool</value>
+            <value>A shared storage pool with no domains attached</value>
+            <value>false</value>
+            <value>0</value>
+            <value>0</value>
+            <value>afce7a39-8e8c-4819-ba9c-796d316592e7</value>
+            <value>3.4</value>
+            <value>2014-04-24 12:00:00</value>
+            <value>2011-04-24 12:00:00</value>
         </row>
     </table>
 
@@ -3338,6 +3350,28 @@
             <value>7</value>
             <value>description7</value>
         </row>
+        <row>
+            <value>a7957057-b5de-47bb-b8e0-2f8dbd9e63d8</value>
+            <value>c18d59a9-c218-4076-8cd4-e19b43565111</value>
+            <value>iscsi_domain</value>
+            <value>1</value>
+            <value>3</value>
+            <value>2014-04-24 12:00:00</value>
+            <value>2014-04-24 12:00:00</value>
+            <value>7</value>
+            <value>ISCSI domain, part of 'rhel6.Mixed' storage pool</value>
+        </row>
+        <row>
+            <value>bee623f3-9174-4ffd-aa30-4fb0dc0aa2f5</value>
+            <value>85422037-cdf4-4b98-9ae1-39588af0a7b4</value>
+            <value>posix_domain</value>
+            <value>1</value>
+            <value>6</value>
+            <value>2014-04-24 12:00:00</value>
+            <value>2014-04-24 12:00:00</value>
+            <value>7</value>
+            <value>POSIX domain, part of 'rhel6.Mixed' storage pool</value>
+        </row>
     </table>
 
     <table name="storage_domain_dynamic">
@@ -3381,7 +3415,18 @@
             <value>14</value>
             <null />
         </row>
-
+        <row>
+            <value>a7957057-b5de-47bb-b8e0-2f8dbd9e63d8</value>
+            <value>666</value>
+            <value>666</value>
+            <null />
+        </row>
+        <row>
+            <value>bee623f3-9174-4ffd-aa30-4fb0dc0aa2f5</value>
+            <value>666</value>
+            <value>666</value>
+            <null />
+        </row>
     </table>
 
     <table name="storage_pool_iso_map">
@@ -3423,6 +3468,16 @@
             <value>386bffd1-e7ed-4b08-bce9-d7df10f8c9a1</value>
             <value>3</value>
         </row>
+        <row>
+            <value>a7957057-b5de-47bb-b8e0-2f8dbd9e63d8</value>
+            <value>386bffd1-e7ed-4b08-bce9-d7df10f8c9a0</value>
+            <value>3</value>
+        </row>
+        <row>
+            <value>bee623f3-9174-4ffd-aa30-4fb0dc0aa2f5</value>
+            <value>386bffd1-e7ed-4b08-bce9-d7df10f8c9a0</value>
+            <value>3</value>
+        </row>
     </table>
 
     <table name="snapshots">


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I285c420902ce8d28cb7e8bfcc2ad3a11c225c0fb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Tal Nisan <tni...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to