Skip to content

Commit 0b1bd28

Browse files
committed
tests: fix more tests using wrong architectures from /usr/share/xbps.d or env
1 parent 7ee1228 commit 0b1bd28

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

tests/xbps/libxbps/shell/scripts_test.sh

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,20 @@ script_nargs_body() {
2929
echo "A-1.0_1" > pkg_A/usr/bin/foo
3030
create_script pkg_A/INSTALL
3131

32+
unset XBPS_ARCH XBPS_TARGET_ARCH
33+
34+
arch=$(xbps-uhelper -r root arch)
3235
cd some_repo
33-
xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
34-
atf_check_equal $? 0
35-
xbps-rindex -d -a $PWD/*.xbps
36-
atf_check_equal $? 0
36+
atf_check -o ignore -- xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
37+
# XXX: xbps-rindex has no root flag to ignore /usr/share/xbps.d/xbps-arch.conf
38+
XBPS_ARCH="$arch" atf_check -o ignore -- xbps-rindex -a $PWD/*.xbps
3739
cd ..
38-
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -y A
39-
atf_check_equal $? 0
40+
atf_check -o ignore \
41+
-e inline:"pre A 1.0_1 no no ${arch}\npost A 1.0_1 no no ${arch}\n" -- \
42+
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -y A
4043

41-
rval=0
42-
xbps-reconfigure -C empty.conf -r root -f A 2>out
43-
out="$(cat out)"
44-
expected="post A 1.0_1 no no $(uname -m)"
45-
if [ "$out" != "$expected" ]; then
46-
echo "out: '$out'"
47-
echo "expected: '$expected'"
48-
rval=1
49-
fi
50-
atf_check_equal $rval 0
44+
atf_check -o ignore -e inline:"post A 1.0_1 no no ${arch}\n" -- \
45+
xbps-reconfigure -C empty.conf -r root -f A
5146
}
5247

5348
atf_test_case script_arch

tests/xbps/xbps-uhelper/arch_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ native_head() {
88
}
99

1010
native_body() {
11-
atf_check_equal $(xbps-uhelper -r $PWD arch) $(uname -m)
11+
unset XBPS_ARCH XBPS_TARGET_ARCH
12+
atf_check -o "inline:$(uname -m)\n" -- xbps-uhelper -r "$PWD" arch
1213
}
1314

1415
atf_test_case env

0 commit comments

Comments
 (0)