From 4b3165a05b9846748f09cfd23c4132232b2648d9 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sun, 4 Aug 2024 02:13:16 -0400 Subject: [PATCH] Update tests to use xz default --- tests/0001.bats | 2 +- tests/0002.bats | 2 +- tests/0003.bats | 16 ++++++++-------- tests/0004.bats | 2 +- tests/0005.bats | 2 +- tests/0006.bats | 2 +- tests/0007.bats | 16 ++++++++-------- tests/0008.bats | 2 +- tests/test_helper.bash | 8 ++++---- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/0001.bats b/tests/0001.bats index d64cc51..b818cd8 100644 --- a/tests/0001.bats +++ b/tests/0001.bats @@ -33,7 +33,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "/usr/bin/ping is included" { diff --git a/tests/0002.bats b/tests/0002.bats index 5953ea3..dfef2d8 100644 --- a/tests/0002.bats +++ b/tests/0002.bats @@ -10,7 +10,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "/usr/bin/ping is included" { diff --git a/tests/0003.bats b/tests/0003.bats index bcc44dd..4d41b5c 100644 --- a/tests/0003.bats +++ b/tests/0003.bats @@ -16,7 +16,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 test.ksrc.tar.bz2 test.kmod.tar.bz2 + rm -rf test test.tar.xz test.ksrc.tar.xz test.kmod.tar.xz } @test "/usr/bin/ping is included" { @@ -60,31 +60,31 @@ teardown() { } @test "/usr/src/linux-$TEST_UNAME/.config is included in ksrc" { - assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/.config test.ksrc.tar.bz2 + assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/.config test.ksrc.tar.xz } @test "/usr/src/linux-$TEST_UNAME/vmlinux is included in ksrc" { - assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/vmlinux test.ksrc.tar.bz2 + assert_tar_includes test/usr/src/linux-"$TEST_UNAME"/vmlinux test.ksrc.tar.xz } @test "/usr/src/linux-different-uname/ is excluded in ksrc" { - assert_tar_excludes test/usr/src/linux-different-uname/ test.ksrc.tar.bz2 + assert_tar_excludes test/usr/src/linux-different-uname/ test.ksrc.tar.xz } @test "/lib/modules/$TEST_UNAME/mod.ko is included in kmod" { - assert_tar_includes test/lib/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.bz2 + assert_tar_includes test/lib/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.xz } @test "/lib64/modules/$TEST_UNAME/mod.ko is included in kmod" { - assert_tar_includes test/lib64/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.bz2 + assert_tar_includes test/lib64/modules/"$TEST_UNAME"/mod.ko test.kmod.tar.xz } @test "/lib/modules/different-uname/ is excluded in kmod" { - assert_tar_excludes test/lib/modules/different-uname/ test.kmod.tar.bz2 + assert_tar_excludes test/lib/modules/different-uname/ test.kmod.tar.xz } @test "/lib64/modules/different-uname/ is excluded in kmod" { - assert_tar_excludes test/lib64/modules/different-uname/ test.kmod.tar.bz2 + assert_tar_excludes test/lib64/modules/different-uname/ test.kmod.tar.xz } # vim: ft=bash diff --git a/tests/0004.bats b/tests/0004.bats index c396520..990bdab 100644 --- a/tests/0004.bats +++ b/tests/0004.bats @@ -9,7 +9,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "/boot/kernel is excluded" { diff --git a/tests/0005.bats b/tests/0005.bats index 3b19640..0ac2cce 100644 --- a/tests/0005.bats +++ b/tests/0005.bats @@ -10,7 +10,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "/var/lib/connman/file is excluded" { diff --git a/tests/0006.bats b/tests/0006.bats index 1c91e20..ba8d943 100644 --- a/tests/0006.bats +++ b/tests/0006.bats @@ -11,7 +11,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "/var/db/repos/gentoo/ is included" { diff --git a/tests/0007.bats b/tests/0007.bats index ceb984b..8f847e3 100644 --- a/tests/0007.bats +++ b/tests/0007.bats @@ -21,40 +21,40 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 test0.tar.bz2 + rm -rf test test.tar.xz test0.tar.xz } @test "-e '/lost+found'" { - assert_tar_excludes test/usr/bin/lost+found test0.tar.bz2 + assert_tar_excludes test/usr/bin/lost+found test0.tar.xz assert_tar_excludes test/usr/bin/lost+found - assert_tar_excludes test/lost+found test0.tar.bz2 + assert_tar_excludes test/lost+found test0.tar.xz assert_tar_excludes test/lost+found } @test "-e 'user/.*'" { - assert_tar_excludes test/home/user/.dotfile test0.tar.bz2 + 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'" { - assert_tar_excludes test/home/user/chroot/var/tmp/file test0.tar.bz2 + 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/*'" { - assert_tar_excludes test/home/user/ccache/file test0.tar.bz2 + assert_tar_excludes test/home/user/ccache/file test0.tar.xz assert_tar_excludes test/home/user/ccache/file assert_tar_excludes test/home/user/ccache/ - assert_tar_includes test/root/ccache/file test0.tar.bz2 + 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'" { - assert_tar_includes test/etc/secrets/key test0.tar.bz2 + assert_tar_includes test/etc/secrets/key test0.tar.xz assert_tar_excludes test/etc/secrets/key assert_tar_excludes test/etc/secrets/ } diff --git a/tests/0008.bats b/tests/0008.bats index c2c037c..7c1dc4a 100644 --- a/tests/0008.bats +++ b/tests/0008.bats @@ -22,7 +22,7 @@ setup() { } teardown() { - rm -rf test test.tar.bz2 + rm -rf test test.tar.xz } @test "-i 'test/home/user/.keep and -e 'user/.*'" { diff --git a/tests/test_helper.bash b/tests/test_helper.bash index a753706..c088166 100644 --- a/tests/test_helper.bash +++ b/tests/test_helper.bash @@ -32,18 +32,18 @@ f() { assert_tar_includes() { test -f "${1}" || test -d "${1}" - tar --list -f "${2-test.tar.bz2}" | grep -q "^${1}$" + tar --list -f "${2-test.tar.xz}" | grep -q "^${1}$" } assert_tar_includes_partial() { - tar --list -f "${2-test.tar.bz2}" | grep -q "${1}" + tar --list -f "${2-test.tar.xz}" | grep -q "${1}" } assert_tar_excludes() { test -f "${1}" || test -d "${1}" - ! tar --list -f "${2-test.tar.bz2}" | grep -q "^${1}$" + ! tar --list -f "${2-test.tar.xz}" | grep -q "^${1}$" } assert_tar_excludes_partial() { - ! tar --list -f "${2-test.tar.bz2}" | grep -q "${1}" + ! tar --list -f "${2-test.tar.xz}" | grep -q "${1}" }