Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v1] kunit: relax regex for .config entries to allow spaces
@ 2020-04-09 22:28 Brendan Higgins
  0 siblings, 0 replies; only message in thread
From: Brendan Higgins @ 2020-04-09 22:28 UTC (permalink / raw)
  To: shuah, davidgow
  Cc: linux-kselftest, kunit-dev, linux-kernel, Daniel Latypov,
	Brendan Higgins

From: Daniel Latypov <dlatypov@google.com>

kunit parses .config in the `build_reconfig()` of `run_tests()`.
Problematically, the current regex '^CONFIG_\w+=\S+$' does not allow for
spaces anywhere after the "=", even the option is a string.

So kunit will refuse to run if the existing .config has something like
  CONFIG_CMDLINE="something and_something_else"
even if kunit.py will drop this entry when it regenerates the .config!

So relax the regex to allow entries that match `CONFIG_\w+=".*"` as a
minimal change. The question remains as to whether we should do any
validation of the string after the "=", however.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
---
 tools/testing/kunit/kunit_config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/kunit/kunit_config.py b/tools/testing/kunit/kunit_config.py
index e75063d603b5..0733796b0e32 100644
--- a/tools/testing/kunit/kunit_config.py
+++ b/tools/testing/kunit/kunit_config.py
@@ -10,7 +10,7 @@ import collections
 import re
 
 CONFIG_IS_NOT_SET_PATTERN = r'^# CONFIG_(\w+) is not set$'
-CONFIG_PATTERN = r'^CONFIG_(\w+)=(\S+)$'
+CONFIG_PATTERN = r'^CONFIG_(\w+)=(".*"|\S+)$'
 
 KconfigEntryBase = collections.namedtuple('KconfigEntry', ['name', 'value'])
 

base-commit: c0cc271173b2e1c2d8d0ceaef14e4dfa79eefc0d
-- 
2.26.0.110.g2183baf09c-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-09 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09 22:28 [PATCH v1] kunit: relax regex for .config entries to allow spaces Brendan Higgins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox