gen2stage4/tests/0008.bats

48 lines
980 B
Text
Raw Permalink Normal View History

#!/usr/bin/env bats
load test_helper
setup() {
f test/home/user/.dotfile
f test/home/user/.keep
f test/etc/ssh/key
f test/etc/ssh/config
f test/boot/boot
f test/boot/kernel
f test/mnt/5/media
2024-08-03 21:34:46 -04:00
gen2stage4 \
-i 'test/home/user/.keep' \
-e 'user/.*' \
-i 'test/etc/ssh/config' \
-e 'ssh' \
-b \
-i 'test/boot/boot' \
-i 'test/mnt/5' \
-q -t test test
}
teardown() {
2024-08-04 02:13:16 -04:00
rm -rf test test.tar.xz
}
@test "-i 'test/home/user/.keep and -e 'user/.*'" {
assert_tar_excludes test/home/user/.dotfile
2024-08-03 16:38:26 -04:00
assert_tar_includes test/home/user/.keep
}
@test "-i 'test/etc/ssh/config and -e 'ssh'" {
assert_tar_excludes test/etc/ssh/key
assert_tar_includes test/etc/ssh/config
}
@test "-i 'test/boot/boot' and -b" {
assert_tar_excludes test/boot/kernel
assert_tar_includes test/boot/boot
}
@test "-i 'test/mnt/5'" {
assert_tar_includes test/mnt/5/media
}
# vim: ft=bash