Rename $TESTSDIR (the plural one), step 3 of 3
...rename all remaining instances to $TEST_SOURCES Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
parent
f3e13380fb
commit
e347e88e02
|
@ -376,7 +376,7 @@ _EOF
|
||||||
_prefetch alpine
|
_prefetch alpine
|
||||||
cp -a $BUDFILES/use-layers ${TESTDIR}/use-layers
|
cp -a $BUDFILES/use-layers ${TESTDIR}/use-layers
|
||||||
mkdir ${TESTDIR}/use-layers/blah
|
mkdir ${TESTDIR}/use-layers/blah
|
||||||
ln -s ${TESTSDIR}/policy.json ${TESTDIR}/use-layers/blah/policy.json
|
ln -s ${TEST_SOURCES}/policy.json ${TESTDIR}/use-layers/blah/policy.json
|
||||||
|
|
||||||
run_buildah build $WITH_POLICY_JSON --layers -t test -f Dockerfile.dangling-symlink ${TESTDIR}/use-layers
|
run_buildah build $WITH_POLICY_JSON --layers -t test -f Dockerfile.dangling-symlink ${TESTDIR}/use-layers
|
||||||
run_buildah images -a
|
run_buildah images -a
|
||||||
|
@ -1670,7 +1670,7 @@ function _test_http() {
|
||||||
|
|
||||||
@test "bud with bad dir Dockerfile" {
|
@test "bud with bad dir Dockerfile" {
|
||||||
target=alpine-image
|
target=alpine-image
|
||||||
run_buildah 125 build $WITH_POLICY_JSON -t ${target} -f ${TESTSDIR}/baddirname ${TESTSDIR}/baddirname
|
run_buildah 125 build $WITH_POLICY_JSON -t ${target} -f ${TEST_SOURCES}/baddirname ${TEST_SOURCES}/baddirname
|
||||||
expect_output --substring "no such file or directory"
|
expect_output --substring "no such file or directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1946,25 +1946,25 @@ function _test_http() {
|
||||||
target=foo
|
target=foo
|
||||||
|
|
||||||
# A deny-all policy should prevent us from pulling the base image.
|
# A deny-all policy should prevent us from pulling the base image.
|
||||||
run_buildah 125 build --signature-policy ${TESTSDIR}/deny.json -t ${target} -v ${TESTSDIR}:/testdir $BUDFILES/mount
|
run_buildah 125 build --signature-policy ${TEST_SOURCES}/deny.json -t ${target} -v ${TEST_SOURCES}:/testdir $BUDFILES/mount
|
||||||
expect_output --substring 'Source image rejected: Running image .* rejected by policy.'
|
expect_output --substring 'Source image rejected: Running image .* rejected by policy.'
|
||||||
|
|
||||||
# A docker-only policy should allow us to pull the base image and commit.
|
# A docker-only policy should allow us to pull the base image and commit.
|
||||||
run_buildah build --signature-policy ${TESTSDIR}/docker.json -t ${target} -v ${TESTSDIR}:/testdir $BUDFILES/mount
|
run_buildah build --signature-policy ${TEST_SOURCES}/docker.json -t ${target} -v ${TEST_SOURCES}:/testdir $BUDFILES/mount
|
||||||
# A deny-all policy shouldn't break pushing, since policy is only evaluated
|
# A deny-all policy shouldn't break pushing, since policy is only evaluated
|
||||||
# on the source image, and we force it to allow local storage.
|
# on the source image, and we force it to allow local storage.
|
||||||
run_buildah push --signature-policy ${TESTSDIR}/deny.json ${target} dir:${TESTDIR}/mount
|
run_buildah push --signature-policy ${TEST_SOURCES}/deny.json ${target} dir:${TESTDIR}/mount
|
||||||
run_buildah rmi ${target}
|
run_buildah rmi ${target}
|
||||||
|
|
||||||
# A docker-only policy should allow us to pull the base image first...
|
# A docker-only policy should allow us to pull the base image first...
|
||||||
run_buildah pull --signature-policy ${TESTSDIR}/docker.json alpine
|
run_buildah pull --signature-policy ${TEST_SOURCES}/docker.json alpine
|
||||||
# ... and since we don't need to pull the base image, a deny-all policy shouldn't break a build.
|
# ... and since we don't need to pull the base image, a deny-all policy shouldn't break a build.
|
||||||
run_buildah build --signature-policy ${TESTSDIR}/deny.json -t ${target} -v ${TESTSDIR}:/testdir $BUDFILES/mount
|
run_buildah build --signature-policy ${TEST_SOURCES}/deny.json -t ${target} -v ${TEST_SOURCES}:/testdir $BUDFILES/mount
|
||||||
# A deny-all policy shouldn't break pushing, since policy is only evaluated
|
# A deny-all policy shouldn't break pushing, since policy is only evaluated
|
||||||
# on the source image, and we force it to allow local storage.
|
# on the source image, and we force it to allow local storage.
|
||||||
run_buildah push --signature-policy ${TESTSDIR}/deny.json ${target} dir:${TESTDIR}/mount
|
run_buildah push --signature-policy ${TEST_SOURCES}/deny.json ${target} dir:${TESTDIR}/mount
|
||||||
# Similarly, a deny-all policy shouldn't break committing directly to other locations.
|
# Similarly, a deny-all policy shouldn't break committing directly to other locations.
|
||||||
run_buildah build --signature-policy ${TESTSDIR}/deny.json -t dir:${TESTDIR}/mount -v ${TESTSDIR}:/testdir $BUDFILES/mount
|
run_buildah build --signature-policy ${TEST_SOURCES}/deny.json -t dir:${TESTDIR}/mount -v ${TEST_SOURCES}:/testdir $BUDFILES/mount
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "bud-copy-replace-symlink" {
|
@test "bud-copy-replace-symlink" {
|
||||||
|
@ -2156,12 +2156,12 @@ _EOF
|
||||||
|
|
||||||
@test "bud without any arguments should succeed" {
|
@test "bud without any arguments should succeed" {
|
||||||
cd $BUDFILES/from-scratch
|
cd $BUDFILES/from-scratch
|
||||||
run_buildah build --signature-policy ${TESTSDIR}/policy.json
|
run_buildah build --signature-policy ${TEST_SOURCES}/policy.json
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "bud without any arguments should fail when no Dockerfile exist" {
|
@test "bud without any arguments should fail when no Dockerfile exist" {
|
||||||
cd $(mktemp -d)
|
cd $(mktemp -d)
|
||||||
run_buildah 125 build --signature-policy ${TESTSDIR}/policy.json
|
run_buildah 125 build --signature-policy ${TEST_SOURCES}/policy.json
|
||||||
expect_output --substring "no such file or directory"
|
expect_output --substring "no such file or directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2362,7 +2362,7 @@ _EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "bud using gitrepo and branch" {
|
@test "bud using gitrepo and branch" {
|
||||||
if ! start_git_daemon ${TESTSDIR}/git-daemon/release-1.11-rhel.tar.gz ; then
|
if ! start_git_daemon ${TEST_SOURCES}/git-daemon/release-1.11-rhel.tar.gz ; then
|
||||||
skip "error running git daemon"
|
skip "error running git daemon"
|
||||||
fi
|
fi
|
||||||
run_buildah build $WITH_POLICY_JSON --layers -t gittarget -f $BUDFILES/shell/Dockerfile git://localhost:${GITPORT}/repo#release-1.11-rhel
|
run_buildah build $WITH_POLICY_JSON --layers -t gittarget -f $BUDFILES/shell/Dockerfile git://localhost:${GITPORT}/repo#release-1.11-rhel
|
||||||
|
@ -2378,7 +2378,7 @@ _EOF
|
||||||
# First check to verify cache is used if the tar file does not change
|
# First check to verify cache is used if the tar file does not change
|
||||||
target=copy-archive
|
target=copy-archive
|
||||||
date > $BUDFILES/${target}/test
|
date > $BUDFILES/${target}/test
|
||||||
tar -C $TESTSDIR -cJf $BUDFILES/${target}/test.tar.xz bud/${target}/test
|
tar -C $TEST_SOURCES -cJf $BUDFILES/${target}/test.tar.xz bud/${target}/test
|
||||||
run_buildah build $WITH_POLICY_JSON --layers -t ${target} $BUDFILES/${target}
|
run_buildah build $WITH_POLICY_JSON --layers -t ${target} $BUDFILES/${target}
|
||||||
expect_output --substring "COMMIT copy-archive"
|
expect_output --substring "COMMIT copy-archive"
|
||||||
|
|
||||||
|
@ -2388,7 +2388,7 @@ _EOF
|
||||||
|
|
||||||
# Now test that we do NOT use cache if the tar file changes
|
# Now test that we do NOT use cache if the tar file changes
|
||||||
echo This is a change >> $BUDFILES/${target}/test
|
echo This is a change >> $BUDFILES/${target}/test
|
||||||
tar -C $TESTSDIR -cJf $BUDFILES/${target}/test.tar.xz bud/${target}/test
|
tar -C $TEST_SOURCES -cJf $BUDFILES/${target}/test.tar.xz bud/${target}/test
|
||||||
run_buildah build $WITH_POLICY_JSON --layers -t ${target} $BUDFILES/${target}
|
run_buildah build $WITH_POLICY_JSON --layers -t ${target} $BUDFILES/${target}
|
||||||
if [[ "$output" =~ " Using cache" ]]; then
|
if [[ "$output" =~ " Using cache" ]]; then
|
||||||
expect_output "[no instance of 'Using cache']" "no cache used"
|
expect_output "[no instance of 'Using cache']" "no cache used"
|
||||||
|
|
|
@ -15,7 +15,7 @@ load helpers
|
||||||
|
|
||||||
run_buildah rm $cid
|
run_buildah rm $cid
|
||||||
|
|
||||||
sed "s/^label = true/label = false/g" ${TESTSDIR}/containers.conf > ${TESTDIR}/containers.conf
|
sed "s/^label = true/label = false/g" ${TEST_SOURCES}/containers.conf > ${TESTDIR}/containers.conf
|
||||||
cid=$(buildah from $WITH_POLICY_JSON alpine)
|
cid=$(buildah from $WITH_POLICY_JSON alpine)
|
||||||
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah 1 --log-level=error run $cid sh -c "cat /proc/self/attr/current | grep container_t"
|
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah 1 --log-level=error run $cid sh -c "cat /proc/self/attr/current | grep container_t"
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ load helpers
|
||||||
CONTAINERS_CONF=$CONTAINERS_CONF run_buildah 1 --log-level=error run $cid ls /dev/foo1
|
CONTAINERS_CONF=$CONTAINERS_CONF run_buildah 1 --log-level=error run $cid ls /dev/foo1
|
||||||
run_buildah rm $cid
|
run_buildah rm $cid
|
||||||
|
|
||||||
sed '/^devices.*/a "\/dev\/foo:\/dev\/foo1:rmw",' ${TESTSDIR}/containers.conf > ${TESTDIR}/containers.conf
|
sed '/^devices.*/a "\/dev\/foo:\/dev\/foo1:rmw",' ${TEST_SOURCES}/containers.conf > ${TESTDIR}/containers.conf
|
||||||
rm -f /dev/foo; mknod /dev/foo c 1 1
|
rm -f /dev/foo; mknod /dev/foo c 1 1
|
||||||
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah from --quiet $WITH_POLICY_JSON alpine
|
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah from --quiet $WITH_POLICY_JSON alpine
|
||||||
cid="$output"
|
cid="$output"
|
||||||
|
@ -64,7 +64,7 @@ load helpers
|
||||||
expect_output "00000000a80425fb"
|
expect_output "00000000a80425fb"
|
||||||
run_buildah rm $cid
|
run_buildah rm $cid
|
||||||
|
|
||||||
sed "/AUDIT_WRITE/d" ${TESTSDIR}/containers.conf > ${TESTDIR}/containers.conf
|
sed "/AUDIT_WRITE/d" ${TEST_SOURCES}/containers.conf > ${TESTDIR}/containers.conf
|
||||||
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah from --quiet $WITH_POLICY_JSON alpine
|
CONTAINERS_CONF=${TESTDIR}/containers.conf run_buildah from --quiet $WITH_POLICY_JSON alpine
|
||||||
cid="$output"
|
cid="$output"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
BUILDAH_BINARY=${BUILDAH_BINARY:-$(dirname ${BASH_SOURCE})/../bin/buildah}
|
# Directory in which tests live
|
||||||
IMGTYPE_BINARY=${IMGTYPE_BINARY:-$(dirname ${BASH_SOURCE})/../bin/imgtype}
|
TEST_SOURCES=${TEST_SOURCES:-$(dirname ${BASH_SOURCE})}
|
||||||
COPY_BINARY=${COPY_BINARY:-$(dirname ${BASH_SOURCE})/../bin/copy}
|
|
||||||
TESTSDIR=${TESTSDIR:-$(dirname ${BASH_SOURCE})}
|
BUILDAH_BINARY=${BUILDAH_BINARY:-$TEST_SOURCES/../bin/buildah}
|
||||||
|
IMGTYPE_BINARY=${IMGTYPE_BINARY:-$TEST_SOURCES/../bin/imgtype}
|
||||||
|
COPY_BINARY=${COPY_BINARY:-$TEST_SOURCES/../bin/copy}
|
||||||
STORAGE_DRIVER=${STORAGE_DRIVER:-vfs}
|
STORAGE_DRIVER=${STORAGE_DRIVER:-vfs}
|
||||||
PATH=$(dirname ${BASH_SOURCE})/../bin:${PATH}
|
PATH=$(dirname ${BASH_SOURCE})/../bin:${PATH}
|
||||||
OCI=$(${BUILDAH_BINARY} info --format '{{.host.OCIRuntime}}' || command -v runc || command -v crun)
|
OCI=$(${BUILDAH_BINARY} info --format '{{.host.OCIRuntime}}' || command -v runc || command -v crun)
|
||||||
|
@ -11,10 +13,10 @@ OCI=$(${BUILDAH_BINARY} info --format '{{.host.OCIRuntime}}' || command -v runc
|
||||||
BUILDAH_TIMEOUT=${BUILDAH_TIMEOUT:-300}
|
BUILDAH_TIMEOUT=${BUILDAH_TIMEOUT:-300}
|
||||||
|
|
||||||
# Shortcut for directory containing Containerfiles for bud.bats
|
# Shortcut for directory containing Containerfiles for bud.bats
|
||||||
BUDFILES=${TESTSDIR}/bud
|
BUDFILES=${TEST_SOURCES}/bud
|
||||||
|
|
||||||
# Used hundreds of times throughout all the tests
|
# Used hundreds of times throughout all the tests
|
||||||
WITH_POLICY_JSON="--signature-policy ${TESTSDIR}/policy.json"
|
WITH_POLICY_JSON="--signature-policy ${TEST_SOURCES}/policy.json"
|
||||||
|
|
||||||
# We don't invoke gnupg directly in many places, but this avoids ENOTTY errors
|
# We don't invoke gnupg directly in many places, but this avoids ENOTTY errors
|
||||||
# when we invoke it directly in batch mode, and CI runs us without a terminal
|
# when we invoke it directly in batch mode, and CI runs us without a terminal
|
||||||
|
@ -47,13 +49,13 @@ EOF
|
||||||
|
|
||||||
# Common options for all buildah and podman invocations
|
# Common options for all buildah and podman invocations
|
||||||
ROOTDIR_OPTS="--root ${TESTDIR}/root --runroot ${TESTDIR}/runroot --storage-driver ${STORAGE_DRIVER}"
|
ROOTDIR_OPTS="--root ${TESTDIR}/root --runroot ${TESTDIR}/runroot --storage-driver ${STORAGE_DRIVER}"
|
||||||
BUILDAH_REGISTRY_OPTS="--registries-conf ${TESTSDIR}/registries.conf --registries-conf-dir ${TESTDIR}/registries.d --short-name-alias-conf ${TESTDIR}/cache/shortnames.conf"
|
BUILDAH_REGISTRY_OPTS="--registries-conf ${TEST_SOURCES}/registries.conf --registries-conf-dir ${TESTDIR}/registries.d --short-name-alias-conf ${TESTDIR}/cache/shortnames.conf"
|
||||||
PODMAN_REGISTRY_OPTS="--registries-conf ${TESTSDIR}/registries.conf"
|
PODMAN_REGISTRY_OPTS="--registries-conf ${TEST_SOURCES}/registries.conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
function starthttpd() {
|
function starthttpd() {
|
||||||
pushd ${2:-${TESTDIR}} > /dev/null
|
pushd ${2:-${TESTDIR}} > /dev/null
|
||||||
go build -o serve ${TESTSDIR}/serve/serve.go
|
go build -o serve ${TEST_SOURCES}/serve/serve.go
|
||||||
portfile=$(mktemp)
|
portfile=$(mktemp)
|
||||||
if test -z "${portfile}"; then
|
if test -z "${portfile}"; then
|
||||||
echo error creating temporaty file
|
echo error creating temporaty file
|
||||||
|
@ -596,7 +598,7 @@ function skip_if_no_docker() {
|
||||||
function start_git_daemon() {
|
function start_git_daemon() {
|
||||||
daemondir=${TESTDIR}/git-daemon
|
daemondir=${TESTDIR}/git-daemon
|
||||||
mkdir -p ${daemondir}/repo
|
mkdir -p ${daemondir}/repo
|
||||||
gzip -dc < ${1:-${TESTSDIR}/git-daemon/repo.tar.gz} | tar x -C ${daemondir}/repo
|
gzip -dc < ${1:-${TEST_SOURCES}/git-daemon/repo.tar.gz} | tar x -C ${daemondir}/repo
|
||||||
GITPORT=$(($RANDOM + 32768))
|
GITPORT=$(($RANDOM + 32768))
|
||||||
git daemon --detach --pid-file=${TESTDIR}/git-daemon/pid --reuseaddr --port=${GITPORT} --base-path=${daemondir} ${daemondir}
|
git daemon --detach --pid-file=${TESTDIR}/git-daemon/pid --reuseaddr --port=${GITPORT} --base-path=${daemondir} ${daemondir}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,32 +29,32 @@ load helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "pull-blocked" {
|
@test "pull-blocked" {
|
||||||
run_buildah 125 --registries-conf ${TESTSDIR}/registries.conf.block pull $WITH_POLICY_JSON docker.io/alpine
|
run_buildah 125 --registries-conf ${TEST_SOURCES}/registries.conf.block pull $WITH_POLICY_JSON docker.io/alpine
|
||||||
expect_output --substring "registry docker.io is blocked in"
|
expect_output --substring "registry docker.io is blocked in"
|
||||||
|
|
||||||
run_buildah --retry --registries-conf ${TESTSDIR}/registries.conf pull $WITH_POLICY_JSON docker.io/alpine
|
run_buildah --retry --registries-conf ${TEST_SOURCES}/registries.conf pull $WITH_POLICY_JSON docker.io/alpine
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "pull-from-registry" {
|
@test "pull-from-registry" {
|
||||||
run_buildah --retry pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON busybox:glibc
|
run_buildah --retry pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON busybox:glibc
|
||||||
run_buildah pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON busybox:latest
|
run_buildah pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON busybox:latest
|
||||||
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
||||||
expect_output --substring "busybox:glibc"
|
expect_output --substring "busybox:glibc"
|
||||||
expect_output --substring "busybox:latest"
|
expect_output --substring "busybox:latest"
|
||||||
# We need to see if this file is created after first pull in at least one test
|
# We need to see if this file is created after first pull in at least one test
|
||||||
[ -f ${TESTDIR}/root/defaultNetworkBackend ]
|
[ -f ${TESTDIR}/root/defaultNetworkBackend ]
|
||||||
|
|
||||||
run_buildah --retry pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON quay.io/libpod/alpine_nginx:latest
|
run_buildah --retry pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON quay.io/libpod/alpine_nginx:latest
|
||||||
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
||||||
expect_output --substring "alpine_nginx:latest"
|
expect_output --substring "alpine_nginx:latest"
|
||||||
|
|
||||||
run_buildah rmi quay.io/libpod/alpine_nginx:latest
|
run_buildah rmi quay.io/libpod/alpine_nginx:latest
|
||||||
run_buildah --retry pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON quay.io/libpod/alpine_nginx
|
run_buildah --retry pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON quay.io/libpod/alpine_nginx
|
||||||
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
||||||
expect_output --substring "alpine_nginx:latest"
|
expect_output --substring "alpine_nginx:latest"
|
||||||
|
|
||||||
run_buildah --retry pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON alpine@sha256:e9a2035f9d0d7cee1cdd445f5bfa0c5c646455ee26f14565dce23cf2d2de7570
|
run_buildah --retry pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON alpine@sha256:e9a2035f9d0d7cee1cdd445f5bfa0c5c646455ee26f14565dce23cf2d2de7570
|
||||||
run_buildah 125 pull --registries-conf ${TESTSDIR}/registries.conf $WITH_POLICY_JSON fakeimage/fortest
|
run_buildah 125 pull --registries-conf ${TEST_SOURCES}/registries.conf $WITH_POLICY_JSON fakeimage/fortest
|
||||||
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
run_buildah images --format "{{.Name}}:{{.Tag}}"
|
||||||
[[ ! "$output" =~ "fakeimage/fortest" ]]
|
[[ ! "$output" =~ "fakeimage/fortest" ]]
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ load helpers
|
||||||
declare -a tags=(0.9 0.9.1 1.1 alpha beta gamma2.0 latest)
|
declare -a tags=(0.9 0.9.1 1.1 alpha beta gamma2.0 latest)
|
||||||
|
|
||||||
# setup: pull alpine, and push it repeatedly to localhost using those tags
|
# setup: pull alpine, and push it repeatedly to localhost using those tags
|
||||||
opts="--signature-policy ${TESTSDIR}/policy.json --tls-verify=false --creds testuser:testpassword"
|
opts="--signature-policy ${TEST_SOURCES}/policy.json --tls-verify=false --creds testuser:testpassword"
|
||||||
run_buildah --retry pull --quiet $WITH_POLICY_JSON alpine
|
run_buildah --retry pull --quiet $WITH_POLICY_JSON alpine
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
run_buildah push $opts alpine localhost:${REGISTRY_PORT}/myalpine:$tag
|
run_buildah push $opts alpine localhost:${REGISTRY_PORT}/myalpine:$tag
|
||||||
|
@ -162,18 +162,18 @@ load helpers
|
||||||
@test "pull-denied-by-registry-sources" {
|
@test "pull-denied-by-registry-sources" {
|
||||||
export BUILD_REGISTRY_SOURCES='{"blockedRegistries": ["docker.io"]}'
|
export BUILD_REGISTRY_SOURCES='{"blockedRegistries": ["docker.io"]}'
|
||||||
|
|
||||||
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TESTSDIR}/registries.conf.hub --quiet busybox
|
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TEST_SOURCES}/registries.conf.hub --quiet busybox
|
||||||
expect_output --substring 'registry "docker.io" denied by policy: it is in the blocked registries list'
|
expect_output --substring 'registry "docker.io" denied by policy: it is in the blocked registries list'
|
||||||
|
|
||||||
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TESTSDIR}/registries.conf.hub --quiet busybox
|
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TEST_SOURCES}/registries.conf.hub --quiet busybox
|
||||||
expect_output --substring 'registry "docker.io" denied by policy: it is in the blocked registries list'
|
expect_output --substring 'registry "docker.io" denied by policy: it is in the blocked registries list'
|
||||||
|
|
||||||
export BUILD_REGISTRY_SOURCES='{"allowedRegistries": ["some-other-registry.example.com"]}'
|
export BUILD_REGISTRY_SOURCES='{"allowedRegistries": ["some-other-registry.example.com"]}'
|
||||||
|
|
||||||
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TESTSDIR}/registries.conf.hub --quiet busybox
|
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TEST_SOURCES}/registries.conf.hub --quiet busybox
|
||||||
expect_output --substring 'registry "docker.io" denied by policy: not in allowed registries list'
|
expect_output --substring 'registry "docker.io" denied by policy: not in allowed registries list'
|
||||||
|
|
||||||
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TESTSDIR}/registries.conf.hub --quiet busybox
|
run_buildah 125 pull $WITH_POLICY_JSON --registries-conf ${TEST_SOURCES}/registries.conf.hub --quiet busybox
|
||||||
expect_output --substring 'registry "docker.io" denied by policy: not in allowed registries list'
|
expect_output --substring 'registry "docker.io" denied by policy: not in allowed registries list'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -467,7 +467,7 @@ function configure_and_check_user() {
|
||||||
skip_if_no_runtime
|
skip_if_no_runtime
|
||||||
|
|
||||||
# we need to not use the list of limits that are set in our default
|
# we need to not use the list of limits that are set in our default
|
||||||
# ${TESTSDIR}/containers.conf for the sake of other tests, and override
|
# ${TEST_SOURCES}/containers.conf for the sake of other tests, and override
|
||||||
# any that might be picked up from system-wide configuration
|
# any that might be picked up from system-wide configuration
|
||||||
echo '[containers]' > ${TESTDIR}/containers.conf
|
echo '[containers]' > ${TESTDIR}/containers.conf
|
||||||
echo 'default_ulimits = []' >> ${TESTDIR}/containers.conf
|
echo 'default_ulimits = []' >> ${TESTDIR}/containers.conf
|
||||||
|
|
|
@ -18,7 +18,7 @@ SBOX=/tmp/sandbox
|
||||||
PACKAGES=/tmp/packages
|
PACKAGES=/tmp/packages
|
||||||
mkdir -p ${SBOX}/buildah
|
mkdir -p ${SBOX}/buildah
|
||||||
GITROOT=${SBOX}/buildah
|
GITROOT=${SBOX}/buildah
|
||||||
TESTSDIR=${GITROOT}/tests
|
TEST_SOURCES=${GITROOT}/tests
|
||||||
|
|
||||||
# Change packager as appropriate for the platform
|
# Change packager as appropriate for the platform
|
||||||
PACKAGER=dnf
|
PACKAGER=dnf
|
||||||
|
@ -36,7 +36,7 @@ cd $GITROOT
|
||||||
########
|
########
|
||||||
# Build a container to use for building the binaries.
|
# Build a container to use for building the binaries.
|
||||||
########
|
########
|
||||||
CTRID=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $IMAGE)
|
CTRID=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $IMAGE)
|
||||||
ROOTMNT=$(buildah mount $CTRID)
|
ROOTMNT=$(buildah mount $CTRID)
|
||||||
COMMIT=$(git log --format=%H -n 1)
|
COMMIT=$(git log --format=%H -n 1)
|
||||||
SHORTCOMMIT=$(echo ${COMMIT} | cut -c-7)
|
SHORTCOMMIT=$(echo ${COMMIT} | cut -c-7)
|
||||||
|
@ -62,7 +62,7 @@ buildah run $CTRID -- rpmbuild --define "_topdir /rpmbuild" -ba /rpmbuild/SPECS/
|
||||||
########
|
########
|
||||||
# Build a second new container.
|
# Build a second new container.
|
||||||
########
|
########
|
||||||
CTRID2=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $IMAGE)
|
CTRID2=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $IMAGE)
|
||||||
ROOTMNT2=$(buildah mount $CTRID2)
|
ROOTMNT2=$(buildah mount $CTRID2)
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -105,14 +105,14 @@ buildah rmi -f $(buildah images -q)
|
||||||
########
|
########
|
||||||
# Kick off baseline testing against the installed Buildah
|
# Kick off baseline testing against the installed Buildah
|
||||||
########
|
########
|
||||||
/bin/bash -v ${TESTSDIR}/test_buildah_baseline.sh
|
/bin/bash -v ${TEST_SOURCES}/test_buildah_baseline.sh
|
||||||
|
|
||||||
########
|
########
|
||||||
# Install the Buildah we just built locally and run
|
# Install the Buildah we just built locally and run
|
||||||
# the baseline tests again.
|
# the baseline tests again.
|
||||||
########
|
########
|
||||||
${PACKAGER} -y install ${PACKAGES}/*.rpm
|
${PACKAGER} -y install ${PACKAGES}/*.rpm
|
||||||
/bin/bash -v ${TESTSDIR}/test_buildah_baseline.sh
|
/bin/bash -v ${TEST_SOURCES}/test_buildah_baseline.sh
|
||||||
|
|
||||||
########
|
########
|
||||||
# Clean up
|
# Clean up
|
||||||
|
|
|
@ -4,7 +4,7 @@ load helpers
|
||||||
|
|
||||||
# Ensure that any updated/pushed rpm .spec files don't clobber the commit placeholder
|
# Ensure that any updated/pushed rpm .spec files don't clobber the commit placeholder
|
||||||
@test "rpm REPLACEWITHCOMMITID placeholder exists in .spec file" {
|
@test "rpm REPLACEWITHCOMMITID placeholder exists in .spec file" {
|
||||||
run grep -q "^%global[ ]\+commit[ ]\+REPLACEWITHCOMMITID$" ${TESTSDIR}/../contrib/rpm/buildah.spec
|
run grep -q "^%global[ ]\+commit[ ]\+REPLACEWITHCOMMITID$" ${TEST_SOURCES}/../contrib/rpm/buildah.spec
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ load helpers
|
||||||
|
|
||||||
# Build a container to use for building the binaries.
|
# Build a container to use for building the binaries.
|
||||||
image=registry.centos.org/centos/centos:centos7
|
image=registry.centos.org/centos/centos:centos7
|
||||||
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $image)
|
cid=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $image)
|
||||||
root=$(buildah mount $cid)
|
root=$(buildah mount $cid)
|
||||||
commit=$(git log --format=%H -n 1)
|
commit=$(git log --format=%H -n 1)
|
||||||
shortcommit=$(echo ${commit} | cut -c-7)
|
shortcommit=$(echo ${commit} | cut -c-7)
|
||||||
|
@ -23,7 +23,7 @@ load helpers
|
||||||
(cd ..; git archive --format tar.gz --prefix=buildah-${commit}/ ${commit}) > ${root}/rpmbuild/SOURCES/buildah-${shortcommit}.tar.gz
|
(cd ..; git archive --format tar.gz --prefix=buildah-${commit}/ ${commit}) > ${root}/rpmbuild/SOURCES/buildah-${shortcommit}.tar.gz
|
||||||
|
|
||||||
# Update the .spec file with the commit ID.
|
# Update the .spec file with the commit ID.
|
||||||
sed s:REPLACEWITHCOMMITID:${commit}:g ${TESTSDIR}/../contrib/rpm/buildah.spec > ${root}/rpmbuild/SPECS/buildah.spec
|
sed s:REPLACEWITHCOMMITID:${commit}:g ${TEST_SOURCES}/../contrib/rpm/buildah.spec > ${root}/rpmbuild/SPECS/buildah.spec
|
||||||
|
|
||||||
# Install build dependencies and build binary packages.
|
# Install build dependencies and build binary packages.
|
||||||
buildah run $cid -- yum -y install rpm-build yum-utils
|
buildah run $cid -- yum -y install rpm-build yum-utils
|
||||||
|
@ -31,7 +31,7 @@ load helpers
|
||||||
buildah run $cid -- rpmbuild --define "_topdir /rpmbuild" -ba /rpmbuild/SPECS/buildah.spec
|
buildah run $cid -- rpmbuild --define "_topdir /rpmbuild" -ba /rpmbuild/SPECS/buildah.spec
|
||||||
|
|
||||||
# Build a second new container.
|
# Build a second new container.
|
||||||
cid2=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $image)
|
cid2=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $image)
|
||||||
root2=$(buildah mount $cid2)
|
root2=$(buildah mount $cid2)
|
||||||
|
|
||||||
# Copy the binary packages from the first container to the second one, and build a list of
|
# Copy the binary packages from the first container to the second one, and build a list of
|
||||||
|
@ -66,7 +66,7 @@ load helpers
|
||||||
|
|
||||||
# Build a container to use for building the binaries.
|
# Build a container to use for building the binaries.
|
||||||
image=registry.fedoraproject.org/fedora:latest
|
image=registry.fedoraproject.org/fedora:latest
|
||||||
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $image)
|
cid=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $image)
|
||||||
root=$(buildah mount $cid)
|
root=$(buildah mount $cid)
|
||||||
commit=$(git log --format=%H -n 1)
|
commit=$(git log --format=%H -n 1)
|
||||||
shortcommit=$(echo ${commit} | cut -c-7)
|
shortcommit=$(echo ${commit} | cut -c-7)
|
||||||
|
@ -76,7 +76,7 @@ load helpers
|
||||||
(cd ..; git archive --format tar.gz --prefix=buildah-${commit}/ ${commit}) > ${root}/rpmbuild/SOURCES/buildah-${shortcommit}.tar.gz
|
(cd ..; git archive --format tar.gz --prefix=buildah-${commit}/ ${commit}) > ${root}/rpmbuild/SOURCES/buildah-${shortcommit}.tar.gz
|
||||||
|
|
||||||
# Update the .spec file with the commit ID.
|
# Update the .spec file with the commit ID.
|
||||||
sed s:REPLACEWITHCOMMITID:${commit}:g ${TESTSDIR}/../contrib/rpm/buildah.spec > ${root}/rpmbuild/SPECS/buildah.spec
|
sed s:REPLACEWITHCOMMITID:${commit}:g ${TEST_SOURCES}/../contrib/rpm/buildah.spec > ${root}/rpmbuild/SPECS/buildah.spec
|
||||||
|
|
||||||
# Install build dependencies and build binary packages.
|
# Install build dependencies and build binary packages.
|
||||||
buildah run $cid -- dnf -y install 'dnf-command(builddep)' rpm-build
|
buildah run $cid -- dnf -y install 'dnf-command(builddep)' rpm-build
|
||||||
|
@ -84,7 +84,7 @@ load helpers
|
||||||
buildah run $cid -- rpmbuild --define "_topdir /rpmbuild" -ba /rpmbuild/SPECS/buildah.spec
|
buildah run $cid -- rpmbuild --define "_topdir /rpmbuild" -ba /rpmbuild/SPECS/buildah.spec
|
||||||
|
|
||||||
# Build a second new container.
|
# Build a second new container.
|
||||||
cid2=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json $image)
|
cid2=$(buildah from --pull --signature-policy ${TEST_SOURCES}/policy.json $image)
|
||||||
root2=$(buildah mount $cid2)
|
root2=$(buildah mount $cid2)
|
||||||
|
|
||||||
# Copy the binary packages from the first container to the second one, and build a list of
|
# Copy the binary packages from the first container to the second one, and build a list of
|
||||||
|
|
|
@ -7,24 +7,24 @@ load helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "buildah version current in .spec file Version" {
|
@test "buildah version current in .spec file Version" {
|
||||||
if [ ! -d "${TESTSDIR}/../contrib/rpm" ]; then
|
if [ ! -d "${TEST_SOURCES}/../contrib/rpm" ]; then
|
||||||
skip "No source dir available"
|
skip "No source dir available"
|
||||||
fi
|
fi
|
||||||
run_buildah version
|
run_buildah version
|
||||||
bversion=$(awk '/^Version:/ { print $NF }' <<< "$output")
|
bversion=$(awk '/^Version:/ { print $NF }' <<< "$output")
|
||||||
rversion=$(awk '/^Version:/ { print $NF }' < ${TESTSDIR}/../contrib/rpm/buildah.spec)
|
rversion=$(awk '/^Version:/ { print $NF }' < ${TEST_SOURCES}/../contrib/rpm/buildah.spec)
|
||||||
echo "bversion=${bversion}"
|
echo "bversion=${bversion}"
|
||||||
echo "rversion=${rversion}"
|
echo "rversion=${rversion}"
|
||||||
test "${bversion}" = "${rversion}" -o "${bversion}" = "${rversion}-dev"
|
test "${bversion}" = "${rversion}" -o "${bversion}" = "${rversion}-dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "buildah version current in .spec file changelog" {
|
@test "buildah version current in .spec file changelog" {
|
||||||
if [ ! -d "${TESTSDIR}/../contrib/rpm" ]; then
|
if [ ! -d "${TEST_SOURCES}/../contrib/rpm" ]; then
|
||||||
skip "No source dir available"
|
skip "No source dir available"
|
||||||
fi
|
fi
|
||||||
run_buildah version
|
run_buildah version
|
||||||
bversion=$(awk '/^Version:/ { print $NF }' <<< "$output")
|
bversion=$(awk '/^Version:/ { print $NF }' <<< "$output")
|
||||||
grep -A1 ^%changelog ${TESTSDIR}/../contrib/rpm/buildah.spec | grep -q " ${bversion}-"
|
grep -A1 ^%changelog ${TEST_SOURCES}/../contrib/rpm/buildah.spec | grep -q " ${bversion}-"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "buildah version current in package" {
|
@test "buildah version current in package" {
|
||||||
|
|
Loading…
Reference in New Issue