From 727c25b08f47e5b2a90dc6073acac6bd26db8d53 Mon Sep 17 00:00:00 2001 From: Fahrzin Hemmati Date: Mon, 20 Jan 2025 14:18:13 -0800 Subject: [PATCH] Add tests --- .../docker-credential-devpod-esque | 11 +++++++++++ e2e/assertion/oci_pull_auth_tests.bats | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 e2e/assertion/credential-helper/docker-credential-devpod-esque diff --git a/e2e/assertion/credential-helper/docker-credential-devpod-esque b/e2e/assertion/credential-helper/docker-credential-devpod-esque new file mode 100755 index 00000000..3f3557a4 --- /dev/null +++ b/e2e/assertion/credential-helper/docker-credential-devpod-esque @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +read -r URL + + +if [[ "$URL" != "localhost:1447" ]]; then + echo "expected registry url to be localhost:1447"; + exit 1 +fi + +echo "{\"ServerURL\": \"$URL\", \"Username\": \"\", \"Secret\": \"\"}" + diff --git a/e2e/assertion/oci_pull_auth_tests.bats b/e2e/assertion/oci_pull_auth_tests.bats index 77def374..3bc00a2f 100644 --- a/e2e/assertion/oci_pull_auth_tests.bats +++ b/e2e/assertion/oci_pull_auth_tests.bats @@ -163,4 +163,17 @@ EOF update_assert '{"Authorization": ["Basic not_match"]}' run bazel build @empty_image//... $BAZEL_FLAGS assert_failure -} \ No newline at end of file +} + +@test "empty username and password succeeds" { + cat > "$DOCKER_CONFIG/config.json" <