Change in vdsm[master]: storagePoolCreated assertion added

ykleinbe at redhat.com ykleinbe at redhat.com
Tue Aug 26 13:51:54 UTC 2014


Yoav Kleinberger has uploaded a new change for review.

Change subject: storagePoolCreated assertion added
......................................................................

storagePoolCreated assertion added

Change-Id: Ia7e9e6a6d8d1c600df4348833c57e24f49172e98
Signed-off-by: Yoav Kleinberger <ykleinbe at redhat.com>
---
M tests/functional/new/basic_storage_domain_test.py
A tests/functional/new/testlib/testcontexts/base.py
M tests/functional/new/testlib/testcontexts/iscsi.py
M tests/functional/new/testlib/testcontexts/localfs.py
4 files changed, 25 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/31989/1

diff --git a/tests/functional/new/basic_storage_domain_test.py b/tests/functional/new/basic_storage_domain_test.py
index bcf5a99..9785617 100644
--- a/tests/functional/new/basic_storage_domain_test.py
+++ b/tests/functional/new/basic_storage_domain_test.py
@@ -39,9 +39,8 @@
             domainID = vdsm.createStorageDomain()
             verify.storageDomainCreated(domainID)
 
-#            poolID = str(uuid.uuid4())
-            vdsm.createStoragePool()
-            verify.storagePoolCreated()
+            poolID = vdsm.createStoragePool()
+            verify.storagePoolCreated(poolID, masterDomainID = domainID)
 
             vdsm.connectStoragePool()
             vdsm.spmStart()
diff --git a/tests/functional/new/testlib/testcontexts/base.py b/tests/functional/new/testlib/testcontexts/base.py
new file mode 100644
index 0000000..bb89338
--- /dev/null
+++ b/tests/functional/new/testlib/testcontexts/base.py
@@ -0,0 +1,16 @@
+import os
+import logging
+import time
+
+class Verify:
+    def waitForVDSMToFinishTask(self):
+        time.sleep(1)
+
+    def storagePoolCreated(self, poolID, masterDomainID):
+        self.waitForVDSMToFinishTask()
+        linkToDomain = os.path.join('/rhev/data-center', poolID, masterDomainID)
+        masterAliasLink = os.path.join('/rhev/data-center', poolID, 'mastersd')
+        logging.info('verifying domain %s in pool %s' % (masterDomainID, poolID))
+        assert os.path.lexists(linkToDomain)
+        logging.info('verifying symlink to master domain')
+        assert os.path.lexists(masterAliasLink)
diff --git a/tests/functional/new/testlib/testcontexts/iscsi.py b/tests/functional/new/testlib/testcontexts/iscsi.py
index c8c79a8..b4fc12c 100644
--- a/tests/functional/new/testlib/testcontexts/iscsi.py
+++ b/tests/functional/new/testlib/testcontexts/iscsi.py
@@ -14,8 +14,9 @@
 import glob
 import storage.volume
 import storage.image
+from . import base
 
-class Verify:
+class Verify(base.Verify):
     def __init__(self, iqn, volumeGroup, vdsm):
 ### store iqn here
         self._iqn = iqn
@@ -33,9 +34,6 @@
             assert not os.path.lexists(path)
         else:
             assert not os.path.exists(path)
-
-    def _waitForVDSMToFinishTask(self):
-        time.sleep(1)
 
     def waitFor(self, predicate, description, timeout):
         logging.info('waiting for "%s"' % description)
@@ -57,7 +55,7 @@
         pass
 
     def storageServerDisconnected(self):
-        self._waitForVDSMToFinishTask()
+        self.waitForVDSMToFinishTask()
         pass
 
     def storageDomainCreated(self, domainID):
@@ -77,15 +75,11 @@
     def _directIOTestFileExists(self):
         pass
 
-    def storagePoolCreated(self):
-        self._waitForVDSMToFinishTask()
-        pass
-
     def spmStarted(self):
         pass
 
     def volumeCreated(self, taskID):
-        self._waitForVDSMToFinishTask()
+        self.waitForVDSMToFinishTask()
         while True:
             result = self._vdsm.getTaskStatus(taskID)
             assert result['status']['code'] == 0
@@ -186,10 +180,9 @@
 
     def createStoragePool(self):
         POOL_TYPE_DEPRECATED = 0
-        self.embed('createStoragePool 1')
         result = self._vdsm.createStoragePool(0, self._poolID, self._randomName('pool'), self._domainID(), [ self._domainID() ], 1)
         self.verifyVDSMSuccess(result)
-        self.embed('createStoragePool 2')
+        return self._poolID
 
     def _domainID(self):
         return self._volumeGroup['uuid']
diff --git a/tests/functional/new/testlib/testcontexts/localfs.py b/tests/functional/new/testlib/testcontexts/localfs.py
index 86992c2..bdfd403 100644
--- a/tests/functional/new/testlib/testcontexts/localfs.py
+++ b/tests/functional/new/testlib/testcontexts/localfs.py
@@ -8,8 +8,9 @@
 import shutil
 import os
 import time
+from . import base
 
-class Verify:
+class Verify(base.Verify):
     def __init__(self, directory):
         self._directory = directory
 
@@ -58,13 +59,6 @@
         self._waitForVDSMToFinishTask()
         directIOTestFile = os.path.join(self._directory, '__DIRECT_IO_TEST__')
         self.assertPathExists(directIOTestFile)
-
-    def storagePoolCreated(self, poolID, master_storage_domainID):
-        self._waitForVDSMToFinishTask()
-        linkToDomain = os.path.join('/rhev/data-center', poolID, master_storage_domainID)
-        masterAliasLink = os.path.join('/rhev/data-center', poolID, 'mastersd')
-        assert os.path.lexists(linkToDomain)
-        assert os.path.lexists(masterAliasLink)
 
     def spmStarted(self, poolID, masterDomainID):
         self._waitForVDSMToFinishTask()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7e9e6a6d8d1c600df4348833c57e24f49172e98
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yoav Kleinberger <ykleinbe at redhat.com>


More information about the vdsm-patches mailing list