Fix #31 and add new test case to reproduce it.

This commit is contained in:
Juan RP
2014-02-25 22:55:39 +01:00
parent a511292316
commit 8c47021ec3
5 changed files with 47 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ atf_test_program{name="find_pkg_obsoletes_test"}
atf_test_program{name="issue6_test"}
atf_test_program{name="issue18_test"}
atf_test_program{name="issue20_test"}
atf_test_program{name="issue31_test"}
atf_test_program{name="conf_files_test"}
atf_test_program{name="remove_test"}
atf_test_program{name="replace_test"}

View File

@@ -3,6 +3,7 @@ TOPDIR = ../../../..
TESTSHELL = conf_files_test issue6_test issue18_test issue20_test remove_test
TESTSHELL+= replace_test installmode_test obsoletefiles_test
TESTSHELL+= issue31_test
include ../Makefile.inc
include $(TOPDIR)/mk/test.mk

View File

@@ -0,0 +1,42 @@
#! /usr/bin/env atf-sh
# xbps issue #31.
# How to reproduce it:
# Generate pkg A-0.1_1:
# /dir/dir/foo
# Install pkg A.
# Generate pkg A-0.2_1:
# /dir/foo
# Update pkg A to 0.2_1
atf_test_case issue31
issue31_head() {
atf_set "descr" "xbps issue #31 (https://github.com/xtraeme/xbps/issues/31)"
}
issue31_body() {
mkdir -p pkg_A/usr/share/licenses/chromium/license.html
echo random > pkg_A/usr/share/licenses/chromium/license.html/eula.html
xbps-create -A noarch -n A-0.1_1 -s "pkg A" pkg_A
atf_check_equal $? 0
xbps-rindex -a *.xbps
atf_check_equal $? 0
xbps-install -r root -C null.conf --repository=$PWD -y A
atf_check_equal $? 0
mkdir -p pkg_B/usr/share/licenses/chromium
echo "morerandom" > pkg_B/usr/share/licenses/chromium/license.html
xbps-create -A noarch -n A-0.2_1 -s "pkg A" pkg_B
atf_check_equal $? 0
xbps-rindex -a A-0.2_1.noarch.xbps
atf_check_equal $? 0
xbps-install -r root -C null.conf --repository=$PWD -yuvd A
atf_check_equal $? 0
}
atf_init_test_cases() {
atf_add_test_case issue31
}