Replace the "+all" architecture tokens in the test files with the "+all_le" and "+all_be" tokens to represent all the little endian and big endian architectures respectively.
Signed-off-by: Paul Moore <[email protected]> --- src/db.c | 2 +- tests/16-sim-arch_basic.tests | 12 ++++++------ tests/23-sim-arch_all_basic.tests | 14 +++++++------- tests/regression | 9 ++++++--- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/db.c b/src/db.c index 8694bac..e3086bd 100644 --- a/src/db.c +++ b/src/db.c @@ -668,7 +668,7 @@ int db_col_db_remove(struct db_filter_col *col, uint32_t arch_token) } col->filters[--col->filter_cnt] = NULL; - if (col->filters > 0) { + if (col->filter_cnt > 0) { /* NOTE: if we can't do the realloc it isn't fatal, we just * have some extra space allocated */ dbs = realloc(col->filters, diff --git a/tests/16-sim-arch_basic.tests b/tests/16-sim-arch_basic.tests index 39917b5..f0d8086 100644 --- a/tests/16-sim-arch_basic.tests +++ b/tests/16-sim-arch_basic.tests @@ -8,12 +8,12 @@ test type: bpf-sim # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result -16-sim-arch_basic +all read 0 0x856B008 10 N N N ALLOW -16-sim-arch_basic +all read 1-10 0x856B008 10 N N N KILL -16-sim-arch_basic +all write 1-2 0x856B008 10 N N N ALLOW -16-sim-arch_basic +all write 3-10 0x856B008 10 N N N KILL -16-sim-arch_basic +all close N N N N N N ALLOW -16-sim-arch_basic +all open 0x856B008 4 N N N N KILL +16-sim-arch_basic +all_le read 0 0x856B008 10 N N N ALLOW +16-sim-arch_basic +all_le read 1-10 0x856B008 10 N N N KILL +16-sim-arch_basic +all_le write 1-2 0x856B008 10 N N N ALLOW +16-sim-arch_basic +all_le write 3-10 0x856B008 10 N N N KILL +16-sim-arch_basic +all_le close N N N N N N ALLOW +16-sim-arch_basic +all_le open 0x856B008 4 N N N N KILL 16-sim-arch_basic +x86 socket 1 N N N N N ALLOW 16-sim-arch_basic +x86 connect 3 N N N N N ALLOW 16-sim-arch_basic +x86 shutdown 13 N N N N N ALLOW diff --git a/tests/23-sim-arch_all_basic.tests b/tests/23-sim-arch_all_basic.tests index 980268f..ecb7589 100644 --- a/tests/23-sim-arch_all_basic.tests +++ b/tests/23-sim-arch_all_basic.tests @@ -9,13 +9,13 @@ test type: bpf-sim # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result -23-sim-arch_all_basic +all read 0 0x856B008 10 N N N ALLOW -23-sim-arch_all_basic +all read 1-10 0x856B008 10 N N N KILL -23-sim-arch_all_basic +all write 1-2 0x856B008 10 N N N ALLOW -23-sim-arch_all_basic +all write 3-10 0x856B008 10 N N N KILL -23-sim-arch_all_basic +all close N N N N N N ALLOW -23-sim-arch_all_basic +all rt_sigreturn N N N N N N ALLOW -23-sim-arch_all_basic +all open 0x856B008 4 N N N N KILL +23-sim-arch_all_basic +all_le read 0 0x856B008 10 N N N ALLOW +23-sim-arch_all_basic +all_le read 1-10 0x856B008 10 N N N KILL +23-sim-arch_all_basic +all_le write 1-2 0x856B008 10 N N N ALLOW +23-sim-arch_all_basic +all_le write 3-10 0x856B008 10 N N N KILL +23-sim-arch_all_basic +all_le close N N N N N N ALLOW +23-sim-arch_all_basic +all_le rt_sigreturn N N N N N N ALLOW +23-sim-arch_all_basic +all_le open 0x856B008 4 N N N N KILL test type: bpf-sim-fuzz diff --git a/tests/regression b/tests/regression index 4901539..b83e8a2 100755 --- a/tests/regression +++ b/tests/regression @@ -21,7 +21,8 @@ # along with this library; if not, see <http://www.gnu.org/licenses>. # -GLBL_ARCH_SUPPORT="x86 x86_64 x32 arm mipsel" +GLBL_ARCH_LE_SUPPORT="x86 x86_64 x32 arm mipsel" +GLBL_ARCH_BE_SUPPORT="mips" GLBL_SYS_ARCH="../tools/scmp_arch_detect" GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver" @@ -344,8 +345,10 @@ function run_test_bpf_sim() { if [[ "${testarch:0:1}" == "+" ]]; then # run the tests on the specified architecture(s) simarch_list="${testarch:1}" - if [[ "$simarch_list" == "all" ]]; then - simarch_list="$GLBL_ARCH_SUPPORT" + if [[ "$simarch_list" == "all_le" ]]; then + simarch_list="$GLBL_ARCH_LE_SUPPORT" + elif [[ "$simarch_list" == "all_be" ]]; then + simarch_list="$GLBL_ARCH_BE_SUPPORT" fi elif [[ "$testarch" != "all" ]] && [[ "$testarch" != "$arch" ]]; then # only run tests that match the current architecture ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ libseccomp-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss
