2020-02-06 18:59:18 -05:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
f test/usr/bin/ping
|
2020-02-06 20:48:31 -05:00
|
|
|
f test/usr/src/linux-"$TEST_UNAME"/.config
|
|
|
|
f test/usr/src/linux-"$TEST_UNAME"/vmlinux
|
|
|
|
f test/usr/src/linux-different-uname/.config
|
|
|
|
f test/usr/src/linux-different-uname/vmlinux
|
|
|
|
f test/lib/modules/"$TEST_UNAME"/mod.ko
|
|
|
|
f test/lib64/modules/"$TEST_UNAME"/mod.ko
|
|
|
|
f test/lib/modules/different-uname/mod.ko
|
|
|
|
f test/lib64/modules/different-uname/mod.ko
|
2024-08-03 21:34:46 -04:00
|
|
|
gen2stage4 -k -q -t test test
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
teardown() {
|
2024-08-04 02:13:16 -04:00
|
|
|
rm -rf test test.tar.xz test.ksrc.tar.xz test.kmod.tar.xz
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/usr/bin/ping is included" {
|
|
|
|
assert_tar_includes test/usr/bin/ping
|
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/usr/src/ is included" {
|
|
|
|
assert_tar_includes test/usr/src/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/lib/modules/ is included" {
|
|
|
|
assert_tar_includes test/lib/modules/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/lib64/modules/ is included" {
|
|
|
|
assert_tar_includes test/lib64/modules/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/usr/src/linux-$TEST_UNAME/ is excluded" {
|
|
|
|
assert_tar_excludes test/usr/src/linux-"$TEST_UNAME"/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/usr/src/linux-different-uname/ is excluded" {
|
|
|
|
assert_tar_excludes test/usr/src/linux-different-uname/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/lib/modules/$TEST_UNAME/ is excluded" {
|
|
|
|
assert_tar_excludes test/lib/modules/"$TEST_UNAME"/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/lib/modules/different-uname/ is excluded" {
|
|
|
|
assert_tar_excludes test/lib/modules/different-uname/
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
2020-02-06 20:48:31 -05:00
|
|
|
@test "/lib64/modules/$TEST_UNAME/ is excluded" {
|
|
|
|
assert_tar_excludes test/lib64/modules/"$TEST_UNAME"/
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "/lib64/modules/different-uname/ is excluded" {
|
|
|
|
assert_tar_excludes test/lib64/modules/different-uname/
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "/usr/src/linux-$TEST_UNAME/.config is included in ksrc" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/.config test.ksrc.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/usr/src/linux-$TEST_UNAME/vmlinux is included in ksrc" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/vmlinux test.ksrc.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/usr/src/linux-different-uname/ is excluded in ksrc" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_excludes test/usr/src/linux-different-uname/ test.ksrc.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/lib/modules/$TEST_UNAME/mod.ko is included in kmod" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_includes test/lib/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/lib64/modules/$TEST_UNAME/mod.ko is included in kmod" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_includes test/lib64/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/lib/modules/different-uname/ is excluded in kmod" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_excludes test/lib/modules/different-uname/ test.kmod.tar.xz
|
2020-02-06 20:48:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "/lib64/modules/different-uname/ is excluded in kmod" {
|
2024-08-04 02:13:16 -04:00
|
|
|
assert_tar_excludes test/lib64/modules/different-uname/ test.kmod.tar.xz
|
2020-02-06 18:59:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim: ft=bash
|