tests: make tests POSIX shell compatible

This commit is contained in:
Duncaen 2019-03-22 19:03:56 +01:00
parent 950945034b
commit d7c2e87d55
6 changed files with 21 additions and 23 deletions

View File

@ -8,7 +8,7 @@ conflicts_trans_head() {
conflicts_trans_body() {
mkdir some_repo
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0
@ -33,7 +33,7 @@ conflicts_trans_hold_head() {
conflicts_trans_hold_body() {
mkdir some_repo
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "vpkg>19_1" ../pkg_A
atf_check_equal $? 0
@ -76,7 +76,7 @@ conflicts_trans_vpkg_head() {
conflicts_trans_vpkg_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "vpkg>=0" ../pkg_A
atf_check_equal $? 0
@ -105,7 +105,7 @@ conflicts_trans_multi_head() {
conflicts_trans_multi_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0
@ -132,7 +132,7 @@ conflicts_installed_head() {
conflicts_installed_body() {
mkdir some_repo
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0
@ -159,7 +159,7 @@ conflicts_installed_multi_head() {
conflicts_installed_multi_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0
@ -188,7 +188,7 @@ conflicts_trans_installed_head() {
conflicts_trans_installed_body() {
mkdir some_repo
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0
@ -215,7 +215,7 @@ conflicts_trans_update_head() {
conflicts_trans_update_body() {
mkdir repo repo2
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --provides "xserver-abi-video-19_1" ../pkg_A
@ -260,7 +260,7 @@ conflicts_trans_installed_multi_head() {
conflicts_trans_installed_multi_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --conflicts "B>=0" ../pkg_A
atf_check_equal $? 0

View File

@ -9,7 +9,7 @@ cyclic_dep_vpkg_head() {
cyclic_dep_vpkg_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --provides "libGL-7.11_1" --dependencies "libGL>=7.11" ../pkg_A
atf_check_equal $? 0
@ -37,7 +37,7 @@ cyclic_dep_vpkg2_head() {
cyclic_dep_vpkg2_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --provides "libGL-7.11_1" --dependencies "xserver-abi-video<20" ../pkg_A
atf_check_equal $? 0
@ -64,7 +64,7 @@ cyclic_dep_full_body() {
atf_set "timeout" 5
atf_expect_timeout "Known bug: see https://github.com/voidlinux/xbps/issues/92"
mkdir some_repo
mkdir -p pkg_{A,B}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --dependencies "B>=0" ../pkg_A
atf_check_equal $? 0

View File

@ -51,7 +51,7 @@ incorrect_dep_issue45_head() {
incorrect_dep_issue45_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --dependencies "A>=0" ../pkg_A
atf_check_equal $? 0

View File

@ -32,7 +32,7 @@ install_with_deps_head() {
install_with_deps_body() {
# Proper order: A B C D
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
@ -47,9 +47,8 @@ install_with_deps_body() {
atf_check_equal $? 0
cd ..
echo -e "A-1.0_1\nB-1.0_1\nC-1.0_1\nD-1.0_1\n" > exp
printf "A-1.0_1\nB-1.0_1\nC-1.0_1\nD-1.0_1\n" > exp
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -yn D|awk '{print $1}' > out
echo >> out
echo "exp: '$(cat exp)'" >&2
echo "out: '$(cat out)'" >&2
cmp exp out
@ -65,7 +64,7 @@ install_with_vpkg_deps_head() {
install_with_vpkg_deps_body() {
# Proper order: D C A B
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
@ -80,9 +79,8 @@ install_with_vpkg_deps_body() {
atf_check_equal $? 0
cd ..
echo -e "A-1.0_1\nB-1.0_1\nD-1.0_1\nC-1.0_1\n" > exp
printf "A-1.0_1\nB-1.0_1\nD-1.0_1\nC-1.0_1\n" > exp
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -yn E|awk '{print $1}' > out
echo >> out
echo "exp: '$(cat exp)'" >&2
echo "out: '$(cat out)'" >&2
cmp exp out

View File

@ -45,7 +45,7 @@ replace_ntimes_head() {
replace_ntimes_body() {
mkdir some_repo root
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0

View File

@ -21,7 +21,7 @@ vpkg_dont_update_head() {
vpkg_dont_update_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" --provides "libEGL-1.0_1" ../pkg_A
atf_check_equal $? 0
@ -56,7 +56,7 @@ vpkg_replace_provider_head() {
vpkg_replace_provider_body() {
mkdir some_repo
mkdir -p pkg_{A,B,C,D}/usr/bin
mkdir -p pkg_A/usr/bin pkg_B/usr/bin pkg_C/usr/bin pkg_D/usr/bin
cd some_repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
@ -91,7 +91,7 @@ vpkg_provider_in_trans_head() {
vpkg_provider_in_trans_body() {
mkdir some_repo
mkdir -p pkg_{gawk,base-system,busybox}
mkdir -p pkg_gawk pkg_base-system pkg_busybox
cd some_repo
xbps-create -A noarch -n gawk-1.0_1 -s "gawk pkg" ../pkg_gawk
atf_check_equal $? 0