mirror of
https://github.com/erenfro/gen2stage4.git
synced 2024-11-13 02:38:57 -05:00
47 lines
980 B
Bash
47 lines
980 B
Bash
#!/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
|
|
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() {
|
|
rm -rf test test.tar.xz
|
|
}
|
|
|
|
@test "-i 'test/home/user/.keep and -e 'user/.*'" {
|
|
assert_tar_excludes test/home/user/.dotfile
|
|
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
|