Skip to content

Commit

Permalink
lib: check kconfig file existence in tst_has_slow_kconfig
Browse files Browse the repository at this point in the history
In the GitHub CI environment, or certain images used during testing,
the kconfig files might not be present. Without checking for the
existence of the kconfig path, the test attempts to read a non-existent
file, leading to errors or test failures.

  tst_kconfig.c:207: TBROK: Cannot parse kernel .config

Signed-off-by: Li Wang <[email protected]>
  • Loading branch information
wangli5665 committed Dec 18, 2024
1 parent 2da30df commit 64e11fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tst_kconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@ static struct tst_kconfig_var slow_kconfigs[] = {
int tst_has_slow_kconfig(void)
{
unsigned int i;
char path_buf[1024];

if (!kconfig_path(path_buf, sizeof(path_buf)))
return 0;

tst_kconfig_read(slow_kconfigs, ARRAY_SIZE(slow_kconfigs));

Expand Down

0 comments on commit 64e11fe

Please sign in to comment.