Add integration test
parent
1f2b32c4ed
commit
56fa90fd87
|
@ -15,26 +15,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
# libglib2.0-0 is required for conmon, which is required for podman
|
||||
libglib2.0-0=2.62.1-1 \
|
||||
&& rm /etc/crictl.yaml
|
||||
|
||||
# install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128
|
||||
ENV CRIO_VERSION="1.17=1.17.3~2"
|
||||
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_19.10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
|
||||
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_19.10/Release.key && \
|
||||
apt-key add - < Release.key && apt-get update && \
|
||||
apt-get install -y --no-install-recommends cri-o-${CRIO_VERSION}
|
||||
|
||||
apt-get install -y --no-install-recommends cri-o-1.17=1.17.2~1
|
||||
# install podman
|
||||
ENV PODMAN_VERSION=1.9.0~2
|
||||
RUN apt-get install -y --no-install-recommends podman=${PODMAN_VERSION}
|
||||
|
||||
RUN apt-get install -y --no-install-recommends podman=1.8.2~144
|
||||
# disable non-docker runtimes by default
|
||||
RUN systemctl disable containerd && systemctl disable crio && rm /etc/crictl.yaml
|
||||
|
||||
# copy over docker daemon config which sets cgroup manager to systemd
|
||||
COPY hack/images/daemon.json /etc/docker/daemon.json
|
||||
# enable docker which is default
|
||||
RUN systemctl enable docker
|
||||
|
||||
# making SSH work for docker container
|
||||
# based on https://github.com/rastasheep/ubuntu-sshd/blob/master/18.04/Dockerfile
|
||||
RUN mkdir /var/run/sshd
|
||||
|
|
|
@ -63,3 +63,30 @@ func TestDockerFlags(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestForceSystemd(t *testing.T) {
|
||||
if NoneDriver() {
|
||||
t.Skip("skipping: none driver does not support ssh or bundle docker")
|
||||
}
|
||||
MaybeParallel(t)
|
||||
|
||||
profile := UniqueProfileName("force-systemd")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(30))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
// Use the most verbose logging for the simplest test. If it fails, something is very wrong.
|
||||
args := append([]string{"start", "-p", profile, "--force-systemd", "--alsologtostderr", "-v=5"}, StartArgs()...)
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
t.Errorf("failed to start minikube with args: %q : %v", rr.Command(), err)
|
||||
}
|
||||
|
||||
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "docker info --format {{.CgroupDriver}}"))
|
||||
if err != nil {
|
||||
t.Errorf("failed to get docker cgroup driver. args %q: %v", rr.Command(), err)
|
||||
}
|
||||
|
||||
if !strings.Contains(rr.Output(), "systemd") {
|
||||
t.Fatalf("expected systemd cgroup driver, got: %v", rr.Output())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue