Skip to content

Commit

Permalink
tests/bud.bats: add git source
Browse files Browse the repository at this point in the history
Signed-off-by: danishprakash <danish.prakash@suse.com>
  • Loading branch information
danishprakash committed Apr 22, 2024
1 parent e504396 commit aba9551
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/bud.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6720,3 +6720,26 @@ _EOF
assert "$status" -eq 2 "exit code from ls"
expect_output --substring "No such file or directory"
}

@test "bud with ADD with git repository source" {
_prefetch alpine

local contextdir=${TEST_SCRATCH_DIR}/add-git
mkdir -p $contextdir
cat > $contextdir/Dockerfile << _EOF
FROM alpine
RUN apk add git
# branch check
ADD https://github.com/containers/buildah.git#release-1.35 /buildah-branch
RUN cd buildah-branch && \
[ "$(git rev-parse HEAD)" = "$(git ls-remote origin release-1.35 | cut -f1)" ] || exit 1
# tag check
ADD https://github.com/containers/buildah.git#v1.35.0 /buildah-tag
RUN cd buildah-tag && \
[ "$(git rev-parse HEAD)" = "$(git ls-remote --tags origin v1.35.0^{} | cut -f1)" ] || exit 1
_EOF

run_buildah build $WITH_POLICY_JSON -f $contextdir/Dockerfile
}

0 comments on commit aba9551

Please sign in to comment.