-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ramkumar Chinchani <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
load helpers | ||
|
||
function setup() { | ||
stacker_setup | ||
} | ||
|
||
function teardown() { | ||
cleanup | ||
} | ||
|
||
@test "import tar" { | ||
mkdir -p folder1 | ||
truncate -s 512k folder1/file1 | ||
tar cvf test.tar folder1 | ||
cat > stacker.yaml <<EOF | ||
first: | ||
from: | ||
type: tar | ||
url: test.tar | ||
EOF | ||
stacker build | ||
m1=$(cat oci/index.json | jq .manifests[0].digest | sed 's/sha256://' | tr -d \") | ||
l1=$(cat oci/blobs/sha256/"$m1" | jq .layers[0].digest | sed 's/sha256://' | tr -d \") | ||
skopeo copy --format=oci oci:oci:first containers-storage:test:tar | ||
skopeo copy --format=oci containers-storage:test:tar oci:oci:tar | ||
m2=$(cat oci/index.json | jq .manifests[1].digest | sed 's/sha256://' | tr -d \") | ||
l2=$(cat oci/blobs/sha256/"$m2" | jq .layers[0].digest | sed 's/sha256://' | tr -d \") | ||
[ "$l1" = "$l2" ] | ||
} |