From 59264040bd9668e1434abb1a1057989ca623b437 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 13 Aug 2015 09:10:05 -0400 Subject: [PATCH] Update tests to not error on library v2.2.0 and lower As v2.1.0 is no longer required for successful testing, do not build it in the Dockerfile - instead just use the version Ubuntu ships. Signed-off-by: Matthew Heon --- libcontainer/integration/seccomp_test.go | 8 ++++++++ script/test_Dockerfile | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-) 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 && \