Signed-off-by: Paul Moore <[email protected]>
---
tests/16-arch-basic.c | 14 ++++++++++++--
tests/16-arch-basic.py | 8 ++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/tests/16-arch-basic.c b/tests/16-arch-basic.c
index f2d122c..5b02cca 100644
--- a/tests/16-arch-basic.c
+++ b/tests/16-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-arch-basic.py b/tests/16-arch-basic.py
index e23d18b..4484ac5 100755
--- a/tests/16-arch-basic.py
+++ b/tests/16-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))
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
libseccomp-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss