- Check that we get expected number of links in package generation,
that all the files got installed and that the linked files are
actually hardlinks (for our purposes, plain inode suffices)
EXTRA_DIST += data/SPECS/conflicttest.spec
EXTRA_DIST += data/SPECS/configtest.spec
EXTRA_DIST += data/SPECS/flangtest.spec
+EXTRA_DIST += data/SPECS/hlinktest.spec
EXTRA_DIST += data/SPECS/symlinktest.spec
EXTRA_DIST += data/SPECS/deptest.spec
EXTRA_DIST += data/SPECS/verifyscript.spec
--- /dev/null
+Summary: Testing hard link behavior
+Name: hlinktest
+Version: 1.0
+Release: 1
+License: Testing
+Group: Testing
+BuildArch: noarch
+%description
+
+%install
+rm -rf %{buildroot}
+mkdir -p $RPM_BUILD_ROOT/foo
+cat << EOF >> $RPM_BUILD_ROOT/foo/hello
+#!/bin/sh
+echo $0
+EOF
+
+cd $RPM_BUILD_ROOT/foo
+cat hello > copyllo
+chmod a+x hello copyllo
+for f in foo bar world; do
+ ln hello hello-${f}
+done
+
+%files
+%defattr(-,root,root)
+/foo/*
],
[])
AT_CLEANUP
+
+# ------------------------------
+# hardlink tests
+AT_SETUP([rpmbuild hardlink])
+AT_KEYWORDS([build])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+rm -rf ${TOPDIR}
+
+runroot rpmbuild \
+ -bb --quiet /data/SPECS/hlinktest.spec
+
+runroot rpm -i "${TOPDIR}"/RPMS/noarch/hlinktest-1.0-1.noarch.rpm
+
+runroot rpm -q --qf "[[%{filenlinks} %{filenames}\n]]" hlinktest
+runroot rpm -V --nouser --nogroup hlinktest
+ls -i "${RPMTEST}"/foo/hello* | awk {'print $1'} | sort -u | wc -l
+
+],
+[0],
+[1 /foo/copyllo
+4 /foo/hello
+4 /foo/hello-bar
+4 /foo/hello-foo
+4 /foo/hello-world
+1
+],
+[])
+AT_CLEANUP