diff options
author | Paul Moore <pmoore@redhat.com> | 2013-01-31 09:26:55 -0500 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2013-03-28 11:33:14 -0400 |
commit | 505bf8270ea9dc389580b7c51b356a852bea92e9 (patch) | |
tree | da630a0b74e9899029778d53823bb4758b56bdc0 | |
parent | adac51bd79a2c289355ef53cb804b524427a0c96 (diff) | |
download | libseccomp-505bf8270ea9dc389580b7c51b356a852bea92e9.tar.gz |
tests: minor fixups due to the new arch support
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r-- | tests/16-sim-arch_basic.c | 14 | ||||
-rwxr-xr-x | tests/16-sim-arch_basic.py | 8 |
2 files changed, 18 insertions, 4 deletions
diff --git a/tests/16-sim-arch_basic.c b/tests/16-sim-arch_basic.c index f2d122c..5b02cca 100644 --- a/tests/16-sim-arch_basic.c +++ b/tests/16-sim-arch_basic.c @@ -40,16 +40,26 @@ int main(int argc, char *argv[]) if (ctx == NULL) goto out; - if (seccomp_arch_native() != SCMP_ARCH_X86) { + if (seccomp_arch_exist(ctx, SCMP_ARCH_X86)) { rc = seccomp_arch_add(ctx, SCMP_ARCH_X86); if (rc != 0) goto out; } - if (seccomp_arch_native() != SCMP_ARCH_X86_64) { + if (seccomp_arch_exist(ctx, SCMP_ARCH_X86_64)) { rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64); if (rc != 0) goto out; } + if (seccomp_arch_exist(ctx, SCMP_ARCH_X32)) { + rc = seccomp_arch_add(ctx, SCMP_ARCH_X32); + if (rc != 0) + goto out; + } + if (seccomp_arch_exist(ctx, SCMP_ARCH_ARM)) { + rc = seccomp_arch_add(ctx, SCMP_ARCH_ARM); + if (rc != 0) + goto out; + } rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1, SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO)); diff --git a/tests/16-sim-arch_basic.py b/tests/16-sim-arch_basic.py index e23d18b..4484ac5 100755 --- a/tests/16-sim-arch_basic.py +++ b/tests/16-sim-arch_basic.py @@ -30,10 +30,14 @@ from seccomp import * def test(args): f = SyscallFilter(KILL) - if not system_arch() == Arch.X86: + if not f.exist_arch(Arch.X86): f.add_arch(Arch.X86) - if not system_arch() == Arch.X86_64: + if not f.exist_arch(Arch.X86_64): f.add_arch(Arch.X86_64) + if not f.exist_arch(Arch.X32): + f.add_arch(Arch.X32) + if not f.exist_arch(Arch.ARM): + f.add_arch(Arch.ARM) f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin)) f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout)) f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr)) |