gen2stage4/tests/0007.bats

63 lines
1.6 KiB
Text
Raw Normal View History

#!/usr/bin/env bats
load test_helper
setup() {
f test/usr/bin/lost+found
f test/lost+found
f test/home/user/.dotfile
f test/home/user/chroot/var/tmp/file
f test/home/user/ccache/file
f test/root/ccache/file
f test/etc/secrets/key
2024-08-03 21:34:46 -04:00
gen2stage4 -q -t test test0
gen2stage4 \
-e 'test/lost+found' \
-e 'user/.*' \
-e 'test/home/user/chroot/var/tmp/file' \
-e 'ccache/*' \
-e 'secrets' \
-q -t test test
}
teardown() {
2024-08-04 02:13:16 -04:00
rm -rf test test.tar.xz test0.tar.xz
}
@test "-e '/lost+found'" {
2024-08-04 02:13:16 -04:00
assert_tar_excludes test/usr/bin/lost+found test0.tar.xz
2024-08-03 16:24:02 -04:00
assert_tar_excludes test/usr/bin/lost+found
2024-08-04 02:13:16 -04:00
assert_tar_excludes test/lost+found test0.tar.xz
assert_tar_excludes test/lost+found
}
@test "-e 'user/.*'" {
2024-08-04 02:13:16 -04:00
assert_tar_excludes test/home/user/.dotfile test0.tar.xz
assert_tar_excludes test/home/user/.dotfile
assert_tar_includes test/home/user/
}
@test "-e 'test/home/user/chroot/var/tmp/file'" {
2024-08-04 02:13:16 -04:00
assert_tar_excludes test/home/user/chroot/var/tmp/file test0.tar.xz
assert_tar_excludes test/home/user/chroot/var/tmp/file
}
@test "-e 'ccache/*'" {
2024-08-04 02:13:16 -04:00
assert_tar_excludes test/home/user/ccache/file test0.tar.xz
assert_tar_excludes test/home/user/ccache/file
2024-08-03 16:24:02 -04:00
assert_tar_excludes test/home/user/ccache/
2024-08-04 02:13:16 -04:00
assert_tar_includes test/root/ccache/file test0.tar.xz
assert_tar_excludes test/root/ccache/file
assert_tar_includes test/root/ccache/
}
@test "-e 'secrets'" {
2024-08-04 02:13:16 -04:00
assert_tar_includes test/etc/secrets/key test0.tar.xz
assert_tar_excludes test/etc/secrets/key
assert_tar_excludes test/etc/secrets/
}
# vim: ft=bash