Skip to contentSkip to conversation

selftests: add mincore() tests

PATCH Applied Ricardo Cañuelo 1 participant 1 message Jul 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: add mincore() tests

Add a test suite for the mincore() syscall. It tests most of its use cases as well as its interface.

Tests implemented:

- basic interface test
- behavior on anonymous mappings
- behavior on anonymous mappings with huge tlb pages
- file-backed mapping with a regular file
- file-backed mapping with a tmpfs file

---
Tested in next-20200727 with:

make -C tools/testing/selftests

and

make -C tools/testing/selftests run_tests

 tools/testing/selftests/Makefile              |   1 +
 tools/testing/selftests/mincore/.gitignore    |   2 +
 tools/testing/selftests/mincore/Makefile      |   6 +
 .../selftests/mincore/mincore_selftest.c      | 361 ++++++++++++++++++
 4 files changed, 370 insertions(+)
 create mode 100644 tools/testing/selftests/mincore/.gitignore
 create mode 100644 tools/testing/selftests/mincore/Makefile
 create mode 100644 tools/testing/selftests/mincore/mincore_selftest.c
tools/testing/selftests/Makefile +1 -0
index e03bc15ce731..9018f45d631d 100644
@@ -32,6 +32,7 @@ TARGETS += lkdtm
 TARGETS += membarrier
 TARGETS += memfd
 TARGETS += memory-hotplug
+TARGETS += mincore
 TARGETS += mount
 TARGETS += mqueue
 TARGETS += net
tools/testing/selftests/mincore/.gitignore new file +2 -0
new file mode 100644
index 000000000000..15c4dfc2df00
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0+
+mincore_selftest
tools/testing/selftests/mincore/Makefile new file +6 -0
new file mode 100644
index 000000000000..38c7db1e8926
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+CFLAGS += -Wall
+
+TEST_GEN_PROGS := mincore_selftest
+include ../lib.mk
tools/testing/selftests/mincore/mincore_selftest.c new file +361 -0

361 lines not on this page · raw message

Signature · 1 line
2.18.0