diff --git a/libcontainer/integration/seccomp_test.go b/libcontainer/integration/seccomp_test.go index 949018614..781de48de 100644 --- a/libcontainer/integration/seccomp_test.go +++ b/libcontainer/integration/seccomp_test.go @@ -9,6 +9,7 @@ import ( "github.com/opencontainers/runc/libcontainer" "github.com/opencontainers/runc/libcontainer/configs" + libseccomp "github.com/seccomp/libseccomp-golang" ) func TestSeccompDenyGetcwd(t *testing.T) { @@ -136,6 +137,13 @@ func TestSeccompDenyWriteConditional(t *testing.T) { return } + // Only test if library version is v2.2.1 or higher + // Conditional filtering will always error in v2.2.0 and lower + major, minor, micro := libseccomp.GetLibraryVersion() + if (major == 2 && minor < 2) || (major == 2 && minor == 2 && micro < 1) { + return + } + rootfs, err := newRootfs() if err != nil { t.Fatal(err) diff --git a/script/test_Dockerfile b/script/test_Dockerfile index 6a9e9e71b..2bef485a5 100644 --- a/script/test_Dockerfile +++ b/script/test_Dockerfile @@ -1,13 +1,7 @@ FROM golang:1.4 RUN echo "deb http://ftp.us.debian.org/debian testing main contrib" >> /etc/apt/sources.list -RUN apt-get update && apt-get install -y iptables criu=1.6-2 git build-essential autoconf libtool && rm -rf /var/lib/apt/lists/* - -# Need Libseccomp v2.2.1 minimum, but grab the latest version of the v2.2 releases -RUN git clone -b v2.2.3 --depth 1 https://github.com/seccomp/libseccomp /libseccomp -RUN cd /libseccomp && ./autogen.sh && ./configure && make && make check && make install -# Fix linking error -RUN cp /usr/local/lib/libseccomp.so /usr/lib/libseccomp.so.2 +RUN apt-get update && apt-get install -y iptables criu=1.6-2 libseccomp2 libseccomp-dev && rm -rf /var/lib/apt/lists/* # setup a playground for us to spawn containers in RUN mkdir /busybox && \