On Tue, Jun 30, 2020 at 2:19 PM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > On Tue, Jun 30, 2020 at 1:32 PM Jesper Dangaard Brouer > <brouer@xxxxxxxxxx> wrote: > > > > On Tue, 30 Jun 2020 08:46:01 -0700 > > Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > > > > > @@ -688,9 +700,17 @@ int main(int argc, char **argv) > > > > cleanup_cgroup_environment(); > > > > } > > > > stdio_restore(); > > > > + > > > > + if (env.list_test_names) { > > > > + if (env.succ_cnt == 0) > > > > + env.fail_cnt = 1; > > > > + goto out; > > > > + } > > > > + > > > > > > Why failure if no test matched? Is that to catch bugs in whitelisting? > > > > I would not call it catch bugs, but sort of. The purpose is to know if > > requested test is valid. This can be used to e.g. run through all the > > tests numbers, and stopping when a test number (-n) is no-longer valid, > > by using this shell exit value as a test, like: > > > > n=1; > > while [ $(./test_progs --list -n $n) ] ; do \ > > echo "./test_progs -n $n" ; n=$(( n+1 )); \ > > done > > > > Notice that this features that be used for looking up a test number, > > and returning a testname, which was the original request from CI. I > > choose this implementation as it more generic and generally useful. > > > > $ ./test_progs --list -n 89 > > xdp_adjust_tail > > > > Yeah, it has a nice querying effect. Makes sense. > > Acked-by: Andrii Nakryiko <andriin@xxxxxx> hmm. it doesn't apply. Applying: selftests/bpf: Test_progs option for listing test names error: sha1 information is lacking or useless (tools/testing/selftests/bpf/test_progs.c). error: could not build fake ancestor Patch failed at 0001 selftests/bpf: Test_progs option for listing test names Could you please respin. Thanks