From e9703d454f6ca9824623a5c2b12860c51c8032d5 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 3 Feb 2018 16:50:12 +0100 Subject: 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. --- testsuite.py | 12 +++++++----- 1 file 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 -- cgit v1.2.3