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 <mheon@redhat.com>
This commit is contained in:
Matthew Heon 2015-08-13 09:10:05 -04:00
parent 8da24a5447
commit 59264040bd
2 changed files with 9 additions and 7 deletions

View File

@ -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)

View File

@ -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 && \