From b129f2c248035b828b7b79774ab5ab35446a66c6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 9 Mar 2009 16:44:47 +0200 Subject: [PATCH] Add test for _install_lang and status (cherry picked from commit f70830356fd239d66e1aece81973ebc077acbe6e) --- tests/Makefile.am | 1 + tests/data/SPECS/flangtest.spec | 29 +++++++++++++++++++++++++++++ tests/rpmdb.at | 24 ++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 tests/data/SPECS/flangtest.spec diff --git a/tests/Makefile.am b/tests/Makefile.am index d0d08c6..b1e4426 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,7 @@ EXTRA_DIST += data/SPECS/foo.spec EXTRA_DIST += data/SPECS/versiontest.spec EXTRA_DIST += data/SPECS/conflicttest.spec EXTRA_DIST += data/SPECS/configtest.spec +EXTRA_DIST += data/SPECS/flangtest.spec EXTRA_DIST += data/SPECS/symlinktest.spec EXTRA_DIST += data/SOURCES/hello-1.0.tar.gz EXTRA_DIST += data/SOURCES/hello-2.0.tar.gz diff --git a/tests/data/SPECS/flangtest.spec b/tests/data/SPECS/flangtest.spec new file mode 100644 index 0000000..3f36795 --- /dev/null +++ b/tests/data/SPECS/flangtest.spec @@ -0,0 +1,29 @@ +Name: flangtest +Version: 1.0 +Release: 1 +Summary: Testing file lang behavior +Group: Testing +License: GPL +BuildArch: noarch + +%description +%{summary} + +%install +rm -rf $RPM_BUILD_ROOT + +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name} +for f in fi de en pl none; do + echo "This is $f language" > $RPM_BUILD_ROOT/%{_datadir}/%{name}/$f.txt +done + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%lang(fi) %{_datadir}/%{name}/fi.txt +%lang(de) %{_datadir}/%{name}/de.txt +%lang(en) %{_datadir}/%{name}/en.txt +%lang(pl) %{_datadir}/%{name}/pl.txt +%{_datadir}/%{name}/none.txt diff --git a/tests/rpmdb.at b/tests/rpmdb.at index a00df5d..0de2896 100644 --- a/tests/rpmdb.at +++ b/tests/rpmdb.at @@ -134,6 +134,30 @@ runroot rpm -qls conflictstatus AT_CLEANUP # ------------------------------ +# Install and verify status +AT_SETUP([rpm -U with _install_lang and verify status]) +AT_KEYWORDS([install rpmdb query]) +AT_CHECK([ +RPMDB_CLEAR +rm -rf "${TOPDIR}" + +run rpmbuild --quiet -bb \ + ${RPMDATA}/SPECS/flangtest.spec + +runroot rpm -U --define "_install_langs de:fi" "${TOPDIR}"/RPMS/noarch/flangtest-1.0-1.noarch.rpm +runroot rpm -qls flangtest +], +[0], +[normal /usr/share/flangtest/de.txt +not installed /usr/share/flangtest/en.txt +normal /usr/share/flangtest/fi.txt +normal /usr/share/flangtest/none.txt +not installed /usr/share/flangtest/pl.txt +], +[]) +AT_CLEANUP + +# ------------------------------ # Install and verify files exist on disk AT_SETUP([rpm -U and verify files on disk]) AT_KEYWORDS([install rpmdb]) -- 2.7.4