summaryrefslogtreecommitdiffstats
path: root/tests/functional/snapshot/test_snap_uss_while_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/snapshot/test_snap_uss_while_io.py')
-rw-r--r--tests/functional/snapshot/test_snap_uss_while_io.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/functional/snapshot/test_snap_uss_while_io.py b/tests/functional/snapshot/test_snap_uss_while_io.py
index b51e92998..d11c9663c 100644
--- a/tests/functional/snapshot/test_snap_uss_while_io.py
+++ b/tests/functional/snapshot/test_snap_uss_while_io.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2017-2020 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@ Test Cases in this module tests the
uss functionality while io is going on.
"""
-import sys
from glusto.core import Glusto as g
@@ -33,7 +32,8 @@ from glustolibs.io.utils import (validate_io_procs,
from glustolibs.gluster.snap_ops import (snap_create,
snap_activate,
snap_list)
-from glustolibs.gluster.uss_ops import (enable_uss, is_uss_enabled,
+from glustolibs.gluster.uss_ops import (disable_uss,
+ enable_uss, is_uss_enabled,
is_snapd_running)
from glustolibs.misc.misc_libs import upload_scripts
@@ -70,6 +70,18 @@ class SnapshotUssWhileIo(GlusterBaseClass):
def tearDown(self):
+ # Validate USS running
+ g.log.info("Validating USS enabled or disabled")
+ ret = is_uss_enabled(self.mnode, self.volname)
+ if not ret:
+ # Disable USS
+ ret, _, _ = disable_uss(self.mnode, self.volname)
+ if not ret:
+ raise ExecutionError("Failed to disable USS on volume"
+ "%s" % self.volname)
+ g.log.info("Successfully disabled USS on volume %s",
+ self.volname)
+
# Unmount and cleanup original volume
g.log.info("Starting to Unmount Volume and Cleanup Volume")
ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)
@@ -77,6 +89,9 @@ class SnapshotUssWhileIo(GlusterBaseClass):
raise ExecutionError("Failed to umount the vol & cleanup Volume")
g.log.info("Successful in umounting the volume and Cleanup")
+ # Calling GlusterBaseClass tearDown
+ self.get_super_method(self, 'tearDown')()
+
def test_snap_uss_while_io(self):
# pylint: disable=too-many-statements
"""
@@ -125,9 +140,9 @@ class SnapshotUssWhileIo(GlusterBaseClass):
"%s", mount_obj.client_system, mount_obj.mountpoint)
# Create files
g.log.info('Creating files...')
- command = ("/usr/bin/env python%d %s create_files -f 100 "
+ command = ("/usr/bin/env python %s create_files -f 100 "
"--fixed-file-size 1M %s" % (
- sys.version_info.major, self.script_upload_path,
+ self.script_upload_path,
mount_obj.mountpoint))
proc = g.run_async(mount_obj.client_system, command,
user=mount_obj.user)