blob: 651a971364ea36b7fdfe8965ed2441ceef320ef4 [file]
#
# Copyright 2023 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
EAPI=7
EGO_PN=github.com/docker/docker
GIT_COMMIT=59118bff500fc0d95d0560a9788735a8d89568ce
GIT_VERSION=23.0.3
inherit golang-vcs-snapshot toolchain-funcs
DESCRIPTION="docker integration tests"
HOMEPAGE="https://www.docker.com/"
MY_PV="${PV/_/-}"
MY_PN="${PN/-test/}"
MY_P="${MY_PN}-${MY_PV}"
SRC_URI="https://github.com/moby/moby/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="*"
RDEPEND="
app-containers/docker-registry-test
"
PATCHES=(
"${FILESDIR}"/docker-24.0.9-Customize-make-test-integration-scripts.patch
"${FILESDIR}"/docker-23.0.3-Remove-iptables-flush.patch
"${FILESDIR}"/docker-23.0.3-Update-default-containerd-socket.patch
"${FILESDIR}"/docker-23.0.3-Skip-tests-with-open-issues.patch
"${FILESDIR}"/docker-23.0.3-Increase-context-and-poll-timeout-duration.patch
"${FILESDIR}"/docker-24.0.9-capabilities-test-use-network-mode-host.patch
"${FILESDIR}"/docker-24.0.9-fix_DiffTest.patch
"${FILESDIR}"/docker-24.0.9-fix_TestBuildSquashParent.patch
"${FILESDIR}"/docker-24.0.9-fix_nat_tests.patch
)
S="${WORKDIR}/${P}/src/${EGO_PN}"
src_compile(){
export GO111MODULE=off
export DOCKER_GITCOMMIT="${GIT_COMMIT}"
# lakitu: set VERSION so `docker version` doesn't show a dev build
export VERSION="${GIT_VERSION}"
export GOPATH="${WORKDIR}/${P}"
# lakitu: export a function named 'go' that invokes the go cross-compiler.
# The Docker build scripts will invoke this function instead of doing a PATH
# lookup for the go binary.
GO="$(tc-getGO)"
export GO
go() {
echo "${GO} $*" 1>&2
"${GO}" "$@"
}
export -f go
./hack/make.sh test-integration || die "Failed compiling tests"
unset -f go
}
src_install(){
TESTS_DIR=/usr/local/tests
insinto "${TESTS_DIR}"
doins -r "${S}"
# Make the test binary in all child directories executable
find integration -name "test.main" -printf "%h\n" | while read -r testBin; do
exeinto "${TESTS_DIR}"/docker/"${testBin}"
doexe "${S}/${testBin}"/test.main
done
exeinto "${TESTS_DIR}"/docker/integration-cli
doexe "${S}/integration-cli/test.main"
}