Accepting request 683628 from home:cyphar:containers:docker-test

- docker-test: improvements to test packaging (we don't need to ship around the
  entire source tree, and we also need to build the born-again integration/
  tests which contain a suite-per-directory). tests.sh will need to be updated,
  but this will be done in a follow-up.

OBS-URL: https://build.opensuse.org/request/show/683628
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=290
This commit is contained in:
Aleksa Sarai 2019-03-10 21:20:43 +00:00 committed by Git OBS Bridge
parent 1080cf620d
commit b54f093209
3 changed files with 41 additions and 27 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sun Mar 10 21:12:09 UTC 2019 - Aleksa Sarai <asarai@suse.com>
- docker-test: improvements to test packaging (we don't need to ship around the
entire source tree, and we also need to build the born-again integration/
tests which contain a suite-per-directory). tests.sh will need to be updated,
but this will be done in a follow-up.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 26 09:39:57 UTC 2019 - Michal Jura <mjura@suse.com> Tue Feb 26 09:39:57 UTC 2019 - Michal Jura <mjura@suse.com>

View File

@ -280,9 +280,6 @@ docker container runtime configuration for kubeadm
%patch500 -p1 %patch500 -p1
%endif %endif
cp %{SOURCE7} .
cp %{SOURCE9} .
%build %build
BUILDTAGS="exclude_graphdriver_aufs apparmor selinux seccomp pkcs11" BUILDTAGS="exclude_graphdriver_aufs apparmor selinux seccomp pkcs11"
%if 0%{?sle_version} == 120000 %if 0%{?sle_version} == 120000
@ -317,19 +314,32 @@ mkdir -p src/github.com/docker/
ln -s $(pwd)/components/cli $(pwd)/src/github.com/docker/cli ln -s $(pwd)/components/cli $(pwd)/src/github.com/docker/cli
export GOPATH=$GOPATH:$(pwd) export GOPATH=$GOPATH:$(pwd)
# DOCKER ENGINE ###################
## DOCKER ENGINE ##
###################
pushd components/engine/ pushd components/engine/
# ignore the warning that we compile outside a Docker container # Ignore the warning that we compile outside a Docker container.
./hack/make.sh dynbinary ./hack/make.sh dynbinary
# build the tests binary
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \ # Build test binaries (integration-cli and integration/*). They are all stored
-buildmode=pie \ # within the testdir -- we will only end up installing these test files for
-tags "$DOCKER_BUILDTAGS daemon autogen" \ # docker-test.
-c github.com/docker/docker/integration-cli -o tests.main for testdir in {integration-cli,integration/*/}
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \
-buildmode=pie \
-tags "$DOCKER_BUILDTAGS daemon autogen" \
-c "github.com/docker/docker/$testdir" -o "$testdir/tests.main"
do
done
popd popd
# DOCKER CLIENT ###################
pushd components/cli ## DOCKER CLIENT ##
###################
pushd components/cli/
./scripts/build/dynbinary ./scripts/build/dynbinary
mkdir -p ./man/man1 mkdir -p ./man/man1
@ -365,10 +375,15 @@ install -Dd -m 0755 \
install -D -m0644 components/cli/contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{realname}" install -D -m0644 components/cli/contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{realname}"
install -D -m0644 components/cli/contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{realname}" install -D -m0644 components/cli/contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{realname}"
# copy all for the test package
# We only need all our built tests.main and hack/ for testing purposes.
install -d %{buildroot}%{_prefix}/src/docker/ install -d %{buildroot}%{_prefix}/src/docker/
cp -a components/engine/. %{buildroot}%{_prefix}/src/docker/engine install -D -m0755 %{SOURCE9} %{buildroot}%{_prefix}/src/docker/tests.sh
cp -a components/cli/. %{buildroot}%{_prefix}/src/docker/cli pushd components/engine
cp -a integration/ integration-cli/ %{buildroot}%{_prefix}/src/docker/
find %{buildroot}%{_prefix}/src/docker/ -not -name 'tests.main' -delete
cp -a hack/ %{buildroot}%{_prefix}/src/docker/
popd
# #
# systemd service # systemd service
@ -473,14 +488,6 @@ getent group docker >/dev/null || groupadd -r docker
%files test %files test
%defattr(-,root,root) %defattr(-,root,root)
%{_prefix}/src/docker/ %{_prefix}/src/docker/
# exclude binaries
%exclude %{_prefix}/src/docker/engine/bundles/
%exclude %{_prefix}/src/docker/cli/build/
# exclude init configurations other than systemd
%exclude %{_prefix}/src/docker/engine/contrib/init/openrc
%exclude %{_prefix}/src/docker/engine/contrib/init/sysvinit-debian
%exclude %{_prefix}/src/docker/engine/contrib/init/sysvinit-redhat
%exclude %{_prefix}/src/docker/engine/contrib/init/upstart
%if "%flavour" == "kubic" %if "%flavour" == "kubic"
%files kubeadm-criconfig %files kubeadm-criconfig

View File

@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash
# #
# Script for launching the Docker integration tests # Script for launching the Docker integration tests
# XXX: We currently only support running integration-cli.
# #
#set -x #set -x
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_DIR=/usr/src/docker DOCKER_DIR=/usr/src/docker
SCRIPTS_DIR=$DOCKER_DIR/hack SCRIPTS_DIR=$DOCKER_DIR/hack
TESTS_EXE=$SCRIPTS_DIR/tests.main TESTS_EXE=$SCRIPTS_DIR/integration-cli/tests.main
VERSION=$(cat $DOCKER_DIR/VERSION) VERSION=$(cat $DOCKER_DIR/VERSION)
# working dirs # working dirs