summaryrefslogtreecommitdiff
path: root/tests/23-sim-arch_all_le_basic.py
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-04-23 16:06:29 +0100
committerPaul Moore <pmoore@redhat.com>2014-04-25 16:11:50 -0400
commit6b98114f4e4755d1911730fd303cb8e3a1057873 (patch)
tree89461cfa170f7c6591d968c7eea5191e60752910 /tests/23-sim-arch_all_le_basic.py
parenta7ab522fa9b2d3edcef9cae01df139eb8b7b7d74 (diff)
downloadlibseccomp-6b98114f4e4755d1911730fd303cb8e3a1057873.tar.gz
tests: Rename 23-sim-arch_all_basic to 23-sim-arch_all_le_basic
This test is for little endian architectures, so we rename it to make that clear. This is in preparation for a new test, identical to this one, which will test big-endian architectures. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'tests/23-sim-arch_all_le_basic.py')
-rwxr-xr-xtests/23-sim-arch_all_le_basic.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/23-sim-arch_all_le_basic.py b/tests/23-sim-arch_all_le_basic.py
new file mode 100755
index 0000000..eb3f478
--- /dev/null
+++ b/tests/23-sim-arch_all_le_basic.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+
+#
+# Seccomp Library test program
+#
+# Copyright (c) 2012 Red Hat <pmoore@redhat.com>
+# Author: Paul Moore <pmoore@redhat.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)
+ if not f.exist_arch(Arch.X86):
+ f.add_arch(Arch.X86)
+ 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)
+ if not f.exist_arch(Arch.MIPSEL):
+ f.add_arch(Arch.MIPSEL)
+ 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;