Skip to content

Commit 8c4b690

Browse files
committed
tests: on reinstall test that old remove and new install scripts run
1 parent 81d2d7c commit 8c4b690

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/xbps/libxbps/shell/scripts_test.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,44 @@ script_action_body() {
177177
atf_check_equal $? 0
178178
grep "^remove 1.0_2 purge A 1.0_2 no no" out
179179
atf_check_equal $? 0
180+
181+
# reinstall run new INSTALL script.
182+
create_script_stdout "install old 2.0_1" pkg_A/INSTALL
183+
create_script_stdout "remove old 2.0_1" pkg_A/REMOVE
184+
cd some_repo
185+
xbps-create -A noarch -n A-2.0_1 -s "A pkg" ../pkg_A
186+
atf_check_equal $? 0
187+
xbps-rindex -d -a $PWD/*.xbps
188+
atf_check_equal $? 0
189+
cd ..
190+
191+
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -y A >out
192+
atf_check_equal $? 0
193+
194+
create_script_stdout "install new 2.0_1" pkg_A/INSTALL
195+
create_script_stdout "remove new 2.0_1" pkg_A/REMOVE
196+
cd some_repo
197+
xbps-create -A noarch -n A-2.0_1 -s "A pkg" ../pkg_A
198+
atf_check_equal $? 0
199+
xbps-rindex -d -fa $PWD/*.xbps
200+
atf_check_equal $? 0
201+
cd ..
202+
203+
xbps-install -C empty.conf -r root --repository=$PWD/some_repo -yf A >out
204+
atf_check_equal $? 0
205+
206+
cat out>&2
207+
atf_check_equal $? 0
208+
grep "^remove old 2.0_1 pre A 2.0_1 no no" out
209+
atf_check_equal $? 0
210+
grep "^remove old 2.0_1 post A 2.0_1 no no" out
211+
atf_check_equal $? 0
212+
grep "^remove old 2.0_1 purge A 2.0_1 no no" out
213+
atf_check_equal $? 0
214+
grep "^install new 2.0_1 pre A 2.0_1 no no" out
215+
atf_check_equal $? 0
216+
grep "^install new 2.0_1 post A 2.0_1 no no" out
217+
atf_check_equal $? 0
180218
}
181219

182220
atf_init_test_cases() {

0 commit comments

Comments
 (0)