tests: rename downgrade_hold_test.sh to hold_test.sh.

Added new test case for https://github.com/void-linux/xbps/issues/215

This fails as expected right now because the fix is still
not there.
This commit is contained in:
Juan RP 2020-01-25 09:53:17 +01:00
parent c98d732d9c
commit 76f8ca595b
4 changed files with 90 additions and 43 deletions

View File

@ -23,7 +23,7 @@ atf_test_program{name="update_repolock_test"}
atf_test_program{name="update_itself_test"} atf_test_program{name="update_itself_test"}
atf_test_program{name="cyclic_deps_test"} atf_test_program{name="cyclic_deps_test"}
atf_test_program{name="conflicts_test"} atf_test_program{name="conflicts_test"}
atf_test_program{name="downgrade_hold_test"} atf_test_program{name="hold_test"}
atf_test_program{name="ignore_test"} atf_test_program{name="ignore_test"}
atf_test_program{name="preserve_test"} atf_test_program{name="preserve_test"}
atf_test_program{name="noextract_files_test"} atf_test_program{name="noextract_files_test"}

View File

@ -8,7 +8,7 @@ TESTSHELL+= issue31_test scripts_test incorrect_deps_test
TESTSHELL+= vpkg_test install_test preserve_files_test configure_test TESTSHELL+= vpkg_test install_test preserve_files_test configure_test
TESTSHELL+= update_shlibs_test update_hold_test update_repolock_test TESTSHELL+= update_shlibs_test update_hold_test update_repolock_test
TESTSHELL+= cyclic_deps_test conflicts_test update_itself_test TESTSHELL+= cyclic_deps_test conflicts_test update_itself_test
TESTSHELL+= downgrade_hold_test ignore_test preserve_test TESTSHELL+= hold_test ignore_test preserve_test
TESTSHELL+= noextract_files_test TESTSHELL+= noextract_files_test
EXTRA_FILES = Kyuafile EXTRA_FILES = Kyuafile

View File

@ -1,41 +0,0 @@
#!/usr/bin/env atf-sh
atf_test_case downgrade_hold
downgrade_hold_head() {
atf_set "descr" "Tests for pkg downgrade: pkg is on hold mode"
}
downgrade_hold_body() {
mkdir -p repo pkg_A
cd repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root --repository=$PWD/repo -yd A
atf_check_equal $? 0
xbps-pkgdb -r root -m hold A
atf_check_equal $? 0
out=$(xbps-query -r root -H)
atf_check_equal $out A-1.0_1
cd repo
xbps-create -A noarch -n A-0.1_1 -s "A pkg" -r "1.0_1" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
out=$(xbps-install -r root --repository=$PWD/repo -un)
set -- $out
exp="$1 $2 $3 $4"
atf_check_equal "$exp" "A-0.1_1 hold noarch $PWD/repo"
xbps-install -r root --repository=$PWD/repo -yuvd
atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver A)
atf_check_equal $out A-1.0_1
}
atf_init_test_cases() {
atf_add_test_case downgrade_hold
}

View File

@ -0,0 +1,88 @@
#!/usr/bin/env atf-sh
atf_test_case downgrade_hold
downgrade_hold_head() {
atf_set "descr" "Tests for pkg downgrade: pkg is on hold mode"
}
downgrade_hold_body() {
mkdir -p repo pkg_A
cd repo
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root --repository=$PWD/repo -yd A
atf_check_equal $? 0
xbps-pkgdb -r root -m hold A
atf_check_equal $? 0
out=$(xbps-query -r root -H)
atf_check_equal $out A-1.0_1
cd repo
xbps-create -A noarch -n A-0.1_1 -s "A pkg" -r "1.0_1" ../pkg_A
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
out=$(xbps-install -r root --repository=$PWD/repo -un)
set -- $out
exp="$1 $2 $3 $4"
atf_check_equal "$exp" "A-0.1_1 hold noarch $PWD/repo"
xbps-install -r root --repository=$PWD/repo -yuvd
atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver A)
atf_check_equal $out A-1.0_1
}
atf_test_case hold_shlibs
hold_shlibs_head() {
atf_set "descr" "Tests for pkgs on hold mode: verify shlibs"
}
hold_shlibs_body() {
mkdir -p repo pkg
cd repo
xbps-create -A noarch -n sway-1.2_1 -s "sway" --dependencies "wlroots>=0.9" --shlib-requires "libwlroots.so.4" ../pkg
atf_check_equal $? 0
xbps-create -A noarch -n wlroots-0.9.0_1 -s "wlroots" --shlib-provides "libwlroots.so.4" ../pkg
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root --repo=repo -yd sway
atf_check_equal $? 0
xbps-pkgdb -r root -m hold sway
atf_check_equal $? 0
out=$(xbps-query -r root -H)
atf_check_equal $out sway-1.2_1
cd repo
xbps-create -A noarch -n sway-1.4_1 -s "sway" --dependencies "wlroots>=0.10" --shlib-requires "libwlroots.so.5" ../pkg
atf_check_equal $? 0
xbps-create -A noarch -n wlroots-0.10.0_1 -s "wlroots" --shlib-provides "libwlroots.so.5" ../pkg
atf_check_equal $? 0
xbps-rindex -d -a $PWD/*.xbps
atf_check_equal $? 0
cd ..
xbps-install -r root --repo=repo -yud
atf_check_equal $? 0
out=$(xbps-query -r root -p pkgver sway)
atf_check_equal "$out" "sway-1.2_1"
out=$(xbps-query -r root -p pkgver wlroots)
atf_check_equal "$out" "wlroots-0.9.0_1"
xbps-pkgdb -r root -a
atf_check_equal $? 0
}
atf_init_test_cases() {
atf_add_test_case downgrade_hold
atf_add_test_case hold_shlibs
}