From: Cyril Hrubis <chrubis@suse.cz>
To: Jiri Jaburek <jjaburek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] network namespaces tests cleanup
Date: Thu, 19 Feb 2015 16:04:14 +0100 [thread overview]
Message-ID: <20150219150413.GA23831@rei> (raw)
In-Reply-To: <54E4C3C3.6080407@redhat.com>
Hi!
> > As network namespaces tests (ltp/testcases/kernel/containers/netns) code is
> > a bit messy and it's hard to figure out how return values are passed in the code
> > I propose to remove all test cases and leave only the ones specified below.
>
> Just few notes about history / backwards compatibility; the proposed
> replacements are not exactly true replacements for the original code
> regarding kernel/userspace requirements.
>
> 2002: (pre-git) Linux namespaces support in the kernel
> 2007/09: kernel supports moving interfaces between network namespaces
> 2008/06: 'ip link .. netns <pid>' support in iproute2
> 2010/03: /proc/<pid>/ns/* support in the kernel
> 2011/05: /proc/<pid>/ns/* usable as file descriptors (mountable)
> 2011/07: 'ip netns' support in iproute2, incl. 'ip link .. netns <file>'
>
> The point being how far are you willing to go to preserve the
> functionality on older kernels/userspace.
>
> The proposed code uses /proc/<pid>/ns/* as file descriptors, so it needs
> at least 2.6.39 kernel and related iproute version or /usr/include
> recent enough to have IFLA_NET_NS_FD (so you can write your own netlink
> setup utility).
Does not seem to be the case for SLES11 SP3 nor SP4. The kernel should
be new enough since SP2 though.
> The original code uses only fork/clone as far as I see, so it goes much
> more "back" in terms of compatibility, quite likely at the cost of
> readability, though. The bash portions of the original code use iproute2
> with 'netns <pid>' only, so their compatibility goes as back as 2008.
>
> The ultimate question is therefore "are we willing to TCONF the new
> tests on anything older than (upstream) 2.6.39?".
Well that may be one possibility. Unfortunatelly 2.6.39 is quite new, if
it were at least ten years old I would not hesitate. On the other hand
the old testcases are messy and basically unmaintainable and they tend
to fail if some subtle details in kernel change or even randomly from
time to time.
Ideal solution would be to fix the new testcases to work even on older
kernels but if that is too much work I would rather see us concentrate
on more recent code.
> Some (most?) enterprise distributions may have the functionality
> backported, for example RHEL-6.6 fully supports mounting
> /proc/<pid>/ns/* and even has util-linux support (like nsenter(1)) for
> the mounted file descriptors. It is, however, missing any 'ip netns'
> support as well as 'ip link .. netns <file>' (supports only pid).
>
> What about others?
>
> # kernel fd (setns(2)) + util-linux support
> touch netnstest
> unshare --net mount --bind /proc/self/ns/net netnstest
> nsenter --net=netnstest ip link show
SLES11 unshare does not support --bind and does not have nsenter likely
util-linux is too old (2.19.1).
> # iproute pid support (possible bashisms follow)
> ip link add dummy123 type dummy
> nsenter --net=netnstest sleep 10 &
> ip link set dummy123 netns $!
> wait
> nsenter --net=netnstest ip link show
Same here no nesenter.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-02-19 15:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <789026778.7588485.1423581396876.JavaMail.zimbra@redhat.com>
[not found] ` <1688764619.7589818.1423581433749.JavaMail.zimbra@redhat.com>
2015-02-12 11:03 ` [LTP] network namespaces tests cleanup Cyril Hrubis
[not found] ` <980241572.9316983.1423749665613.JavaMail.zimbra@redhat.com>
[not found] ` <54E33EE9.9000302@redhat.com>
2015-02-17 14:04 ` Cyril Hrubis
[not found] ` <54E35175.20807@redhat.com>
2015-02-17 15:20 ` Cyril Hrubis
2015-02-18 16:54 ` Jiri Jaburek
2015-02-18 17:35 ` Jiri Jaburek
2015-02-19 15:04 ` Cyril Hrubis [this message]
[not found] ` <54EC5053.4060005@redhat.com>
2015-02-25 12:35 ` Cyril Hrubis
[not found] ` <54EDC5B4.9050806@redhat.com>
2015-02-25 13:05 ` 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=20150219150413.GA23831@rei \
--to=chrubis@suse.cz \
--cc=jjaburek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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