Skip to content

Commit e3ed3b3

Browse files
committed
qa: do read checks with non-empty file
Linux will optimize out reads to a file known to be empty. Fixes: https://tracker.ceph.com/issues/53859 Signed-off-by: Patrick Donnelly <[email protected]>
1 parent aaee958 commit e3ed3b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

qa/tasks/cephfs/test_pool_perm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66

77
class TestPoolPerm(CephFSTestCase):
88
def test_pool_perm(self):
9-
self.mount_a.run_shell(["touch", "test_file"])
9+
self.mount_a.run_shell_payload("dd if=/dev/urandom of=test_file bs=4k count=1")
1010

1111
file_path = os.path.join(self.mount_a.mountpoint, "test_file")
1212

1313
remote_script = dedent("""
1414
import os
1515
import errno
1616
17-
fd = os.open("{path}", os.O_RDWR)
17+
fd = os.open("{path}", os.O_RDWR | os.O_SYNC)
1818
try:
1919
if {check_read}:
2020
ret = os.read(fd, 1024)
2121
else:
22-
os.write(fd, b'content')
22+
os.pwrite(fd, b'content', 0)
2323
except OSError as e:
2424
if e.errno != errno.EPERM:
2525
raise

0 commit comments

Comments
 (0)