diff --git a/Makefile b/Makefile index adda7c62a..6d0d4c05d 100644 --- a/Makefile +++ b/Makefile @@ -342,9 +342,6 @@ e2e-notation-crl-setup: ${GITHUB_WORKSPACE}/bin/oras cp --from-oci-layout .staging/notation/notation.tar:v0 ${TEST_REGISTRY}/notation:crl rm .staging/notation/notation.tar NOTATION_EXPERIMENTAL=1 .staging/notation/notation sign -u ${TEST_REGISTRY_USERNAME} -p ${TEST_REGISTRY_PASSWORD} --key "crl-test" ${TEST_REGISTRY}/notation@`${GITHUB_WORKSPACE}/bin/oras manifest fetch ${TEST_REGISTRY}/notation:crl --descriptor | jq .digest | xargs` - # run the CRL server in the background - python3 ./scripts/crl_server.py & - CRL_SERVER_PID=$(shell $!) e2e-cosign-setup: diff --git a/test/bats/base-test.bats b/test/bats/base-test.bats index 5ff4482e4..88c476bcd 100644 --- a/test/bats/base-test.bats +++ b/test/bats/base-test.bats @@ -130,7 +130,7 @@ RATIFY_NAMESPACE=gatekeeper-system echo "cleaning up" wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete pod demo --namespace default --force --ignore-not-found=true' } - + run_crl_server run kubectl run demo --namespace default --image=registry:5000/notation:crl assert_success } diff --git a/test/bats/cli-test.bats b/test/bats/cli-test.bats index 3e99f821c..94819cd95 100644 --- a/test/bats/cli-test.bats +++ b/test/bats/cli-test.bats @@ -35,6 +35,8 @@ load helpers } @test "notation verifier crl test" { + run_crl_server + run bin/ratify verify -c $RATIFY_DIR/config_notation_crl.json -s $TEST_REGISTRY/notation:crl assert_cmd_verify_success } diff --git a/test/bats/helpers.bash b/test/bats/helpers.bash index d8c872686..aa95ab664 100644 --- a/test/bats/helpers.bash +++ b/test/bats/helpers.bash @@ -111,3 +111,9 @@ wait_for_process() { done return 1 } + +# run the CRL server in the background +run_crl_server() { + python3 ./scripts/crl_server.py & + echo $(shell $!) +} \ No newline at end of file