diff --git a/tests/54-live-binary_tree.c b/tests/54-live-binary_tree.c index cd4e9e42..16378dcb 100644 --- a/tests/54-live-binary_tree.c +++ b/tests/54-live-binary_tree.c @@ -30,7 +30,6 @@ #include "util.h" -/* arbitrary list of syscalls to force seccomp to generate a binary tree */ static const int denylist[] = { SCMP_SYS(times), SCMP_SYS(ptrace), @@ -87,6 +86,9 @@ int main(int argc, char *argv[]) if (ctx == NULL) return ENOMEM; + rc = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_OPTIMIZE, 2); + if (rc < 0) + goto out; rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1, SCMP_A0(SCMP_CMP_EQ, fd)); if (rc != 0) diff --git a/tests/54-live-binary_tree.py b/tests/54-live-binary_tree.py index 22509388..2bc7386a 100755 --- a/tests/54-live-binary_tree.py +++ b/tests/54-live-binary_tree.py @@ -62,6 +62,7 @@ def test(): util.install_trap() f = SyscallFilter(TRAP) f.set_attr(Attr.CTL_TSYNC, 1) + f.set_attr(Attr.CTL_OPTIMIZE, 2) # NOTE: additional syscalls required for python f.add_rule(ALLOW, "stat") f.add_rule(ALLOW, "fstat")