-
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 <rchincha@cisco.com>
- Loading branch information
Showing
3 changed files
with
76 additions
and
3 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
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
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,73 @@ | ||
load helpers | ||
|
||
function setup() { | ||
stacker_setup | ||
} | ||
|
||
function teardown() { | ||
cleanup | ||
} | ||
|
||
@test "test not adding extraneous whiteouts" { | ||
cat > stacker.yaml <<EOF | ||
image: | ||
from: | ||
type: docker | ||
url: docker://ubuntu:latest | ||
run: | | ||
apt-get update | ||
apt-get -y install libsensors-config | ||
EOF | ||
|
||
stacker build | ||
echo "checking" | ||
for f in $(ls oci/blobs/sha256/); do | ||
file oci/blobs/sha256/$f | grep "gzip" || { | ||
echo "skipping $f" | ||
continue | ||
} | ||
bsdtar -tvf oci/blobs/sha256/$f | grep ".wh.sensors.d" && { | ||
echo "should not have a sensors.d whiteout!" | ||
exit 1 | ||
} | ||
done | ||
} | ||
|
||
@test "dont emit whiteout for new dir creates" { | ||
cat > stacker.yaml <<EOF | ||
# a1.tar has /a1/file | ||
bb: | ||
from: | ||
type: docker | ||
url: docker://busybox | ||
run: | | ||
mkdir /a1 | ||
touch /a1/file | ||
nodir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
emptydir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
mkdir /a1 | ||
fulldir: | ||
from: | ||
type: built | ||
tag: bb | ||
run: | | ||
rm -rf /a1 | ||
mkdir /a1 | ||
touch /a1/newfile | ||
EOF | ||
|
||
stacker build | ||
} |