linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Testbeds for libudev/gudev clients
Date: Mon, 09 Jul 2012 19:54:25 +0000	[thread overview]
Message-ID: <CAMOw1v6azAk359kjrJze6dfba9vh7BTcG0010gHyBQk7sT6KbQ@mail.gmail.com> (raw)
In-Reply-To: <20120706050131.GC3109@piware.de>

On Mon, Jul 9, 2012 at 11:22 AM, Martin Pitt <martin.pitt@ubuntu.com> wrote:
> 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.

You might want to look into kmod's testsuite. We do exactly that and
until there's a better alternative I plan to support this for newer
glibcs. There's a path.so that you can copy and paste to your project
- there are even other traps like the ones to uname(), init_module(),
delete_module() etc.

When I implemented that I tried what you are trying now and it didn't
look right and it's ugly to touch all the calls with path strings and
also very error prone.

It's not perfect, it could be simplified I think, but it doesn't touch
any libkmod/tools code like your approach, it doesn't require root
privileges and it's working quite well for all needs of kmod until
now, which I think are more than the ones for testing udev.

Lucas De Marchi

  parent reply	other threads:[~2012-07-09 19:54 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
2012-07-09 19:54 ` Lucas De Marchi [this message]
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=CAMOw1v6azAk359kjrJze6dfba9vh7BTcG0010gHyBQk7sT6KbQ@mail.gmail.com \
    --to=lucas.demarchi@profusion.mobi \
    --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).