Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
eb3fc256
Commit
eb3fc256
authored
Oct 03, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Basic checks for iptables save and restore
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
28014d7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
netns-nf.c
test/zdtm/live/static/netns-nf.c
+55
-0
No files found.
test/zdtm.sh
View file @
eb3fc256
...
@@ -123,6 +123,7 @@ static/msgque
...
@@ -123,6 +123,7 @@ static/msgque
static/sem
static/sem
transition/ipc
transition/ipc
ns/static/tun
ns/static/tun
static/netns-nf
"
"
TEST_CR_KERNEL
=
"
TEST_CR_KERNEL
=
"
...
...
test/zdtm/live/static/Makefile
View file @
eb3fc256
...
@@ -135,6 +135,7 @@ TST_FILE = \
...
@@ -135,6 +135,7 @@ TST_FILE = \
sockets_dgram
\
sockets_dgram
\
file_locks00
\
file_locks00
\
file_locks01
\
file_locks01
\
netns-nf
\
TST_DIR
=
\
TST_DIR
=
\
cwd00
\
cwd00
\
...
...
test/zdtm/live/static/netns-nf.c
0 → 100644
View file @
eb3fc256
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Check that netfilter rules (some) are kept"
;
const
char
*
test_author
=
"Pavel Emelianov <xemul@parallels.com>"
;
char
*
filename
;
TEST_OPTION
(
filename
,
string
,
"file name"
,
1
);
static
int
test_fn
(
int
argc
,
char
**
argv
)
{
char
cmd
[
128
];
if
(
system
(
"iptables -A INPUT -t filter --protocol icmp -j DROP"
))
{
err
(
"Can't set input rule"
);
return
-
1
;
}
sprintf
(
cmd
,
"iptables -L > pre-%s"
,
filename
);
if
(
system
(
cmd
))
{
err
(
"Can't save iptables"
);
return
-
1
;
}
test_daemon
();
test_waitsig
();
sprintf
(
cmd
,
"iptables -L > post-%s"
,
filename
);
if
(
system
(
cmd
))
{
fail
(
"Can't get iptables"
);
return
-
1
;
}
sprintf
(
cmd
,
"diff pre-%s post-%s"
,
filename
,
filename
);
if
(
system
(
cmd
))
{
fail
(
"Iptables differ"
);
return
-
1
;
}
pass
();
return
0
;
}
#define CLONE_NEWNET 0x40000000
int
main
(
int
argc
,
char
**
argv
)
{
test_init_ns
(
argc
,
argv
,
CLONE_NEWNET
,
test_fn
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment