Skip to content

Commit

Permalink
tests: Test pseudo-syscalls in the sim binary tree test
Browse files Browse the repository at this point in the history
Now that pseudo-syscalls are being explicitly removed from
the resultant BPF filter, we need to test for this in the
simulated binary tree test.  This commit modifies the test to
explicitly define its supported architectures and updates the
tests file to handle PNR syscalls.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
  • Loading branch information
drakenclimber committed Jul 1, 2020
1 parent 33dd62b commit 1eb9450
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/53-sim-binary_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ int main(int argc, char *argv[])
goto out;
}

rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
if (rc != 0)
goto out;

rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
if (rc != 0)
goto out;
rc = seccomp_arch_add(ctx, SCMP_ARCH_AARCH64);
if (rc != 0)
goto out;
rc = seccomp_arch_add(ctx, SCMP_ARCH_PPC64LE);
if (rc != 0)
goto out;

rc = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_OPTIMIZE, 2);
if (rc < 0)
goto out;
Expand Down

0 comments on commit 1eb9450

Please sign in to comment.