[CRIU] [PATCH 9/9] test: zdtm -- Add proc-self test
Pavel Emelyanov
xemul at parallels.com
Fri May 17 10:03:44 EDT 2013
On 05/17/2013 05:20 PM, Cyrill Gorcunov wrote:
>
> Just open /proc/self/ns/net and check if
> it remains the same on restore.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> test/zdtm/live/static/Makefile | 1 +
> test/zdtm/live/static/proc-self.c | 75 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 76 insertions(+)
> create mode 100644 test/zdtm/live/static/proc-self.c
>
> + if (read_fd_link(fd_self, path_orig, sizeof(path_orig))) {
> + err("Can't fill original path");
> + return -1;
> + }
> +
> + test_daemon();
> + test_waitsig();
> +
> + if (read_fd_link(fd_self, path_new, sizeof(path_new))) {
> + err("Can't fill new path");
> + return -1;
> + }
> +
> + if (memcmp(path_orig, path_new, sizeof(NS_ENTRY) - 1)) {
This can't PASS strictly speaking. On restore we create _another_ namespace and
do not guarantee that kernel creates the same ID for namespace. See
http://criu.org/What_can_change_after_C/R
> + fail("Paths mismatch %s %s\n", path_orig, path_new);
> + return -1;
> + }
More information about the CRIU
mailing list