[CRIU] [PATCH] tests: fix builds on alpine and centos
Adrian Reber
adrian at lisas.de
Fri Jun 22 00:33:39 MSK 2018
On Thu, Jun 21, 2018 at 02:11:17PM -0700, Andrei Vagin wrote:
> On Thu, Jun 21, 2018 at 08:50:53PM +0000, Adrian Reber wrote:
> > From: Adrian Reber <areber at redhat.com>
> >
> > Install sudo, create test user with ID 1000, install bash,
> > fix pidfile creation and pidfile chmod.
> >
> > Signed-off-by: Adrian Reber <areber at redhat.com>
> > ---
> > scripts/build/Dockerfile.alpine | 7 ++++++-
> > scripts/build/Dockerfile.centos | 1 +
> > test/others/rpc/Makefile | 4 +++-
> > 3 files changed, 10 insertions(+), 2 deletions(-)
[...]
> > diff --git a/test/others/rpc/Makefile b/test/others/rpc/Makefile
> > index 5b383cf..f2a7710 100644
> > --- a/test/others/rpc/Makefile
> > +++ b/test/others/rpc/Makefile
> > @@ -7,9 +7,11 @@ LDLIBS += -lprotobuf-c
> > run: all
> > mkdir -p build
> > chmod a+rwx build
> > + @# Create pidfile first to chmod without waiting
> > + touch build/pidfile
> > + chmod a+rw build/pidfile
>
> I don't understand how it can work. pidfile is created with O_EXCL, so
> it should fail if a file exists.
>
> int write_pidfile(int pid)
> {
> int fd;
>
> fd = open(opts.pidfile, O_WRONLY | O_EXCL | O_CREAT, 0600);
>
> O_EXCL Ensure that this call creates the file: if this flag is speci‐
> fied in conjunction with O_CREAT, and pathname already exists,
> then open() fails with the error EEXIST.
It does not work :(. That is why I sent a V2. My local tests were wrong
and I was also surprised that it works. But travis already told me that
it was wrong. The V2 looks good for alpine in travis, still waiting for
the centos results.
Adrian
More information about the CRIU
mailing list