Re: [PATCH] Testbeds for libudev/gudev clients

Martin Pitt <[email protected]>
Newsgroups gmane.linux.hotplug.devel
Message-ID <[email protected]>
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)
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.