]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/env python | |
2 | ||
3 | # | |
4 | # Seccomp Library test program | |
5 | # | |
6 | # Copyright (c) 2015 Red Hat <pmoore@redhat.com> | |
7 | # Author: Paul Moore <paul@paul-moore.com> | |
8 | # | |
9 | # Adapted from 29-sim-arch_x86.c by Mathias Krause <minipli@googlemail.com> | |
10 | # | |
11 | ||
12 | # | |
13 | # This library is free software; you can redistribute it and/or modify it | |
14 | # under the terms of version 2.1 of the GNU Lesser General Public License as | |
15 | # published by the Free Software Foundation. | |
16 | # | |
17 | # This library is distributed in the hope that it will be useful, but WITHOUT | |
18 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
19 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
20 | # for more details. | |
21 | # | |
22 | # You should have received a copy of the GNU Lesser General Public License | |
23 | # along with this library; if not, see <http://www.gnu.org/licenses>. | |
24 | # | |
25 | ||
26 | import argparse | |
27 | import sys | |
28 | ||
29 | import util | |
30 | ||
31 | from seccomp import * | |
32 | ||
33 | def test(args): | |
34 | f = SyscallFilter(ALLOW) | |
35 | f.remove_arch(Arch()) | |
36 | # add x86-64 and x86 (in that order!) but explicitly leave out x32 | |
37 | f.add_arch(Arch("x86_64")) | |
38 | f.add_arch(Arch("x86")) | |
39 | f.add_rule(ERRNO(1), "close") | |
40 | return f | |
41 | ||
42 | args = util.get_opt() | |
43 | ctx = test(args) | |
44 | util.filter_output(args, ctx) | |
45 | ||
46 | # kate: syntax python; | |
47 | # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off; |