From d668dd6dd22cf78e329f161eac30bafc21b42881 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Wed, 15 Dec 2021 19:57:44 -0800 Subject: [PATCH] tests: added test for Pull with registry auth Signed-off-by: Sam Alba --- tests/tasks.bats | 9 +++++++-- tests/tasks/pull/pull_auth.cue | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/tasks/pull/pull_auth.cue diff --git a/tests/tasks.bats b/tests/tasks.bats index a563d1cb..ac1c182d 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -6,7 +6,12 @@ setup() { @test "task: #Pull" { cd "$TESTDIR"/tasks/pull - "$DAGGER" --europa up + "$DAGGER" --europa up ./pull.cue +} + +@test "task: #Pull with auth" { + cd "$TESTDIR"/tasks/pull + "$DAGGER" --europa up ./pull_auth.cue } @test "task: #ReadFile" { @@ -39,4 +44,4 @@ setup() { "$DAGGER" --europa up ./user.cue "$DAGGER" --europa up ./workdir.cue -} \ No newline at end of file +} diff --git a/tests/tasks/pull/pull_auth.cue b/tests/tasks/pull/pull_auth.cue new file mode 100644 index 00000000..67ab1aab --- /dev/null +++ b/tests/tasks/pull/pull_auth.cue @@ -0,0 +1,18 @@ +package main + +import ( + "alpha.dagger.io/europa/dagger/engine" +) + +engine.#Plan & { + actions: pull: engine.#Pull & { + source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" + } & { + // assert result + digest: "sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" + config: { + Env: ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] + Cmd: ["/bin/sh"] + } + } +}