summaryrefslogtreecommitdiff
path: root/tests/26-sim-arch_all_be_basic.py
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-04-23 16:06:30 +0100
committerPaul Moore <pmoore@redhat.com>2014-04-25 16:18:46 -0400
commit0294b5867feddc02661e67a4909ea99e8e4aa082 (patch)
treee4d3bec3f8d5e98e25b1344410e7178582d008ad /tests/26-sim-arch_all_be_basic.py
parent6b98114f4e4755d1911730fd303cb8e3a1057873 (diff)
downloadlibseccomp-0294b5867feddc02661e67a4909ea99e8e4aa082.tar.gz
tests: Add new test for big-endian architectures
The new test is similar to 23-sim-arch_all_le_basic Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'tests/26-sim-arch_all_be_basic.py')
-rwxr-xr-xtests/26-sim-arch_all_be_basic.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/26-sim-arch_all_be_basic.py b/tests/26-sim-arch_all_be_basic.py
new file mode 100755
index 0000000..a2a58d1
--- /dev/null
+++ b/tests/26-sim-arch_all_be_basic.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+#
+# Seccomp Library test program
+#
+# Author: Markos Chandras <markos.chandras@imgtec.com>
+#
+
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of version 2.1 of the GNU Lesser General Public License as
+# published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+# for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, see <http://www.gnu.org/licenses>.
+#
+
+import argparse
+import sys
+
+import util
+
+from seccomp import *
+
+def test(args):
+ f = SyscallFilter(KILL)
+ # Remove the native arch token. We will add the arch tokens
+ # ourselves.
+ f.remove_arch(Arch.NATIVE)
+ if not f.exist_arch(Arch.MIPS):
+ f.add_arch(Arch.MIPS)
+ f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
+ f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
+ f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
+ f.add_rule(ALLOW, "close")
+ f.add_rule(ALLOW, "rt_sigreturn")
+ return f
+
+args = util.get_opt()
+ctx = test(args)
+util.filter_output(args, ctx)
+
+# kate: syntax python;
+# kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;