| # |
| # 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 |
| |
| inherit toolchain-funcs |
| |
| DESCRIPTION="cri-tools tests source" |
| HOMEPAGE="https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md" |
| MY_PV="${PV/_/-}" |
| MY_PN="${PN/-test/}" |
| MY_P="${MY_PN}-${MY_PV}" |
| |
| SRC_URI="https://github.com/kubernetes-sigs/cri-tools/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz" |
| |
| # This includes the licenses of dependencies as the binary is statically linked. |
| # |
| # If LICENSE contains BSD, ISC, or MIT, then chromite will scan the source for |
| # copyright attribution. If the package vendors its dependencies or includes a |
| # THIRD_PARTY_LICENSES/ directory, then chromite will properly attribute all |
| # dependencies in about_os_credits.html. |
| # |
| # This list was determined by inspecting the output of: |
| # go-licenses csv github.com/kubernetes-sigs/cri-tools/cmd/crictl |
| # inside a clone of the package repo. |
| # https://github.com/google/go-licenses |
| LICENSE="Apache-2.0 BSD-2 BSD ISC MIT" |
| SLOT="0" |
| KEYWORDS="*" |
| |
| PATCHES=( |
| "${FILESDIR}/1.25.0-Remove-crio-setup-in-test-framework.patch" |
| ) |
| |
| src_unpack(){ |
| default |
| mv "${WORKDIR}/${MY_P}" "${WORKDIR}/${MY_PN}" |
| S="${WORKDIR}/${MY_PN}" |
| } |
| |
| src_compile(){ |
| GO=$(tc-getGO) |
| export GO |
| cd test/e2e || die "Unable to find test directory" |
| ${GO} test -c -o cri-tools-e2e.test |
| } |
| |
| src_install(){ |
| TESTS_DIR=/usr/local/tests/"${MY_PN}" |
| |
| exeinto "${TESTS_DIR}" |
| doexe "${S}"/test/e2e/cri-tools-e2e.test |
| } |