Skip to content

Commit 0310570

Browse files
committed
tests: add tests for 32bit shlibs
1 parent 4fc3610 commit 0310570

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

tests/xbps/libxbps/shell/update_shlibs_test.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,74 @@ shlib_provides_replaces_body() {
255255
atf_check_equal $? 2
256256
}
257257

258+
atf_test_case shlib_32bit
259+
260+
shlib_32bit_head() {
261+
atf_set "descr" "32bit shlib-provides does not satisfy non-32bit shlib-requires"
262+
}
263+
264+
shlib_32bit_body() {
265+
mkdir -p repo pkg_A pkg_B
266+
cd repo
267+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_1 -s "A pkg" --shlib-provides "libfoo.so.1" ../pkg_A
268+
atf_check -o ignore -- xbps-create -A noarch -n A-32bit-1.0_1 -s "A pkg" --shlib-provides "libfoo.so.1" ../pkg_A
269+
atf_check -o ignore -- xbps-create -A noarch -n B-1.0_1 -s "B-32bit pkg" --shlib-requires "libfoo.so.1" ../pkg_B
270+
atf_check -o ignore -- xbps-create -A noarch -n B-32bit-1.0_1 -s "B-32bit pkg" --shlib-requires "libfoo.so.1" ../pkg_B
271+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
272+
cd ..
273+
274+
atf_check \
275+
-s exit:8 \
276+
-e match:"B-32bit-1\.0_1: broken, unresolvable shlib \`libfoo\.so\.1'" \
277+
-- xbps-install -R repo -r root -ny A B-32bit
278+
atf_check \
279+
-s exit:8 \
280+
-e match:"B-1\.0_1: broken, unresolvable shlib \`libfoo\.so\.1'" \
281+
-- xbps-install -R repo -r root -ny A-32bit B
282+
}
283+
284+
atf_test_case shlib_bump_32bit
285+
286+
shlib_bump_32bit_head() {
287+
atf_set "descr" "Tests for pkg updates: update pkg with 32bit soname bump"
288+
}
289+
290+
shlib_bump_32bit_body() {
291+
mkdir -p repo pkg_A pkg_B
292+
cd repo
293+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_1 -s "A pkg" --shlib-provides "libfoo.so.1" ../pkg_A
294+
atf_check -o ignore -- xbps-create -A noarch -n A-32bit-1.0_1 -s "A-32bit pkg" --shlib-provides "libfoo.so.1" ../pkg_A
295+
atf_check -o ignore -- xbps-create -A noarch -n B-1.0_1 -s "B pkg" --dependencies "A>=0" --shlib-requires "libfoo.so.1" ../pkg_B
296+
atf_check -o ignore -- xbps-create -A noarch -n B-32bit-1.0_1 -s "B-32bit pkg" --dependencies "A-32bit>=0" --shlib-requires "libfoo.so.1" ../pkg_B
297+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
298+
cd ..
299+
300+
atf_check -o ignore -e ignore -- xbps-install -C empty.conf -r root --repository=$PWD/repo -y B B-32bit
301+
302+
cd repo
303+
atf_check -o ignore -- xbps-create -A noarch -n A-2.0_1 -s "A pkg" --shlib-provides "libfoo.so.2" ../pkg_A
304+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
305+
cd ..
306+
307+
# returns ENOEXEC if there are unresolved shlibs
308+
atf_check \
309+
-s exit:8 \
310+
-e match:"B-1\.0_1: broken, unresolvable shlib \`libfoo\.so\.1'" \
311+
-- xbps-install -C empty.conf -r root --repository=$PWD/repo -yu A A-32bit
312+
313+
cd repo
314+
atf_check -o ignore -- xbps-create -A noarch -n A-32bit-2.0_1 -s "A-32bit pkg" --shlib-provides "libfoo.so.2" ../pkg_A
315+
atf_check -o ignore -- xbps-create -A noarch -n B-1.0_2 -s "B pkg" --dependencies "A>=0" --shlib-requires "libfoo.so.2" ../pkg_B
316+
atf_check -o ignore -e ignore -- xbps-rindex -a $PWD/*.xbps
317+
cd ..
318+
319+
# returns ENOEXEC if there are unresolved shlibs
320+
atf_check \
321+
-s exit:8 \
322+
-e match:"B-32bit-1\.0_1: broken, unresolvable shlib \`libfoo\.so\.1'" \
323+
-- xbps-install -C empty.conf -r root --repository=$PWD/repo -yu A A-32bit
324+
}
325+
258326
atf_init_test_cases() {
259327
atf_add_test_case shlib_bump
260328
atf_add_test_case shlib_bump_incomplete_revdep_in_trans
@@ -263,4 +331,6 @@ atf_init_test_cases() {
263331
atf_add_test_case shlib_bump_versioned
264332
atf_add_test_case shlib_unknown_provider
265333
atf_add_test_case shlib_provides_replaces
334+
atf_add_test_case shlib_32bit
335+
atf_add_test_case shlib_bump_32bit
266336
}

0 commit comments

Comments
 (0)