test: replace bash CNI plugin with a custom bridge

Because we need a working CNI plugin to setup a correct netns so
sandbox_run can grab a working IP address.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-08-31 11:19:13 +02:00
parent 2ac2832686
commit 5947698818
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
5 changed files with 42 additions and 46 deletions

View file

@ -76,6 +76,23 @@ RUN set -x \
&& cp bin/* /opt/cni/bin/ \
&& rm -rf "$GOPATH"
# Install custom CNI bridge test plugin
# XXX: this plugin is meant to be a replacement for the old "test_plugin_args.bash"
# we need this in testing because sandbox_run now gather IP address and the mock
# plugin wasn't able to properly setup the net ns.
# The bridge is based on the same commit as the one above.
#ENV CNI_COMMIT 6bfe036c38c8e1410f1acaa4b2ee16f1851472e4
ENV CNI_TEST_BRANCH custom-bridge
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/runcom/plugins.git "$GOPATH/src/github.com/containernetworking/plugins" \
&& cd "$GOPATH/src/github.com/containernetworking/plugins" \
&& git checkout -q "$CNI_TEST_BRANCH" \
&& ./build.sh \
&& mkdir -p /opt/cni/bin \
&& cp bin/bridge /opt/cni/bin/bridge-custom \
&& rm -rf "$GOPATH"
# Install crictl
ENV CRICTL_COMMIT 16e6fe4d7199c5689db4630a9330e6a8a12cecd1
RUN set -x \
@ -87,8 +104,6 @@ RUN set -x \
&& cp "$GOPATH"/bin/crictl /usr/bin/ \
&& rm -rf "$GOPATH"
COPY test/plugin_test_args.bash /opt/cni/bin/plugin_test_args.bash
# Make sure we have some policy for pulling images
RUN mkdir -p /etc/containers
COPY test/policy.json /etc/containers/policy.json