[CRIU] [PATCH] travis: run tests with asan

Andrei Vagin avagin at virtuozzo.com
Wed Mar 29 16:00:05 PDT 2017


On Thu, Mar 30, 2017 at 01:26:38AM +0300, Dmitry Safonov wrote:
> 2017-03-30 0:51 GMT+03:00 Andrei Vagin <avagin at openvz.org>:
> > From: Andrei Vagin <avagin at virtuozzo.com>
> >
> > Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
> > ---
> >  .travis.yml                          |  1 +
> >  scripts/build/Dockerfile.fedora-asan | 16 ++++++++++++++++
> >  scripts/build/Makefile               |  2 +-
> >  scripts/travis/Makefile              |  3 +++
> >  scripts/travis/asan.sh               | 24 ++++++++++++++++++++++++
> >  5 files changed, 45 insertions(+), 1 deletion(-)
> >  create mode 100644 scripts/build/Dockerfile.fedora-asan
> >  create mode 100755 scripts/travis/asan.sh
> >
> > diff --git a/.travis.yml b/.travis.yml
> > index a5dfb9f..78b1f0c 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -8,6 +8,7 @@ env:
> >    - TR_ARCH=local       GCOV=1
> >    - TR_ARCH=local       CLANG=1
> >    - TR_ARCH=alpine
> > +  - TR_ARCH=asan
> >    - TR_ARCH=x86_64
> >    - TR_ARCH=armv7hf
> >    - TR_ARCH=aarch64
> > diff --git a/scripts/build/Dockerfile.fedora-asan b/scripts/build/Dockerfile.fedora-asan
> > new file mode 100644
> > index 0000000..13aad28
> > --- /dev/null
> > +++ b/scripts/build/Dockerfile.fedora-asan
> > @@ -0,0 +1,16 @@
> > +FROM fedora:latest
> > +ARG CC=gcc
> > +ARG ENV1=FOOBAR
> > +
> > +RUN dnf install -y git gcc make
> > +RUN dnf install -y protobuf-devel protobuf-c-devel libaio-devel libcap-devel libnl3-devel libnet-devel
> > +RUN dnf install -y python ccache libasan findutils tar python-yaml protobuf-python iptables iproute python-ipaddr procps-ng
> > +
> > +COPY . /criu
> > +WORKDIR /criu
> > +
> > +ENV CCACHE_DIR=/tmp/.ccache CCACHE_NOCOMPRESS=1 $ENV1=yes
> > +RUN mv .ccache /tmp; make mrproper; ccache -s; \
> > +       date; make -j $(nproc) ASAN=1 CC="$CC"; date
> > +RUN make ASAN=1 -C test/zdtm -j $(nproc)
> > +
> > diff --git a/scripts/build/Makefile b/scripts/build/Makefile
> > index b17bf10..5308711 100644
> > --- a/scripts/build/Makefile
> > +++ b/scripts/build/Makefile
> > @@ -1,6 +1,6 @@
> >  QEMU_ARCHES := armv7hf aarch64 ppc64le # require qemu
> >  ARCHES := $(QEMU_ARCHES) x86_64
> > -TARGETS := $(ARCHES) alpine
> > +TARGETS := $(ARCHES) alpine fedora-asan
> >  TARGETS_CLANG := $(addsuffix $(TARGETS),-clang)
> >
> >  all: $(TARGETS) $(TARGETS_CLANG)
> > diff --git a/scripts/travis/Makefile b/scripts/travis/Makefile
> > index 0dadd65..99df485 100644
> > --- a/scripts/travis/Makefile
> > +++ b/scripts/travis/Makefile
> > @@ -15,6 +15,9 @@ alpine:
> >         $(MAKE) -C ../build $@$(target-suffix)
> >         docker run --rm -it --privileged -v /lib/modules:/lib/modules criu-alpine ./test/zdtm.py run -t zdtm/static/env00
> >
> > +asan:
> > +       $(MAKE) -C ../build fedora-asan
> > +       docker run --rm -it --privileged -v /lib/modules:/lib/modules criu-fedora-asan ./scripts/travis/asan.sh
> >
> >  %:
> >         $(MAKE) -C ../build $@$(target-suffix)
> > diff --git a/scripts/travis/asan.sh b/scripts/travis/asan.sh
> > new file mode 100755
> > index 0000000..9408794
> > --- /dev/null
> > +++ b/scripts/travis/asan.sh
> > @@ -0,0 +1,24 @@
> > +#!/bin/sh
> > +
> > +set -x
> > +
> > +cat /proc/self/mountinfo
> > +
> > +chmod 0777 test
> > +chmod 0777 test/zdtm/transition/
> > +chmod 0777 test/zdtm/static
> > +
> > +./test/zdtm.py run -a --keep-going -k always --parallel 4 \
> > +               -x zdtm/static/cwd02 -x zdtm/static/cwd01 \
> > +               -x zdtm/static/inotify00 -x zdtm/static/rtc \
> > +               -x zdtm/static/mntns_deleted -x zdtm/static/unlink_fstat03 \
> 
> JFI:
> What's wrong with those?

I forgot to add a comment:(

+ cat /proc/self/mountinfo
86 51 0:41 / / rw,relatime - aufs none rw,si=6435885ede7c8048,dio,dirperm1

This tests don't work over aufs. AUFS doesn't support file handles and
has some issues around deleted files.

> 
> > +
> > +ret=$?
> > +for i in `find / -name 'asan.log*'`; do
> > +       echo $i;
> > +       echo ========================================
> > +       cat $i;
> > +       echo ========================================
> > +       ret=1;
> > +done;
> > +exit $ret
> 
> 
> 
> -- 
>              Dmitry


More information about the CRIU mailing list