From 17bda60f4df608f93963a4e8e984cfe9a09851a2 Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Mon, 22 Jun 2020 20:09:23 +0530 Subject: [Testfix] Fix I/O of test_snap_delete_multiple Problem: test_snap_delete_multiple fails on I/O validation across all automation runs constantly with the below trace back: Traceback (most recent call last): File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 1246, in rc = args.func(args) File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 374, in create_files base_file_name, file_types) File "/usr/share/glustolibs/io/scripts/file_dir_ops.py", line 341, in _create_files ret = pool.map(lambda file_tuple: _create_file(*file_tuple), files) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map return self.map_async(func, iterable, chunksize).get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get raise self._value IOError: [Errno 17] File exists: '/mnt/testvol_distributed_glusterfs/testfile42.txt' Fix: Change the I/O to use --base-file-name parameter when running the I/O scripts. Change-Id: Ic5a8222f4fafeac4ac9aadc9c4d23327711ed9f0 Signed-off-by: kshithijiyer --- tests/functional/snapshot/test_snap_delete_multiple.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/functional/snapshot/test_snap_delete_multiple.py b/tests/functional/snapshot/test_snap_delete_multiple.py index ed3088ca0..e1be4732f 100644 --- a/tests/functional/snapshot/test_snap_delete_multiple.py +++ b/tests/functional/snapshot/test_snap_delete_multiple.py @@ -99,7 +99,7 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass): """ # Perform I/O - def io_operation(): + def io_operation(name): g.log.info("Starting to Perform I/O") all_mounts_procs = [] for mount_obj in self.mounts: @@ -107,10 +107,11 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass): mount_obj.client_system, mount_obj.mountpoint) # Create files g.log.info('Creating files...') - command = ("/usr/bin/env python %s create_files -f 100 " - "--fixed-file-size 1k %s" % ( - self.script_upload_path, - mount_obj.mountpoint)) + fname = "{}-{}".format(mount_obj.client_system, name) + command = ("/usr/bin/env python {} create_files -f 100 " + "--fixed-file-size 1k --base-file-name {}" + " {}".format(self.script_upload_path, + fname, mount_obj.mountpoint)) proc = g.run_async(mount_obj.client_system, command, user=mount_obj.user) all_mounts_procs.append(proc) @@ -217,14 +218,14 @@ class SnapshotCloneDeleteMultiple(GlusterBaseClass): self.assertEqual(ret1, 30, "Failed") ret2 = mount_clone_and_io(self.clone1, self.mpoint1) self.assertEqual(ret2, 0, "Failed to mount volume") - ret = io_operation() + ret = io_operation("first") self.assertEqual(ret, 0, "Failed to perform io") ret3 = create_snap(value2, self.clone1, self.snap2, self.clone2, ret1) self.assertEqual(ret3, 40, "Failed") ret4 = mount_clone_and_io(self.clone2, self.mpoint2) self.assertEqual(ret4, 0, "Failed to mount volume") - ret = io_operation() + ret = io_operation("second") self.assertEqual(ret, 0, "Failed to perform io") ret1 = create_snap(value3, self.clone2, self.snap2, self.clone2, ret3) -- cgit