2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

zdtm: check /proc/sys/kernel/taint and fail if it is non-zero

We don't want to run tests, if a kernel has a problem. And we want
to know when the taint flag is changed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin
2017-06-30 04:10:29 +03:00
parent 8494d70833
commit c0857d2517

View File

@@ -1389,6 +1389,11 @@ class launcher:
print >> self.__file_report, "# Timestamp: " + now.strftime("%Y-%m-%d %H:%M") + " (GMT+1)"
print >> self.__file_report, "# "
print >> self.__file_report, "1.." + str(nr_tests)
self.__taint = open("/proc/sys/kernel/tainted").read()
if int(self.__taint, 0) != 0:
print "The kernel is tainted: %r" % self.__taint
if not opts["ignore_taint"]:
raise Exception("The kernel is tainted: %r" % self.__taint)
def __show_progress(self, msg):
perc = self.__nr * 16 / self.__total
@@ -1408,6 +1413,10 @@ class launcher:
if len(self.__subs) >= self.__max:
self.wait()
taint = open("/proc/sys/kernel/tainted").read()
if self.__taint != taint:
raise Exception("The kernel is tainted: %r (%r)" % (taint, self.__taint))
if test_flag(desc, 'excl'):
self.wait_all()
@@ -1911,6 +1920,7 @@ rp.add_argument("-k", "--keep-img", help = "Whether or not to keep images after
choices = ['always', 'never', 'failed'], default = 'failed')
rp.add_argument("--report", help = "Generate summary report in directory")
rp.add_argument("--keep-going", help = "Keep running tests in spite of failures", action = 'store_true')
rp.add_argument("--ignore-taint", help = "Don't care about a non-zero kernel taint flag", action = 'store_true')
lp = sp.add_parser("list", help = "List tests")
lp.set_defaults(action = list_tests)