public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Matus Marhefka <mmarhefk@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2 v3] containers/netns tests rewritten
Date: Wed, 19 Aug 2015 18:26:21 +0200	[thread overview]
Message-ID: <20150819162621.GA2356@rei.suse.de> (raw)
In-Reply-To: <1244717184.10704034.1439998635401.JavaMail.zimbra@redhat.com>

Hi!
> mounting sysfs in a separate (net + mnt) namespace will cause that
> inside that namespace in /sys/class/net/ we will see only network
> devices local to the separated namespace including dummy device
> created by the test (without mounting sysfs we would see all the devices
> from main namespace). Now back in the main namespace we check that this
> mount had no influence on the main namespace (ls /sys/class/net >sysfs_after).
> I thought that test description says it clear.

So we are testing that mounting the /sys in new mount namespace does no
propagate to the main namespace?

In this case it makes sense.

Also do we want to assert that the dummy0 device is listed in the /sys
inside the namespace?

> To the namespace destroying: as NS_HANDLE is a pid of a process, which keeps
> namespace alive (see ns_create.c for details), we can destroy namespace
> by killing this process.

I pretty much know that allready (I've spend quite some time reading the
code you wrote).

And if I understand it correctly removing the namespace will also remove
the dummy device that has been created in that namespace, right? So that
the sysfs_after will be same regardless if the dummy device was
propagated or not. Which is the reason I wanted to sample the directory
before we remove it.

> Anyway, one thing you can do before pushing the patch is to remove
> kill -9 $NS_HANDLE
> command from the test code, as this is done inside cleanup function.

Killing it twice once in the test and once in the cleanup is mistake as
well. Since the NS_HANDLE is pid and it may have been reused if there
was a lot of forking done on the system meanwhile. Which is unlikely but
still possible.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2015-08-19 16:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 12:22 [LTP] [PATCH 1/2] added helper tools for creating and working with namespaces Matus Marhefka
2015-07-14 12:22 ` [LTP] [PATCH 2/2] containers/netns tests rewritten Matus Marhefka
2015-07-14 13:09   ` Cyril Hrubis
     [not found]   ` <1436958405-21403-1-git-send-email-mmarhefk@redhat.com>
2015-07-27 14:48     ` [LTP] [PATCH 2/2 v2] " Cyril Hrubis
     [not found]   ` <1439899125-7646-1-git-send-email-mmarhefk@redhat.com>
2015-08-19 13:44     ` [LTP] [PATCH 2/2 v3] " Cyril Hrubis
     [not found]       ` <1244717184.10704034.1439998635401.JavaMail.zimbra@redhat.com>
2015-08-19 16:26         ` Cyril Hrubis [this message]
     [not found]           ` <2086887252.11104808.1440076288678.JavaMail.zimbra@redhat.com>
2015-08-20 13:27             ` Cyril Hrubis
     [not found]               ` <1988094172.11156810.1440082049224.JavaMail.zimbra@redhat.com>
2015-08-20 14:56                 ` Cyril Hrubis
2015-07-14 13:02 ` [LTP] [PATCH 1/2] added helper tools for creating and working with namespaces Cyril Hrubis
     [not found] ` <1436958370-21366-1-git-send-email-mmarhefk@redhat.com>
2015-07-27 14:16   ` [LTP] [PATCH 1/2 v2] " Cyril Hrubis
     [not found] ` <1439899089-7601-1-git-send-email-mmarhefk@redhat.com>
2015-08-26 15:05   ` [LTP] [PATCH 1/2 v3] " Cyril Hrubis
2015-08-27 11:55     ` Cyril Hrubis
     [not found]       ` <55DF1280.5080300@redhat.com>
2015-08-27 13:47         ` Cyril Hrubis
     [not found]           ` <55DF19FC.3030501@redhat.com>
2015-08-27 14:13             ` Cyril Hrubis
     [not found]               ` <55DF1D60.8090702@redhat.com>
2015-08-27 14:26                 ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150819162621.GA2356@rei.suse.de \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mmarhefk@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox