xbps-create(8): fix #64 "incorrect installed-size with hardlinks"

This commit is contained in:
Juan RP
2014-11-12 12:37:35 +01:00
parent 04bde70969
commit 039a155918
7 changed files with 72 additions and 5 deletions

View File

@@ -3,7 +3,8 @@ syntax("kyuafile", 1)
test_suite("xbps")
include('libxbps/Kyuafile')
include('xbps-checkvers/Kyuafile')
include('xbps-create/Kyuafile')
include('xbps-install/Kyuafile')
include('xbps-query/Kyuafile')
include('xbps-rindex/Kyuafile')
include('xbps-checkvers/Kyuafile')

View File

@@ -1,5 +1,5 @@
-include ../../config.mk
SUBDIRS = common libxbps xbps-install xbps-query xbps-rindex xbps-checkvers
SUBDIRS = common libxbps xbps-checkvers xbps-create xbps-install xbps-query xbps-rindex
include ../../mk/subdir.mk

View File

@@ -0,0 +1,4 @@
syntax("kyuafile", 1)
test_suite("xbps-create")
atf_test_program{name="basic_test"}

View File

@@ -0,0 +1,8 @@
TOPDIR = ../../..
-include $(TOPDIR)/config.mk
TESTSHELL = basic_test
TESTSSUBDIR = xbps/xbps-create
EXTRA_FILES = Kyuafile
include $(TOPDIR)/mk/test.mk

View File

@@ -0,0 +1,35 @@
#! /usr/bin/env atf-sh
# Test that xbps-create(8) works as expected.
atf_test_case hardlinks_size
hardlinks_size_head() {
atf_set "descr" "xbps-create(8): installed-size behaviour with hardlinks"
}
hardlinks_size_body() {
mkdir -p repo pkg_A
echo 123456789 > pkg_A/file00
ln pkg_A/file00 pkg_A/file01
ln pkg_A/file00 pkg_A/file02
ln pkg_A/file00 pkg_A/file03
cd repo
xbps-create -A noarch -n foo-1.0_1 -s "foo pkg" ../pkg_A
atf_check_equal $? 0
cd ..
xbps-rindex -d -a repo/*.xbps
atf_check_equal $? 0
result="$(xbps-query -r root -C empty.conf --repository=$PWD/repo -p installed_size foo)"
expected="10B"
rv=0
if [ "$result" != "$expected" ]; then
echo "result: $result"
echo "expected: $expected"
rv=1
fi
atf_check_equal $rv 0
}
atf_init_test_cases() {
atf_add_test_case hardlinks_size
}