summaryrefslogtreecommitdiffstats
path: root/test/docker
diff options
context:
space:
mode:
Diffstat (limited to 'test/docker')
-rw-r--r--test/docker/Dockerfile6
-rw-r--r--test/docker/alpine/Dockerfile23
-rwxr-xr-xtest/docker/alpine/install-packages.sh14
-rw-r--r--test/docker/centos7/Dockerfile27
-rwxr-xr-xtest/docker/centos7/install-packages.sh15
-rw-r--r--test/docker/debian10/Dockerfile20
-rwxr-xr-xtest/docker/debian10/install-packages.sh113
-rwxr-xr-xtest/docker/docker-script.sh16
-rwxr-xr-xtest/docker/entrypoint.sh22
-rw-r--r--test/docker/fedoradev/Dockerfile22
-rwxr-xr-xtest/docker/fedoradev/install-packages.sh25
-rw-r--r--test/docker/ubuntu14/Dockerfile24
-rwxr-xr-xtest/docker/ubuntu14/install-packages.sh69
13 files changed, 374 insertions, 22 deletions
diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile
deleted file mode 100644
index 200f918..0000000
--- a/test/docker/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-ARG DIST
-FROM vskytta/bash-completion:$DIST
-
-WORKDIR /work
-COPY . .
-CMD ["test/docker/docker-script.sh"]
diff --git a/test/docker/alpine/Dockerfile b/test/docker/alpine/Dockerfile
new file mode 100644
index 0000000..e4d9f3b
--- /dev/null
+++ b/test/docker/alpine/Dockerfile
@@ -0,0 +1,23 @@
+FROM alpine
+
+RUN apk add --no-cache \
+ autoconf \
+ automake \
+ bash \
+ gcc \
+ make \
+ musl-dev \
+ py3-pexpect \
+ py3-pytest-xdist \
+ tar \
+ xvfb \
+ xvfb-run \
+ xz
+
+# test-cmd-list.txt is just a cache buster here
+ADD test-cmd-list.txt \
+ docker/alpine/install-packages.sh \
+ /tmp/
+
+RUN /tmp/install-packages.sh \
+ && rm -r /tmp/*
diff --git a/test/docker/alpine/install-packages.sh b/test/docker/alpine/install-packages.sh
new file mode 100755
index 0000000..7865703
--- /dev/null
+++ b/test/docker/alpine/install-packages.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -xeuo pipefail
+
+cd "${TMPDIR:-/tmp}"
+
+apk upgrade
+
+# Nothing much here, at least yet. Useful this way already in order to
+# test some very base executables, as well as ones that come from
+# busybox. Don't lose that if adding stuff here!
+
+# An arbitrary package containing an init script or the like for
+# testing service completion.
+apk add nginx-openrc
diff --git a/test/docker/centos7/Dockerfile b/test/docker/centos7/Dockerfile
new file mode 100644
index 0000000..c0611e7
--- /dev/null
+++ b/test/docker/centos7/Dockerfile
@@ -0,0 +1,27 @@
+FROM centos:7
+
+RUN set -x \
+ && sed -i -e /tsflags=nodocs/d /etc/yum.conf \
+ && yum -y install \
+ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
+ && yum -y upgrade \
+ && yum -y install \
+ /usr/bin/autoconf \
+ /usr/bin/automake \
+ /usr/bin/make \
+ # /usr/bin/which: https://bugzilla.redhat.com/show_bug.cgi?id=1443357 \
+ /usr/bin/which \
+ /usr/bin/xvfb-run \
+ python36-pexpect
+
+ADD test-cmd-list.txt \
+ requirements.txt \
+ docker/centos7/install-packages.sh \
+ /tmp/
+
+RUN set -x \
+ && pip3 install --prefix /usr/local -Ir /tmp/requirements.txt
+
+RUN /tmp/install-packages.sh </tmp/test-cmd-list.txt \
+ && yum -Cy clean all \
+ && rm -r /tmp/* /root/.cache/pip /var/lib/yum/history/* /var/lib/yum/yumdb/*
diff --git a/test/docker/centos7/install-packages.sh b/test/docker/centos7/install-packages.sh
new file mode 100755
index 0000000..7373c00
--- /dev/null
+++ b/test/docker/centos7/install-packages.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -xeuo pipefail
+
+shopt -s extglob
+
+cd "${TMPDIR:-/tmp}"
+
+while read -r file; do
+ case $file in
+ mock | */mock) printf "%s\n" mock ;;
+ /*) printf "%s\n" "$file" ;;
+ *) printf "%s\n" {/usr,}/{,s}bin/"$file" ;;
+ esac
+done |
+ xargs yum -y install
diff --git a/test/docker/debian10/Dockerfile b/test/docker/debian10/Dockerfile
new file mode 100644
index 0000000..1a19fa3
--- /dev/null
+++ b/test/docker/debian10/Dockerfile
@@ -0,0 +1,20 @@
+FROM debian:10
+
+RUN export DEBIAN_FRONTEND=noninteractive \
+ && apt-get update \
+ && apt-get -y upgrade \
+ && apt-get -y --no-install-recommends install \
+ autoconf \
+ automake \
+ make \
+ python3-pexpect \
+ python3-pytest-xdist \
+ xvfb xauth \
+ && ln -s $(bash -c "type -P pytest-3") /usr/local/bin/pytest
+
+ADD test-cmd-list.txt \
+ docker/debian10/install-packages.sh \
+ /tmp/
+
+RUN /tmp/install-packages.sh </tmp/test-cmd-list.txt \
+ && rm -r /tmp/* /var/lib/apt/lists/*
diff --git a/test/docker/debian10/install-packages.sh b/test/docker/debian10/install-packages.sh
new file mode 100755
index 0000000..20d6556
--- /dev/null
+++ b/test/docker/debian10/install-packages.sh
@@ -0,0 +1,113 @@
+#!/bin/bash
+set -xeuo pipefail
+
+cd "${TMPDIR:-/tmp}"
+
+shopt -s extglob
+export DEBIAN_FRONTEND=noninteractive
+
+dpkg --add-architecture i386 # for wine
+
+apt-get update
+apt-get -y upgrade
+
+apt-get -y --no-install-recommends install \
+ apt-file \
+ software-properties-common
+
+apt-add-repository contrib
+apt-add-repository non-free
+
+apt-get -y --no-install-recommends install \
+ npm
+
+npm install -g jshint
+npm cache clean --force
+
+apt-file update
+
+excluded=$(
+ cat <<\EOF
+arping
+bcron
+bison++
+fuse
+gdb-minimal
+gnat-7
+ifupdown
+inetutils-ping
+lpr
+lprng
+make-guile
+netscript-2.4
+ntpsec-ntpdate
+openresolv
+pkg-config
+strongswan-starter
+sudo-ldap
+systemd-cron
+EOF
+)
+
+# https://github.com/moby/moby/issues/1297
+echo "resolvconf resolvconf/linkify-resolvconf boolean false" |
+ debconf-set-selections
+
+# Work around https://bugs.debian.org/1040925
+apt-get -y --no-install-recommends install \
+ ca-certificates-java
+
+while read -r file; do
+ case $file in
+ /*) printf "%s\n" "$file" ;;
+ *) printf "%s\n" {/usr,}/{,s}bin/"$file" ;;
+ esac
+done |
+ apt-file -lFf search - |
+ grep -vF "$excluded" |
+ xargs apt-get -y --no-install-recommends install
+
+# Required but not pulled in by dependencies:
+apt-get -y --no-install-recommends install \
+ postgresql-client
+
+# Build some *BSD tools for testing
+
+apt-get -y --no-install-recommends install \
+ build-essential
+
+install -dm 755 /usr/local/lib/bsd-bin
+apt-get -y --no-install-recommends install bison libbsd-dev subversion
+
+svn co https://svn.freebsd.org/base/release/11.1.0/usr.bin/sed bsd-sed
+cd bsd-sed
+sed -i -e 's,^__FBSDID.*,#include <bsd/bsd.h>,' ./*.c
+cc -O2 -g -Wall -Wno-unused-const-variable -D_GNU_SOURCE ./*.c \
+ -lbsd -o /usr/local/lib/bsd-bin/sed
+cd ..
+rm -r bsd-sed
+
+svn co https://svn.freebsd.org/base/release/11.1.0/contrib/one-true-awk
+cd one-true-awk
+sed -i -e /^__FBSDID/d ./*.c
+make YACC="bison -d -y"
+install a.out /usr/local/lib/bsd-bin/awk
+cd ..
+rm -r one-true-awk
+
+# Install slapt-get and slapt-src
+
+cd /
+curl --fail https://software.jaos.org/slackpacks/slackware64-14.2/slapt-get/slapt-get-0.11.3-x86_64-1.txz |
+ tar xvJ
+bash -x install/doinst.sh
+mkdir -p var/lib/pkgtools/packages # 0.11.3 --available empty without this dir
+rm -r install
+curl --fail https://software.jaos.org/slackpacks/slackware64-14.2/slapt-src/slapt-src-0.3.6-x86_64-1.txz |
+ tar xvJ
+bash -x install/doinst.sh
+rm -r install
+cp -a usr/lib64/* usr/lib/
+ln -s libcrypto.so.1.1 usr/lib/x86_64-linux-gnu/libcrypto.so.1
+rm -r usr/lib64
+cd -
diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh
deleted file mode 100755
index b3f351f..0000000
--- a/test/docker/docker-script.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh -ex
-
-if [ "$BSD" ]; then
- PATH=/usr/local/lib/bsd-bin:$PATH
- export PATH
-fi
-
-export bashcomp_bash=bash
-env
-
-autoreconf -i
-./configure
-make -j
-
-xvfb-run make distcheck \
- PYTESTFLAGS="--verbose --numprocesses=auto --dist=loadfile"
diff --git a/test/docker/entrypoint.sh b/test/docker/entrypoint.sh
new file mode 100755
index 0000000..c647782
--- /dev/null
+++ b/test/docker/entrypoint.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -eux
+# shellcheck shell=sh
+
+if [ "${BSD-}" ]; then
+ PATH=/usr/local/lib/bsd-bin:$PATH
+ export PATH
+fi
+
+export bashcomp_bash=bash
+env
+
+oldpwd=$(pwd)
+cp -a . /work
+cd /work
+
+autoreconf -i
+./configure
+make -j
+
+xvfb-run make distcheck \
+ PYTESTFLAGS="${PYTESTFLAGS---verbose -p no:cacheprovider --numprocesses=auto --dist=loadfile}"
+cp -p bash-completion-*.tar.* "$oldpwd/"
diff --git a/test/docker/fedoradev/Dockerfile b/test/docker/fedoradev/Dockerfile
new file mode 100644
index 0000000..7919ac2
--- /dev/null
+++ b/test/docker/fedoradev/Dockerfile
@@ -0,0 +1,22 @@
+FROM fedora:rawhide
+
+RUN echo install_weak_deps=False >> /etc/dnf/dnf.conf \
+ && sed -i -e /tsflags=nodocs/d /etc/dnf/dnf.conf \
+ && dnf -y --refresh upgrade \
+ && dnf -y install \
+ /usr/bin/autoconf \
+ /usr/bin/automake \
+ /usr/bin/make \
+ /usr/bin/xvfb-run \
+ /usr/bin/pytest-3 \
+ python3-pexpect \
+ python3-pytest-xdist \
+ && ln -s $(type -P pytest-3) /usr/local/bin/pytest
+
+ADD test-cmd-list.txt \
+ docker/fedoradev/install-packages.sh \
+ /tmp/
+
+RUN /tmp/install-packages.sh </tmp/test-cmd-list.txt \
+ && dnf -Cy clean all \
+ && rm -r /tmp/* /var/lib/dnf/history.sqlite* /var/lib/dnf/repos/*
diff --git a/test/docker/fedoradev/install-packages.sh b/test/docker/fedoradev/install-packages.sh
new file mode 100755
index 0000000..70d143c
--- /dev/null
+++ b/test/docker/fedoradev/install-packages.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -xeuo pipefail
+
+shopt -s extglob
+
+cd "${TMPDIR:-/tmp}"
+
+# upgrade: base image contains vim-minimal, newer vim-* which
+# implicitly conflicts with it (typically vim.1.gz) may be in
+# repository and pulled in further down, causing install to fail as
+# -minimal won't be updated otherwise.
+dnf --refresh -y upgrade
+
+dnf -y install /usr/bin/xargs
+
+while read -r file; do
+ case $file in
+ /*) printf "%s\n" "$file" ;;
+ *) printf "%s\n" {/usr,}/{,s}bin/"$file" ;;
+ esac
+done |
+ xargs dnf --skip-broken -y install
+# --skip-broken: avoid failing on not found packages. Also prevents actually
+# broken packages from failing the install which is not what we want, but
+# there doesn't seem to be way to cleanly just skip the not found ones.
diff --git a/test/docker/ubuntu14/Dockerfile b/test/docker/ubuntu14/Dockerfile
new file mode 100644
index 0000000..6a8a1d5
--- /dev/null
+++ b/test/docker/ubuntu14/Dockerfile
@@ -0,0 +1,24 @@
+FROM ubuntu:14.04
+
+RUN export DEBIAN_FRONTEND=noninteractive \
+ && apt-get update \
+ && apt-get -y upgrade \
+ && apt-get -y --no-install-recommends install \
+ autoconf \
+ automake \
+ make \
+ software-properties-common \
+ xvfb \
+ && python3.4 -c "import urllib.request; urllib.request.urlretrieve('https://github.com/pyston/pyston/releases/download/pyston_2.3.1/pyston_2.3.1_portable_v2.tar.gz', '/tmp/pyston.tar.gz')" \
+ && tar xCf /usr/local /tmp/pyston.tar.gz --strip-components=1
+
+ADD test-cmd-list.txt \
+ requirements.txt \
+ docker/ubuntu14/install-packages.sh \
+ /tmp/
+
+RUN set -x \
+ && pyston3 -m pip install -Ir /tmp/requirements.txt
+
+RUN /tmp/install-packages.sh </tmp/test-cmd-list.txt \
+ && rm -r /tmp/* /root/.cache/pip /var/lib/apt/lists/*
diff --git a/test/docker/ubuntu14/install-packages.sh b/test/docker/ubuntu14/install-packages.sh
new file mode 100755
index 0000000..c0e3c9c
--- /dev/null
+++ b/test/docker/ubuntu14/install-packages.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+set -xeuo pipefail
+
+cd "${TMPDIR:-/tmp}"
+
+shopt -s extglob
+export DEBIAN_FRONTEND=noninteractive
+
+dpkg --add-architecture i386 # for wine
+
+apt-get update
+apt-get -y upgrade
+
+apt-get -y --no-install-recommends install \
+ apt-file \
+ software-properties-common
+
+apt-add-repository multiverse
+
+apt-file update
+
+excluded=$(
+ cat <<\EOF
+arping
+bcron-run
+bison++
+evince-gtk
+gdb-minimal
+gnat-4.6
+gnuspool
+heimdal
+inetutils-ping
+knot-dnsutils
+knot-host
+lpr
+lprng
+mariadb-client-5.5
+mariadb-client-core-5.5
+mplayer2
+mysql-client-5.5
+mysql-client-core-5.5
+netscript-2.4
+openresolv
+percona-xtradb-cluster-client-5.5
+postgres-xc-client
+python3.5-venv
+strongswan-starter
+sudo-ldap
+xserver-xorg-input-synaptics-lts-utopic
+xserver-xorg-input-synaptics-lts-vivid
+xserver-xorg-input-synaptics-lts-wily
+xserver-xorg-input-synaptics-lts-xenial
+EOF
+)
+
+while read -r file; do
+ case $file in
+ /*) printf "%s\n" "$file" ;;
+ *) printf "%s\n" {/usr,}/{,s}bin/"$file" ;;
+ esac
+done |
+ apt-file -lFf search - |
+ grep -vF "$excluded" |
+ xargs apt-get -y --no-install-recommends install
+
+# Required but not pulled in by dependencies:
+apt-get -y --no-install-recommends install \
+ libwww-perl \
+ postgresql-client