diff options
Diffstat (limited to 'tests/distaf/tests_d')
-rw-r--r-- | tests/distaf/tests_d/examples/test_basic_gluster_tests.py | 33 | ||||
-rw-r--r-- | tests/distaf/tests_d/examples/test_docstring.py | 2 | ||||
-rw-r--r-- | tests/distaf/tests_d/examples/test_passfail.py | 6 |
3 files changed, 28 insertions, 13 deletions
diff --git a/tests/distaf/tests_d/examples/test_basic_gluster_tests.py b/tests/distaf/tests_d/examples/test_basic_gluster_tests.py index 47dfd9372a7..d981c0b8ab5 100644 --- a/tests/distaf/tests_d/examples/test_basic_gluster_tests.py +++ b/tests/distaf/tests_d/examples/test_basic_gluster_tests.py @@ -17,10 +17,8 @@ from distaf.util import tc, testcase -from distaf.gluster_base_class import GlusterBaseClass -from distaf.gluster_libs.mount_ops import mount_volume, umount_volume -from distaf.gluster_libs.volume_ops import (setup_vol, stop_volume, - delete_volume) +from distaflibs.gluster.gluster_base_class import GlusterBaseClass +from distaflibs.gluster.mount_ops import mount_volume, umount_volume @testcase("gluster_basic_test") @@ -28,17 +26,17 @@ class gluster_basic_test(GlusterBaseClass): """ runs_on_volumes: ALL runs_on_protocol: [ glusterfs, nfs ] - reuse_setup: True + reuse_setup: False """ def run(self): _rc = True client = self.clients[0] tc.run(self.mnode, "gluster volume status %s" % self.volname) - ret, _, _ = mount_volume(self.volname, self.mount_proto, \ - self.mountpoint, mclient=client) + ret, _, _ = mount_volume(self.volname, self.mount_proto, + self.mountpoint, mclient=client) if ret != 0: - tc.logger.error("Unable to mount the volume %s in %s" \ - "Please check the logs" % (self.volname, client)) + tc.logger.error("Unable to mount the volume %s in %s" + "Please check the logs" % (self.volname, client)) return False ret, _, _ = tc.run(client, "cp -r /etc %s" % self.mountpoint) if ret != 0: @@ -47,3 +45,20 @@ class gluster_basic_test(GlusterBaseClass): tc.run(client, "rm -rf %s/etc" % self.mountpoint) umount_volume(client, self.mountpoint) return _rc + + +@testcase("dummy_testcase") +class dummy_testcase(GlusterBaseClass): + """ + runs_on_volumes: ALL + runs_on_protocol: [ glusterfs, nfs ] + reuse_setup: False + """ + def run(self): + _rc = True + ret, _, _ = tc.run(self.mnode, "gluster volume status %s" % self.volname) + if ret != 0: + tc.logger.error("Unable to thet the status of %s", self.volname) + _rc = False + + return _rc diff --git a/tests/distaf/tests_d/examples/test_docstring.py b/tests/distaf/tests_d/examples/test_docstring.py index 1a73998eb66..a939da8da9e 100644 --- a/tests/distaf/tests_d/examples/test_docstring.py +++ b/tests/distaf/tests_d/examples/test_docstring.py @@ -17,7 +17,7 @@ from distaf.util import tc, testcase -from distaf.gluster_base_class import GlusterBaseClass +from distaflibs.gluster.gluster_base_class import GlusterBaseClass # An example with both doc and config in docstring diff --git a/tests/distaf/tests_d/examples/test_passfail.py b/tests/distaf/tests_d/examples/test_passfail.py index 3b14c117190..78396349fc4 100644 --- a/tests/distaf/tests_d/examples/test_passfail.py +++ b/tests/distaf/tests_d/examples/test_passfail.py @@ -17,7 +17,7 @@ from distaf.util import tc, testcase -from distaf.gluster_base_class import GlusterBaseClass +from distaflibs.gluster.gluster_base_class import GlusterBaseClass @testcase("this_should_pass") @@ -44,7 +44,7 @@ class GoingToPass(GlusterBaseClass): config = self.config_data tc.logger.info("Testing connection and command exec") tc.logger.debug("Tag 1 is %s" % config["tags"][0]) - ret, _, _ = tc.run(self.nodes[0], "hostname") + ret, _, _ = tc.run(self.servers[0], "hostname") if ret != 0: tc.logger.error("hostname command failed") return False @@ -80,7 +80,7 @@ class GoingToFail(GlusterBaseClass): config = self.config_data tc.logger.info("Testing fail output") tc.logger.debug("Tag 1 is %s" % config["tags"][0]) - ret, _, _ = tc.run(self.nodes[0], "false") + ret, _, _ = tc.run(self.servers[0], "false") if ret != 0: tc.logger.error("false command failed") return False |