Commit c0857d25 authored by Andrei Vagin's avatar Andrei Vagin

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: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Acked-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8494d708
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment