Skip to content

Commit 17d4d59

Browse files
committed
tests: add some tests for directory whiteouts
I wrote this trying to reproduce a bug, and couldn't. But hey, maybe it'll catch a bug someday... Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
1 parent 387d844 commit 17d4d59

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/dir-whiteout.bats

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
load helpers
2+
3+
function setup() {
4+
stacker_setup
5+
}
6+
7+
function teardown() {
8+
cleanup
9+
}
10+
11+
@test "dir whiteouts work" {
12+
cat > stacker.yaml <<EOF
13+
base:
14+
from:
15+
type: oci
16+
url: $UBUNTU_OCI
17+
run: |
18+
mkdir /hello-base
19+
mid:
20+
build_only: true
21+
from:
22+
type: built
23+
tag: base
24+
run: |
25+
mkdir /foo
26+
touch /foo/bar
27+
top:
28+
from:
29+
type: built
30+
tag: mid
31+
run: |
32+
rm -f /foo/bar
33+
rmdir /foo
34+
EOF
35+
stacker build
36+
37+
umoci unpack --image oci:top top
38+
ls top/rootfs
39+
false
40+
[ ! -f top/rootfs/foo/bar ]
41+
[ ! -d top/rootfs/foo ]
42+
}

0 commit comments

Comments
 (0)