[7/7] test/zdtm: do not allow running with --lazy-pages on kernel without uffd

Submitted by Mike Rapoport on Aug. 15, 2017, 6:23 a.m.

Details

Message ID 1502778234-24415-8-git-send-email-rppt@linux.vnet.ibm.com
State New
Series "lazy-pages: update checks for availability of userfaultfd"
Headers show

Commit Message

Mike Rapoport Aug. 15, 2017, 6:23 a.m.
Raise an exception for kernels that do not have userfaultfd. For the
kernels that have userfaultfd but do not provide non-cooperative events
(4.3 - 4.11) just print a warning.

Fixes: #363

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 test/zdtm.py | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 6dfee2d..13c216d 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1769,6 +1769,15 @@  def run_tests(opts):
 		if subprocess.Popen(["ip", "netns", "exec", "zdtm_netns", "ip", "link", "set", "up", "dev", "lo"]).wait():
 			raise Exception("ip link set up dev lo")
 
+	if opts['lazy_pages'] or opts['remote_lazy_pages']:
+		uffd = criu.check("uffd")
+		uffd_noncoop = criu.check("uffd-noncoop")
+		if not uffd:
+			raise Exception("UFFD is not supported, cannot run with --lazy-pages")
+		if not uffd_noncoop:
+			# Most tests will work with 4.3 - 4.11
+			print "[WARNING] Non-cooperative UFFD is missing, some tests might spuriously fail"
+
 	l = launcher(opts, len(torun))
 	try:
 		for t in torun: