diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-06-28 10:34:13 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-06-28 10:34:50 +0300 |
commit | b11647214853dbc877972a91ebee116aa32d5bfc (patch) | |
tree | 00390f328d88a69f440cc8a6332a440a9b684714 /tests | |
parent | 5cd1e56cd28ee18ab863951bc242e99e42d85a1a (diff) | |
download | rpm-b11647214853dbc877972a91ebee116aa32d5bfc.tar.gz rpm-b11647214853dbc877972a91ebee116aa32d5bfc.tar.bz2 rpm-b11647214853dbc877972a91ebee116aa32d5bfc.zip |
Add a test-case for various %attr and %defattr combinations
- Currently this fails expectedly due to RhBug:681540 on the last
directory of the test rpm.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/data/SPECS/attrtest.spec | 58 | ||||
-rw-r--r-- | tests/rpmbuild.at | 42 |
3 files changed, 101 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 026a0d5f2..6f84093f4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,7 @@ TESTSUITE_AT += rpmdepmatch.at EXTRA_DIST += $(TESTSUITE_AT) ## testsuite data +EXTRA_DIST += data/SPECS/attrtest.spec EXTRA_DIST += data/SPECS/hello.spec EXTRA_DIST += data/SPECS/hello-script.spec EXTRA_DIST += data/SPECS/foo.spec diff --git a/tests/data/SPECS/attrtest.spec b/tests/data/SPECS/attrtest.spec new file mode 100644 index 000000000..6f787b19e --- /dev/null +++ b/tests/data/SPECS/attrtest.spec @@ -0,0 +1,58 @@ +Name: attrtest +Version: 1.0 +Release: 1 +Summary: Testing file attr behavior +Group: Testing +License: GPL +BuildArch: noarch + +%description +%{summary} + +%install +rm -rf $RPM_BUILD_ROOT + +for x in a b c d e f g h i j; do + mkdir -p $RPM_BUILD_ROOT/${x} + mkdir -p $RPM_BUILD_ROOT/${x}/dir + echo "${x}" > $RPM_BUILD_ROOT/${x}/file + chmod 700 $RPM_BUILD_ROOT/${x}/dir + chmod 400 $RPM_BUILD_ROOT/${x}/file +done + +%files +/a/dir +/a/file + +%attr(-,daemon,adm) /b/dir +%attr(-,daemon,adm) /b/file + +%attr(750,-,adm) /c/dir +%attr(640,daemon,-) /c/file + +%attr(751,daemon,bin) /d/dir +%attr(644,bin,daemon) /d/file + +%defattr(-,foo,bar) +/e/dir +/e/file + +%defattr(-,bar,foo) +%attr(770,-,-) /f/dir +%attr(660,-,-) /f/file + +%defattr(-,bar,foo) +%attr(-,adm,-) /g/dir +%attr(-,-,adm) /g/file + +%defattr(644,foo,bar,755) +/h/dir +/h/file + +%defattr(4755,root,root,750) +%attr(-,adm,-) /i/dir +%attr(-,-,adm) /i/file + +%defattr(640,zoot,zoot,750) +%attr(777,-,-) /j/dir +%attr(222,-,-) /j/file diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at index 515577783..7867aebee 100644 --- a/tests/rpmbuild.at +++ b/tests/rpmbuild.at @@ -82,3 +82,45 @@ run rpmbuild \ [ignore], [ignore]) AT_CLEANUP + +# ------------------------------ +# %attr/%defattr tests +AT_SETUP([rpmbuild %attr and %defattr]) +# expected failure on RhBug:681540 +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) +AT_KEYWORDS([build]) +AT_CHECK([[ +rm -rf ${TOPDIR} + +runroot rpmbuild \ + -bb --quiet /data/SPECS/attrtest.spec + +runroot rpm -qp --qf \ + "\n[%{filemodes:perms} %-8{fileusername} %-8{filegroupname} %{filenames}\n]"\ + "${TOPDIR}"/RPMS/noarch/attrtest-1.0-1.noarch.rpm +]], +[0], +[ +drwx------ root root /a/dir +-r-------- root root /a/file +drwx------ daemon adm /b/dir +-r-------- daemon adm /b/file +drwxr-x--- root adm /c/dir +-rw-r----- daemon root /c/file +drwxr-x--x daemon bin /d/dir +-rw-r--r-- bin daemon /d/file +drwx------ foo bar /e/dir +-r-------- foo bar /e/file +drwxrwx--- bar foo /f/dir +-rw-rw---- bar foo /f/file +drwx------ adm foo /g/dir +-r-------- bar adm /g/file +drwxr-xr-x foo bar /h/dir +-rw-r--r-- foo bar /h/file +drwxr-x--- adm root /i/dir +-rwsr-xr-x root adm /i/file +drwxrwxrwx zoot zoot /j/dir +--w--w--w- zoot zoot /j/file +], +[]) +AT_CLEANUP |