From: Eugene Syromyatnikov Date: Sat, 16 Sep 2017 00:59:10 +0000 (+0200) Subject: tests/kcmp: add more checks X-Git-Tag: v4.20~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cddc598da17250fb0230ad028274f39eb6ca306;p=strace tests/kcmp: add more checks Let's check all kcmp commands that they indeed do not print idx1/idx2. Also, check that upper bits of pid arguments are ignored. * tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22. * tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all kcmp types not tested before. --- diff --git a/tests/gen_tests.in b/tests/gen_tests.in index 50e62a02..9f398e03 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -143,7 +143,7 @@ ipc -a19 ipc_msg +ipc.sh ipc_sem +ipc.sh ipc_shm +ipc.sh -kcmp -a27 +kcmp -a22 kexec_file_load -s9 kexec_load -s9 keyctl -a31 -s10 diff --git a/tests/kcmp.c b/tests/kcmp.c index e3425cdf..46bb173c 100644 --- a/tests/kcmp.c +++ b/tests/kcmp.c @@ -47,6 +47,11 @@ # include # else # define KCMP_FILE 0 +# define KCMP_VM 1 +# define KCMP_FILES 2 +# define KCMP_FS 3 +# define KCMP_SIGHAND 4 +# define KCMP_IO 5 # define KCMP_SYSVSEM 6 # endif @@ -93,12 +98,19 @@ main(void) /* Invalid values */ do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, bogus_idx2); - do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + do_kcmp(F8ILL_KULONG_MASK, F8ILL_KULONG_MASK, KCMP_SYSVSEM + 1, NULL, + 0, 0); /* KCMP_FILE is the only type which has additional args */ do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, bogus_idx2); - /* Some type without additional args */ + + /* Types without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_VM), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FILES), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FS), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_SIGHAND), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_IO), bogus_idx1, bogus_idx2); do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); puts("+++ exited with 0 +++");