Add load test for xz compressed images

The auto decompression functionality was already vendored in
with containers/image. Adding a test for it.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #1137
Approved by: rhatdan
This commit is contained in:
umohnani8 2018-07-23 11:46:43 -04:00 committed by Atomic Bot
parent 49b3647410
commit 49bdd8421b
4 changed files with 22 additions and 0 deletions

View File

@ -38,6 +38,7 @@ RUN apt-get update && apt-get install -y \
python3-pip \
python3-dateutil \
python3-setuptools \
xz-utils \
--no-install-recommends \
&& apt-get clean

View File

@ -24,6 +24,7 @@ RUN yum -y install btrfs-progs-devel \
which\
golang-github-cpuguy83-go-md2man \
nmap-ncat \
xz \
iptables && yum clean all
# Install CNI plugins

View File

@ -26,6 +26,7 @@ RUN dnf -y install btrfs-progs-devel \
golang-github-cpuguy83-go-md2man \
procps-ng \
nmap-ncat \
xz \
iptables && dnf clean all
# Install CNI plugins

View File

@ -217,4 +217,23 @@ var _ = Describe("Podman load", func() {
Expect(result.LineInOutputContains("docker")).To(Not(BeTrue()))
Expect(result.LineInOutputContains("localhost")).To(BeTrue())
})
It("podman load xz compressed image", func() {
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save.ExitCode()).To(Equal(0))
session := podmanTest.SystemExec("xz", []string{outfile})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi.ExitCode()).To(Equal(0))
result := podmanTest.Podman([]string{"load", "-i", outfile + ".xz"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
})
})