summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-02-03 16:50:12 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-02-03 18:13:22 +0100
commite9703d454f6ca9824623a5c2b12860c51c8032d5 (patch)
tree901be5a6b43e0d078ed898d2d9c5127680909737 /testsuite.py
parent1e40733b7caff0a5f84eee6775e851e1d32f95a9 (diff)
Set $KERNELVERSION properly in test suite
Don't think anything currently depends on it where it would matter for the test suite, but might as well.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/testsuite.py b/testsuite.py
index adcadfd..1a22b55 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -72,11 +72,13 @@ def verify_equal(x, y):
if x != y:
fail("'{}' does not equal '{}'".format(x, y))
-# Assign this to avoid warnings from Kconfiglib. Nothing in the kernel's
-# Kconfig files seems to actually look at the value as of 3.7.0-rc8. This is
-# only relevant for the test suite, as this will get set by the kernel Makefile
-# when using (i)scriptconfig.
-os.environ["KERNELVERSION"] = "1"
+# Referenced inside the kernel Kconfig files.
+#
+# The str() makes the type of the value 'str' on both Python 2 and Python 3,
+# which is nice for some later dictionary key sanity checks.
+os.environ["KERNELVERSION"] = str(
+ subprocess.check_output(("make", "kernelversion")).decode("utf-8").rstrip()
+)
# Prevent accidental loading of configuration files by removing
# KCONFIG_ALLCONFIG from the environment