Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add additional tests for whiteout fixes #646

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions test/whiteout.bats
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,28 @@ fulldir:
rm -rf /a1
mkdir /a1
touch /a1/newfile

redo:
from:
type: built
tag: bb
run: |
rm -rf /a1
mkdir /a1
touch /a1/newfile

EOF

stacker build

# "bb" should not have a whiteout entry for /a1
md=$(cat oci/index.json | jq .manifests[0].digest | sed s/sha256://g | tr -d \")
ld=$(cat oci/blobs/sha256/"$md" | jq .layers[-1].digest | sed s/sha256://g | tr -d \")
"bsdtar -tvf oci/blobs/sha256/$ld | grep '.wh.a1'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

these look good. Though for this particular hunk, would it be better to not remove this bsdtar|grep, but rather turn it into a bsdtar | grep -v '.wh.a1' ?

run "bsdtar -tvf oci/blobs/sha256/$ld | grep '.wh.a1'"
[ "$status" -ne 0 ]

# "fulldir" should have a whiteout entry for /a1
md=$(cat oci/index.json | jq .manifests[3].digest | sed s/sha256://g | tr -d \")
# "redo" should have a whiteout entry for /a1
md=$(cat oci/index.json | jq .manifests[4].digest | sed s/sha256://g | tr -d \")
ld=$(cat oci/blobs/sha256/"$md" | jq .layers[-1].digest | sed s/sha256://g | tr -d \")
"bsdtar -tvf oci/blobs/sha256/$ld | grep '.wh.a1'"
run "bsdtar -tvf oci/blobs/sha256/$ld | grep '.wh.a1'"
Expand Down
Loading