criu/test
Zeyad Yasser fc7705a13f zdtm: add network namespace locking test
When criu dumps a process in a network namespace it locks
the network so that no packets from peer enters the stack,
otherwise RST will be sent by a kernel causing the connection
to fail.

In netns_lock.c we try to enter the netns created by post-start
hook so that criu locks the network namespace between dump and
restore.

A TCP server is started in post-start hook inside the test netns
and runs in the background detached from its parent so that
it stays alive for the duration of the test.

Other hooks (pre-dump, pre-restore, post-restore) try to
connect to the server.

Pre-dump and post-restore hooks should be able to connect
successfully.

Pre-restore hook client with SOCCR_MARK should also connect
successfully.

Pre-restore hook client without SOCCR_MARK should not be able
to connect but also should not get connection refused as all
packets are dropped in the namespace so the kernel shouldn't
send an RST packet as a result. Instead we check that the
connect operation causes a timeout.

This test would be useful when testing that the network is
locked using different ways (using iptables currently and
other methods later).

v2:
	- check that packets with SOCCR_MARK are allowed to
	  pass when the netns is locked.

v3:
	- fix pre-restore hook skipping non SOCCR_MARK
	  connection test due to early exit in SOCCR_MARK
	  variant.

Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
2021-09-03 10:31:00 -07:00
..
compel compel: Provide piegen_opt_t in library 2019-04-20 20:25:26 -07:00
exhaustive py: Reformat everything into pep8 style 2019-09-07 15:59:56 +03:00
inhfd vim: remove wrong 8-space tabs indent from python files 2021-09-03 10:31:00 -07:00
javaTests javaTests: Add --file-locks option 2021-09-03 10:31:00 -07:00
jenkins fault-injection: Run fpu corruption tests 2021-09-03 10:31:00 -07:00
others test: remove exec test 2021-09-03 10:31:00 -07:00
pki test: create new tls certificates 2021-09-03 10:31:00 -07:00
zdtm zdtm: add network namespace locking test 2021-09-03 10:31:00 -07:00
.gitignore zdtm: Add javaTests output to .gitignore 2021-09-03 10:31:00 -07:00
abrt.sh test/abrt: skip core dumps from the seccomp_filter test 2019-04-20 20:25:26 -07:00
check_actions.py test/other: Resolve Py3 compatibility issues 2019-09-07 15:59:56 +03:00
crit-recode.py vim: remove wrong 8-space tabs indent from python files 2021-09-03 10:31:00 -07:00
empty-netns-prep.sh test: don't use nsenter in tests 2017-05-19 09:17:20 +03:00
groups.desc zdtm.py: Generator of groups of tests 2015-12-08 14:54:41 +03:00
inhfd.desc zdtm.py: Add inhfd tests for --inherit-fd option 2015-10-19 12:42:01 +03:00
Makefile Modify and add test for configuration file functionality 2018-10-30 19:27:52 +03:00
pycriu Adapt zdtm for python3 compatibility 2018-07-09 18:25:16 +03:00
show_action.sh test: Check action scripts to work as we expect 2016-05-06 14:39:25 +03:00
umount2.c zdtm: add a program to umount a test root 2016-09-26 15:42:40 +03:00
zdtm.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
zdtm.py zdtm: allow ignore taint via environment variable 2021-09-03 10:31:00 -07:00
zdtm_ct.c test: skip time namespaced tests on <= 5 2021-09-03 10:31:00 -07:00
zdtm_mount_cgroups tests: prevent zdtm_mount_cgroups from failing w/ EBUSY 2016-02-03 16:25:28 +03:00
zdtm_umount_cgroups zdtm: cleanup zdtmtst and zdtmtst.defaultroot cgroups after finishing test 2018-10-30 19:27:58 +03:00