linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Pitt <martin.pitt@ubuntu.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Testbeds for libudev/gudev clients
Date: Mon, 09 Jul 2012 14:22:33 +0000	[thread overview]
Message-ID: <20120709142233.GI3261@piware.de> (raw)
In-Reply-To: <20120706050131.GC3109@piware.de>

Kay Sievers [2012-07-09 15:50 +0200]:
> Can't the tests just use a fs namespace and run the test in it with a
> bind-mount of /sys in it? Maybe check the unshare(1) tool to get the
> idea, or it might already be able to do that.

Most alternatives would require root privileges, which make tests a
lot less useful: You cannot run them in environments like jhbuild or
"make distcheck", and are also both inconvenient and potentially
ruining your system when you run them during development.

Another alternative I can think of that avoids root privs is a
fakechroot like LD_PRELOAD wrapper which intercepts all gazillion
variants of open and stat-like calls and redirects them to the
testbed. But given how fakechroot breaks with every other new glibc
release this is not something I'm very keen to do.

The third option that comes to my mind is to change the build system
to build a libudev-test.so with a hardcoded TEST_PREFIX of '.', so
that upower and friends can preload/link to that instead of the real
udev, and run the daemon in the directory of the test bed. Daemons
must not chdir() then (chdir('/') actually used to be best practice
for daemons), but that would not be a too hard limitation.

Other ideas greatly appreciated.

If you veto all those, we'll need to live with tests needing root
privileges. It still allows continuous integration test servers to run
stuff in VMs, but that's a lot harder for developers to set up.

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

  parent reply	other threads:[~2012-07-09 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06  5:01 [PATCH] Testbeds for libudev/gudev clients Martin Pitt
2012-07-09  7:25 ` Martin Pitt
2012-07-09 13:50 ` Kay Sievers
2012-07-09 14:22 ` Martin Pitt [this message]
2012-07-09 19:54 ` Lucas De Marchi
2012-07-09 20:09 ` Martin Pitt
2012-07-09 20:21 ` Lucas De Marchi
2012-07-10  3:40 ` Martin Pitt

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=20120709142233.GI3261@piware.de \
    --to=martin.pitt@ubuntu.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).