From c9e5bfbbbb22c9f678b2d12b2ecbad043078d3f9 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Mon, 22 Jan 2018 14:13:17 -0800 Subject: [PATCH] Add new e2e-test container to export ipcs from util-linux This container will be used to exercise the HostIPC functionality in e2e-node tests. The version of `ipcs` shipped in busybox performs operations that get blocked by SELinux on hosts where it is enabled. The version of `ipcs` in util-linux does not perform those operations, rather it checks whether the /proc files it needs are available and proceeds to reading from them directly. Using `ipcs` from util-linux makes these tests pass, even when running under SELinux enabled, so let's use them here. Tested: On a host where Docker with SELinux enabled: - Checked that `ipcs` from busybox does not work: $ docker run busybox ipcs -m kernel not configured for shared memory - Checked that the one from this container does work: $ docker run gcr.io/kubernetes-e2e-test-images/ipc-utils-amd64:1.0 ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status --- test/images/ipc-utils/BASEIMAGE | 4 ++++ test/images/ipc-utils/Dockerfile | 19 +++++++++++++++++++ test/images/ipc-utils/VERSION | 1 + 3 files changed, 24 insertions(+) create mode 100644 test/images/ipc-utils/BASEIMAGE create mode 100644 test/images/ipc-utils/Dockerfile create mode 100644 test/images/ipc-utils/VERSION diff --git a/test/images/ipc-utils/BASEIMAGE b/test/images/ipc-utils/BASEIMAGE new file mode 100644 index 00000000000..114844f395e --- /dev/null +++ b/test/images/ipc-utils/BASEIMAGE @@ -0,0 +1,4 @@ +amd64=alpine:3.6 +arm=arm32v6/alpine:3.6 +arm64=arm64v8/alpine:3.6 +ppc64le=ppc64le/alpine:3.6 diff --git a/test/images/ipc-utils/Dockerfile b/test/images/ipc-utils/Dockerfile new file mode 100644 index 00000000000..3edaa272083 --- /dev/null +++ b/test/images/ipc-utils/Dockerfile @@ -0,0 +1,19 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM BASEIMAGE + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ + +RUN apk add --no-cache util-linux diff --git a/test/images/ipc-utils/VERSION b/test/images/ipc-utils/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/ipc-utils/VERSION @@ -0,0 +1 @@ +1.0