mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
* add check for app update; fix ETUI error handling * validate user args * add goreleaser support * replace cgo dependencies (go-rpm) with go equivalents * add acceptance tests against build snapshot * add brew tap + acceptance test pipeline * add mac acceptance tests * fix compare makefile * fix mac acceptance tests * add release pipeline with wait checks * add token to release step * rm dir presenters int test * enforce dpkg to be non interactive Co-authored-by: Alfredo Deza <adeza@anchore.com> * pin brew formulae * pin skopeo to formulae url * only run acceptance tests Co-authored-by: Alfredo Deza <adeza@anchore.com>
46 lines
1.1 KiB
Bash
Executable File
46 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eux
|
|
|
|
DISTDIR=$1
|
|
ACC_DIR=$2
|
|
TEST_IMAGE=$3
|
|
|
|
TEST_TYPE=deb
|
|
WORK_DIR=`mktemp -d -t "imgbom-acceptance-test-${TEST_TYPE}-XXXXXX"`
|
|
REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${TEST_IMAGE}.json
|
|
GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${TEST_IMAGE}.json
|
|
|
|
# check if tmp dir was created
|
|
if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then
|
|
echo "Could not create temp dir"
|
|
exit 1
|
|
fi
|
|
|
|
function cleanup {
|
|
rm -rf "${WORK_DIR}"
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
# fetch test image
|
|
docker pull ${TEST_IMAGE}
|
|
|
|
# install and run imgbom
|
|
docker run --rm \
|
|
-v /var/run/docker.sock://var/run/docker.sock \
|
|
-v /${PWD}:/src \
|
|
-v ${WORK_DIR}:${WORK_DIR} \
|
|
-w /src \
|
|
ubuntu:latest \
|
|
/bin/bash -x -c "\
|
|
DEBIAN_FRONTEND=noninteractive apt install ${DISTDIR}/imgbom_*_linux_amd64.deb -y && \
|
|
imgbom version -v && \
|
|
imgbom ${TEST_IMAGE} -vv -o json > ${REPORT} && \
|
|
cat ${REPORT} \
|
|
"
|
|
|
|
# compare the results to a known good output
|
|
${ACC_DIR}/compare.py \
|
|
${GOLDEN_REPORT} \
|
|
${REPORT}
|