Skip to content

Commit e6d45f5

Browse files
leitaokuba-moo
authored andcommitted
tests: check_selftest: fix error wording
while testing check_selftest on my patch, which contains the following order: CONFIG_NET_SCH_INGRESS=y CONFIG_NETCONSOLE=m It printed the following error, which is clearly wrong: Validation errors in tools/testing/selftests/drivers/net/bonding/config: Lines 14-15 invalid order, CONFIG_NETCONSOLE=m should be after CONFIG_NET_SCH_INGRESS=y Fix the wording saying that current line should come before the previous one, given there is an error and current line is already after previous line. Also rename variables to make the code easier to reason about. Signed-off-by: Breno Leitao <[email protected]> Fixes: af02b9f ("tests: make check_selftests check format of Makefiles and configs")
1 parent b327707 commit e6d45f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/patch/check_selftest/validate_config_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ def extract_key(raw):
1111
return k
1212

1313

14-
def check_one(a, b, line):
15-
_a = extract_key(a)
16-
_b = extract_key(b)
14+
def check_one(current, prev, line):
15+
_current = extract_key(current)
16+
_prev = extract_key(prev)
1717

18-
if _a >= _b:
18+
if _current >= _prev:
1919
return None
2020

21-
return f"Lines {line}-{line+1} invalid order, {a} should be after {b}"
21+
return f"Lines {line}-{line+1} invalid order, {current} should be before {prev}"
2222

2323

2424
def validate_config(file_path):

0 commit comments

Comments
 (0)