]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: update for run_shell vs. sudo
authorJohn Spray <john.spray@redhat.com>
Sun, 29 Nov 2015 11:48:29 +0000 (11:48 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 2 Dec 2015 23:30:55 +0000 (23:30 +0000)
(TestStrays.test_snapshot_remove blocked on the sudo change)

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/test_auto_repair.py
tasks/cephfs/test_client_recovery.py
tasks/cephfs/test_data_scan.py
tasks/cephfs/test_forward_scrub.py
tasks/cephfs/test_strays.py

index 926a8d8c5d0f107e9ded6b8173d01299e5621501..5ee80602ae5630b44b671fbee63804ee03a291c7 100644 (file)
@@ -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:
index fd2b6880ba92a3ed697352d5aa4bd102bdcfccea..9e58c5ab8eba95d90c33591392684b459fceca97 100644 (file)
@@ -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)
index 26d90e53953b69dd1400461fe8e11145bff7774e..47b9651cec5632ef696c38bada4b064b81a20f5c 100644 (file)
@@ -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
index d74840f0c3984e638108003fcfafc723fbfcae67..6a179a67535627a5092c7bf25d156ce8a1868490 100644 (file)
@@ -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")
index 419f808066866a03c9bade957ea04be59582a9bb..fd2e6b92f123c7381aeac5fe2c08c0fa6e3708b6 100644 (file)
@@ -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)