From: Rishabh Dave Date: Wed, 11 Dec 2019 07:04:03 +0000 (+0530) Subject: test_cephfs_shell: fix test_du_works_for_hardlinks X-Git-Tag: v15.1.0~428^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e11b5b5e7a0ebdf7f7527f359a4dcdf8bf9deb8;p=ceph.git test_cephfs_shell: fix test_du_works_for_hardlinks ln command needs superuser privileges, oddly that test had run successfully before. Fixes: https://tracker.ceph.com/issues/43250 Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 5835e3f1ac89..013a59931b6f 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -456,10 +456,12 @@ class TestDU(TestCephFSShell): def test_du_works_for_hardlinks(self): regfilename = 'some_regfile' regfile_abspath = path.join(self.mount_a.mountpoint, regfilename) - sudo_write_file(self.mount_a.client_remote, regfile_abspath, 'somedata') + sudo_write_file(self.mount_a.client_remote, regfile_abspath, + 'somedata') hlinkname = 'some_hardlink' hlink_abspath = path.join(self.mount_a.mountpoint, hlinkname) - self.mount_a.run_shell(['ln', regfile_abspath, hlink_abspath]) + self.mount_a.run_shell(['sudo', 'ln', regfile_abspath, + hlink_abspath], omit_sudo=False) size = humansize(self.mount_a.stat(hlink_abspath)['st_size']) expected_output = r'{}{}{}'.format(size, " +", hlinkname) @@ -510,8 +512,8 @@ class TestDU(TestCephFSShell): "expected_output -\n{}\ndu_output -\n{}\n".format( expected_output, du_output) - # NOTE: tests using these are pretty slow since to this methods sleeps for 15 - # seconds. + # NOTE: tests using these are pretty slow since to this methods sleeps for + # 15 seconds def _setup_files(self, return_path_to_files=False, path_prefix='./'): dirname = 'dir1' regfilename = 'regfile'