[PATCH v2] tests: add tests for PR_CAP_AMBIENT, PR_CAPBSET_READ, PR_CAPBSET_DROP, PR_[GS]ET_FP_MODE, PR_MCE_KILL, PR_SVE_[GS]ET_VL, PR_[GS]ET_UNALIGN

Srikavin Ramkumar srikavinramkumar at gmail.com
Thu Jun 3 07:47:57 UTC 2021


On Wed Jun 2, 2021 at 4:59 PM EDT, Dmitry V. Levin wrote:
> We've got quite a few of these ugly grep expressions already,
> and I'd prefer to replace all of them with something more robust.
>
> What if we start every prctl test with a marker, e.g.
> syscall(__NR_prctl, -1U, -2U, -3U, -4U, -5U);
> and filter out all prctl lines up to this marker from the log, e.g.
> sed '0,/^prctl(0xffffffff \/\* PR_??? \*\/, 0xfffffffe, 0xfffffffd,
> 0xfffffffc, 0xfffffffb) = -1 /d' \
> < "$LOG" > "$OUT"
>
> When these ugly grep commands are replaced with this sed command,
> most of our tests/prctl-*.test files would become essentially the same,
> so it would make sense to create a universal tests/prctl.sh file
> and use it in other prctl tests, most of them could be generated
> from tests/gen_tests.in the same way as many ioctl.test based tests
> (grep '+ioctl.test -' tests/gen_tests.in).
>
> What do you think about this approach?
>

I think this could be a nice way of cleaning up these tests. I'll make these
changes and send in a V3.



More information about the Strace-devel mailing list