[CRIU] [PATCH] tests: be extra defensive about /dev and /dev/pts
Tycho Andersen
tycho.andersen at canonical.com
Tue Feb 16 06:21:04 PST 2016
On Fri, Feb 12, 2016 at 05:49:58PM +0300, Pavel Emelyanov wrote:
>
> > diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
> > index bc5c395..812872a 100644
> > --- a/test/zdtm/lib/ns.c
> > +++ b/test/zdtm/lib/ns.c
> > @@ -93,6 +93,21 @@ static int prepare_mntns(void)
> > return -1;
> > }
> >
> > + if (mkdir("/dev", 0777) && errno != EEXIST) {
> > + fprintf(stderr, "mkdir(/dev) failed: %m\n");
> > + return -1;
> > + }
> > +
> > + if (mount("devtmpfs", "/dev", "devtmpfs", 0, NULL)) {
> > + fprintf(stderr, "mount(/dev) failed: %m\n");
> > + return -1;
> > + }
>
> The /dev is populated in zdtm.py's __construct_root, this mount would just ruin
> the whole thing.
>
> Did you manage to find out why /dev gets killed during tests?
Hmm, no, I missed that somehow. I wonder what did cause these... Does
/dev automatically come with a /dev/pts directory too?
> > +
> > + if (mkdir("/dev/pts", 0777) && errno != EEXIST) {
> > + fprintf(stderr, "mkdir(/dev) failed: %m\n");
> > + return -1;
> > + }
> > +
> > if (mount("pts", "/dev/pts", "devpts", MS_MGC_VAL, "mode=666,ptmxmode=666,newinstance")) {
> > fprintf(stderr, "mount(/dev/pts) failed: %m\n");
> > return -1;
> >
>
More information about the CRIU
mailing list