From 0cd6cb10ac3dce82f8f7a8f4010a39d912ac4002 Mon Sep 17 00:00:00 2001 From: John Spray Date: Sun, 29 Nov 2015 11:48:29 +0000 Subject: [PATCH] tasks/cephfs: update for run_shell vs. sudo (TestStrays.test_snapshot_remove blocked on the sudo change) Signed-off-by: John Spray --- tasks/cephfs/test_auto_repair.py | 10 +++++----- tasks/cephfs/test_client_recovery.py | 4 ++-- tasks/cephfs/test_data_scan.py | 4 ++-- tasks/cephfs/test_forward_scrub.py | 4 ++-- tasks/cephfs/test_strays.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tasks/cephfs/test_auto_repair.py b/tasks/cephfs/test_auto_repair.py index 926a8d8c5d0f..5ee80602ae56 100644 --- a/tasks/cephfs/test_auto_repair.py +++ b/tasks/cephfs/test_auto_repair.py @@ -24,8 +24,8 @@ class TestMDSAutoRepair(CephFSTestCase): MDS should verify/fix backtrace on fetch dirfrag """ - self.mount_a.run_shell(["sudo", "mkdir", "testdir1"]) - self.mount_a.run_shell(["sudo", "touch", "testdir1/testfile"]) + self.mount_a.run_shell(["mkdir", "testdir1"]) + self.mount_a.run_shell(["touch", "testdir1/testfile"]) dir_objname = "{:x}.00000000".format(self.mount_a.path_to_ino("testdir1")) # drop inodes caps @@ -46,7 +46,7 @@ class TestMDSAutoRepair(CephFSTestCase): # readdir (fetch dirfrag) should fix testdir1's backtrace self.mount_a.mount() self.mount_a.wait_until_mounted() - self.mount_a.run_shell(["sudo", "ls", "testdir1"]) + self.mount_a.run_shell(["ls", "testdir1"]) # flush journal entries to dirfrag objects self.fs.mds_asok(['flush', 'journal']) @@ -59,7 +59,7 @@ class TestMDSAutoRepair(CephFSTestCase): test if MDS behave correct when it's readonly """ # operation should successd when MDS is not readonly - self.mount_a.run_shell(["sudo", "touch", "test_file1"]) + self.mount_a.run_shell(["touch", "test_file1"]) writer = self.mount_a.write_background(loop=True) time.sleep(10) @@ -71,7 +71,7 @@ class TestMDSAutoRepair(CephFSTestCase): # touching test file should fail try: - self.mount_a.run_shell(["sudo", "touch", "test_file1"]) + self.mount_a.run_shell(["touch", "test_file1"]) except CommandFailedError: pass else: diff --git a/tasks/cephfs/test_client_recovery.py b/tasks/cephfs/test_client_recovery.py index fd2b6880ba92..9e58c5ab8eba 100644 --- a/tasks/cephfs/test_client_recovery.py +++ b/tasks/cephfs/test_client_recovery.py @@ -304,10 +304,10 @@ class TestClientRecovery(CephFSTestCase): count = 500 # Create lots of files for i in range(count): - self.mount_a.run_shell(["sudo", "touch", "f{0}".format(i)]) + self.mount_a.run_shell(["touch", "f{0}".format(i)]) # Populate mount_b's cache - self.mount_b.run_shell(["sudo", "ls"]) + self.mount_b.run_shell(["ls"]) client_id = self.mount_b.get_global_id() num_caps = self._session_num_caps(client_id) diff --git a/tasks/cephfs/test_data_scan.py b/tasks/cephfs/test_data_scan.py index 26d90e53953b..47b9651cec56 100644 --- a/tasks/cephfs/test_data_scan.py +++ b/tasks/cephfs/test_data_scan.py @@ -271,7 +271,7 @@ class NonDefaultLayout(Workload): self._initial_state = self._mount.stat("datafile") def validate(self): - p = self._mount.run_shell(["sudo", "getfattr", "--only-values", "-n", "ceph.file.layout.object_size", "./datafile"]) + p = self._mount.run_shell(["getfattr", "--only-values", "-n", "ceph.file.layout.object_size", "./datafile"]) # Check we got the layout reconstructed properly object_size = int(p.stdout.getvalue().strip()) @@ -459,7 +459,7 @@ class TestDataScan(CephFSTestCase): self.fs.wait_for_daemons() self.mount_a.mount() self.mount_a.wait_until_mounted() - out = self.mount_a.run_shell(["sudo", "cat", "subdir/{0}".format(victim_dentry)]).stdout.getvalue().strip() + out = self.mount_a.run_shell(["cat", "subdir/{0}".format(victim_dentry)]).stdout.getvalue().strip() self.assertEqual(out, victim_dentry) # Finally, close the loop by checking our injected dentry survives a merge diff --git a/tasks/cephfs/test_forward_scrub.py b/tasks/cephfs/test_forward_scrub.py index d74840f0c398..6a179a675356 100644 --- a/tasks/cephfs/test_forward_scrub.py +++ b/tasks/cephfs/test_forward_scrub.py @@ -133,8 +133,8 @@ class TestForwardScrub(CephFSTestCase): # look orphaned to backward scan if backward scan wisnae # respectin' tha scrub_tag xattr. self.mount_a.mount() - self.mount_a.run_shell(["sudo", "mkdir", "parent/unflushed"]) - self.mount_a.run_shell(["sudo", "dd", "if=/dev/urandom", + self.mount_a.run_shell(["mkdir", "parent/unflushed"]) + self.mount_a.run_shell(["dd", "if=/dev/urandom", "of=./parent/unflushed/jfile", "bs=1M", "count=8"]) inos["./parent/unflushed"] = self.mount_a.path_to_ino("./parent/unflushed") diff --git a/tasks/cephfs/test_strays.py b/tasks/cephfs/test_strays.py index 419f80806686..fd2e6b92f123 100644 --- a/tasks/cephfs/test_strays.py +++ b/tasks/cephfs/test_strays.py @@ -94,7 +94,7 @@ class TestStrays(CephFSTestCase): # We will run the deletion in the background, to reduce the risk of it completing before # we have started monitoring the stray statistics. def background(): - self.mount_a.run_shell(["sudo", "rm", "-rf", "delete_me"]) + self.mount_a.run_shell(["rm", "-rf", "delete_me"]) self.fs.mds_asok(["flush", "journal"]) background_thread = gevent.spawn(background) -- 2.47.3