lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 Aug 2021 15:40:40 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Riccardo Mancini <rickyman7@...il.com>
Cc:     Ian Rogers <irogers@...gle.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf test: make --skip work on shell tests

Em Wed, Aug 11, 2021 at 08:06:26PM +0200, Riccardo Mancini escreveu:
> perf-test has the option --skip to provide a list of tests to skip.
> However, this option does not work with shell scripts.
> 
> This patch passes the skiplist to run_shell_tests, so that also shell
> scripts could be skipped using --skip.

In such cases please provide an example of the usage you're fixing, what
was it that you tried that didn't work and that now works?

Its obviously a fix, so I'm applying it.

- Arnaldo
 
> Signed-off-by: Riccardo Mancini <rickyman7@...il.com>
> ---
>  tools/perf/tests/builtin-test.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index 5e6242576236325c..fb4a75cc8fa9530e 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -594,7 +594,8 @@ static int shell_test__run(struct test *test, int subdir __maybe_unused)
>  	return WEXITSTATUS(err) == 2 ? TEST_SKIP : TEST_FAIL;
>  }
>  
> -static int run_shell_tests(int argc, const char *argv[], int i, int width)
> +static int run_shell_tests(int argc, const char *argv[], int i, int width,
> +				struct intlist *skiplist)
>  {
>  	struct dirent **entlist;
>  	struct dirent *ent;
> @@ -628,6 +629,12 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width)
>  
>  		st.file = ent->d_name;
>  		pr_info("%2d: %-*s:", i, width, test.desc);
> +
> +		if (intlist__find(skiplist, i)) {
> +			color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
> +			continue;
> +		}
> +
>  		test_and_print(&test, false, -1);
>  	}
>  
> @@ -727,7 +734,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
>  		}
>  	}
>  
> -	return run_shell_tests(argc, argv, i, width);
> +	return run_shell_tests(argc, argv, i, width, skiplist);
>  }
>  
>  static int perf_test__list_shell(int argc, const char **argv, int i)
> -- 
> 2.31.1
> 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ