Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fahhem committed Jan 20, 2025
1 parent 723e641 commit 727c25b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions e2e/assertion/credential-helper/docker-credential-devpod-esque
Original file line number Diff line number Diff line change
@@ -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\": \"\"}"

15 changes: 14 additions & 1 deletion e2e/assertion/oci_pull_auth_tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,17 @@ EOF
update_assert '{"Authorization": ["Basic not_match"]}'
run bazel build @empty_image//... $BAZEL_FLAGS
assert_failure
}
}

@test "empty username and password succeeds" {
cat > "$DOCKER_CONFIG/config.json" <<EOF
{
"credHelpers": {
"localhost:1447": "devpod-esque"
}
}
EOF
update_assert ''
run bazel build @empty_image//... $BAZEL_FLAGS
assert_success
}

0 comments on commit 727c25b

Please sign in to comment.