Change in vdsm[master]: tests: Add test for mount connection classes
ahino at redhat.com
ahino at redhat.com
Sat Jun 13 20:00:04 UTC 2015
Ala Hino has uploaded a new change for review.
Change subject: tests: Add test for mount connection classes
......................................................................
tests: Add test for mount connection classes
Add unit tests for MountConnection and GlusterFSConnection classes.
Change-Id: I28e0b12eaab80dc274ad3c35f79c2897f4dae44a
Signed-off-by: Ala Hino <ahino at redhat.com>
---
M tests/storageServerTests.py
1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/42307/1
diff --git a/tests/storageServerTests.py b/tests/storageServerTests.py
index 6703466..05e5940 100644
--- a/tests/storageServerTests.py
+++ b/tests/storageServerTests.py
@@ -19,7 +19,15 @@
#
from testlib import VdsmTestCase
+from storage.storageServer import GlusterFSConnection
+from storage.storageServer import MountConnection
from storage.storageServer import IscsiConnection
+
+
+class FakeMount(object):
+ def __init__(self, fs_spec, fs_file):
+ self._fs_spec = fs_spec
+ self._fs_file = fs_file
class IscsiConnectionMismatchTests(VdsmTestCase):
@@ -37,3 +45,18 @@
IscsiConnection.Mismatch("error 2")]
expected = "%s" % ["error 1", "error 2"]
self.assertEqual(str(errors), expected)
+
+
+class MountConnectionTests(VdsmTestCase):
+
+ def testLocalPathBase(self):
+ mountConn = MountConnection("", FakeMount)
+ self.assertEquals(mountConn._getLocalPath(), "/tmp/")
+
+
+class GlusterFSConnectionTests(VdsmTestCase):
+
+ def testLocalPathBase(self):
+ mountConn = GlusterFSConnection("server:/volume", FakeMount)
+ self.assertEquals(mountConn._getLocalPath(),
+ "/tmp/glusterSD/server:_volume")
--
To view, visit https://gerrit.ovirt.org/42307
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28e0b12eaab80dc274ad3c35f79c2897f4dae44a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino at redhat.com>
More information about the vdsm-patches
mailing list