Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
Signed-off-by: Juncheng Zhu <[email protected]>
  • Loading branch information
junczhu committed Dec 11, 2024
1 parent bee2ce3 commit afa4dcb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/bats/base-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions test/bats/cli-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 6 additions & 0 deletions test/bats/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 $!)
}

0 comments on commit afa4dcb

Please sign in to comment.