Skip to contentSkip to conversation

generic: add OFD lock tests

PATCH New Xiong Zhou 1 participant 1 message Oct 11, 2017

lore
Share & tools
lore

Xiong Zhou

author
#0 lore raw

PATCH 1/1 generic: add OFD lock tests

The basic idea is placing a type of lock, eg WRLCK, on a testfile in SCRATCH_MNT, then do fcntl getlk with a type of lock, eg RDLCK, checking the returned flock struct to see if it works fine.

We can also test these situations:
that the two locks are conflicting or not;
that open testfile RDONLY or RDWR.

---
 .gitignore            |   1 +
 src/Makefile          |   3 +-
 src/t_ofd_locks.c     | 129 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/463     | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/463.out |   2 +
 tests/generic/group   |   1 +
 6 files changed, 268 insertions(+), 1 deletion(-)
 create mode 100644 src/t_ofd_locks.c
 create mode 100755 tests/generic/463
 create mode 100644 tests/generic/463.out
.gitignore +1 -0
index ae7ef87..2824c3d 100644
@@ -126,6 +126,7 @@
 /src/t_mmap_write_ro
 /src/t_mmap_writev
 /src/t_mtab
+/src/t_ofd_locks
 /src/t_readdir_1
 /src/t_readdir_2
 /src/t_rename_overwrite
src/Makefile +2 -1
index 3eb25b1..f37af74 100644
@@ -13,7 +13,8 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
 	multi_open_unlink dmiperf unwritten_sync genhashnames t_holes \
 	t_mmap_writev t_truncate_cmtime dirhash_collide t_rename_overwrite \
 	holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \
-	t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro
+	t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \
+	t_ofd_locks
 
 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
 	preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
src/t_ofd_locks.c new file +129 -0

129 lines not on this page · raw message

tests/generic/463 new file +133 -0

133 lines not on this page · raw message

tests/generic/463.out new file +2 -0
new file mode 100644
index 0000000..dd61371
@@ -0,0 +1,2 @@
+QA output created by 463
+Silence is golden
tests/generic/group +1 -0
index f2a6cda..9031e84 100644
@@ -465,3 +465,4 @@
 460 auto quick rw
 461 auto shutdown stress
 462 auto quick dax
+463 auto quick
Signature · 1 line
1.8.3.1