From 7d51ef12ab75cd568fa1ba9656148f9163c13023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Thu, 15 Oct 2020 00:10:40 +0200 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/expat#2c7d944e47db8b7f227d7dc512972aadd9080e88 --- .gitignore | 19 +++ expat-2.2.3-fixtests.patch | 14 ++ expat.spec | 320 +++++++++++++++++++++++++++++++++++++ sources | 1 + tests/fuzz/Makefile | 63 ++++++++ tests/fuzz/PURPOSE | 7 + tests/fuzz/runtest.sh | 58 +++++++ tests/smoke/Makefile | 63 ++++++++ tests/smoke/PURPOSE | 3 + tests/smoke/runtest.sh | 93 +++++++++++ tests/tests.yml | 12 ++ 11 files changed, 653 insertions(+) create mode 100644 expat-2.2.3-fixtests.patch create mode 100644 expat.spec create mode 100644 sources create mode 100644 tests/fuzz/Makefile create mode 100644 tests/fuzz/PURPOSE create mode 100755 tests/fuzz/runtest.sh create mode 100644 tests/smoke/Makefile create mode 100644 tests/smoke/PURPOSE create mode 100755 tests/smoke/runtest.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..70d7781 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,19 @@ +expat-1.95.8.tar.gz +i386 +*.rpm +clog +expat-2.0.1.tar.gz +/results_expat +/expat-2.?.? +/expat-2.1.0.tar.gz +/expat-2.1.1.tar.bz2 +/expat-2.2.0.tar.bz2 +/expat-2.2.1.tar.gz +/expat-2.2.2.tar.gz +/libexpat-R_* +/expat-2.2.3.tar.gz +/expat-2.2.4.tar.gz +/expat-2.2.5.tar.gz +/expat-2.2.6.tar.gz +/expat-2.2.7.tar.gz +/expat-2.2.8.tar.gz diff --git a/expat-2.2.3-fixtests.patch b/expat-2.2.3-fixtests.patch new file mode 100644 index 0000000..9b20f79 --- /dev/null +++ b/expat-2.2.3-fixtests.patch @@ -0,0 +1,14 @@ + +https://github.com/libexpat/libexpat/pull/109 + +--- libexpat-R_2_2_3/expat/tests/runtests.c.fixtests ++++ libexpat-R_2_2_3/expat/tests/runtests.c +@@ -5671,7 +5671,7 @@ static int XMLCALL + prefix_converter(void *UNUSED_P(data), const char *s) + { + /* If the first byte is 0xff, raise an error */ +- if (s[0] == -1) ++ if (s[0] == (char)-1) + return -1; + /* Just add the low bits of the first byte to the second */ + return (s[1] + (s[0] & 0x7f)) & 0x01ff; diff --git a/expat.spec b/expat.spec new file mode 100644 index 0000000..c7bb673 --- /dev/null +++ b/expat.spec @@ -0,0 +1,320 @@ +%global unversion 2_2_8 + +Summary: An XML parser library +Name: expat +Version: %(echo %{unversion} | sed 's/_/./g') +Release: 3%{?dist} +Source: https://github.com/libexpat/libexpat/archive/R_%{unversion}.tar.gz#/expat-%{version}.tar.gz +URL: https://libexpat.github.io/ +License: MIT +BuildRequires: autoconf, libtool, xmlto, gcc-c++ + +%description +This is expat, the C library for parsing XML, written by James Clark. Expat +is a stream oriented XML parser. This means that you register handlers with +the parser prior to starting the parse. These handlers are called when the +parser discovers the associated structures in the document being parsed. A +start tag is an example of the kind of structures for which you may +register handlers. + +%package devel +Summary: Libraries and header files to develop applications using expat +Requires: expat%{?_isa} = %{version}-%{release} + +%description devel +The expat-devel package contains the libraries, include files and documentation +to develop XML applications with expat. + +%package static +Summary: expat XML parser static library +Requires: expat-devel%{?_isa} = %{version}-%{release} + +%description static +The expat-static package contains the static version of the expat library. +Install it if you need to link statically with expat. + +%prep +%setup -q -n libexpat-R_%{unversion}/expat +sed -i 's/install-data-hook/do-nothing-please/' lib/Makefile.am +./buildconf.sh + +%build +export CFLAGS="$RPM_OPT_FLAGS -fPIC" +export DOCBOOK_TO_MAN="xmlto man --skip-validation" +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%check +make check + +%ldconfig_scriptlets + +%files +%{!?_licensedir:%global license %%doc} +%doc AUTHORS Changes +%license COPYING +%{_bindir}/* +%{_libdir}/lib*.so.* +%{_mandir}/*/* + +%files devel +%doc doc/reference.html doc/*.png doc/*.css examples/*.c +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/*.pc +%{_includedir}/*.h + +%files static +%{_libdir}/lib*.a + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 2.2.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 2.2.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Sep 16 2019 Joe Orton - 2.2.8-1 +- update to 2.2.8 (#1752167) + +* Thu Jul 25 2019 Fedora Release Engineering - 2.2.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jun 27 2019 Joe Orton - 2.2.7-1 +- update to 2.2.7 (#1723724, #1722224) + +* Thu Jan 31 2019 Fedora Release Engineering - 2.2.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Aug 15 2018 Joe Orton - 2.2.6-1 +- update to 2.2.6 + +* Fri Jul 13 2018 Fedora Release Engineering - 2.2.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 2.2.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 2.2.5-2 +- Switch to %%ldconfig_scriptlets + +* Thu Nov 2 2017 Joe Orton - 2.2.5-1 +- update to 2.2.5 (#1508667) + +* Mon Aug 21 2017 Joe Orton - 2.2.4-1 +- update to 2.2.4 (#1483359) + +* Fri Aug 4 2017 Joe Orton - 2.2.3-1 +- fix tests with unsigned char (upstream PR 109) +- update to 2.2.3 (#1473266) + +* Wed Aug 02 2017 Fedora Release Engineering - 2.2.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 14 2017 Joe Orton - 2.2.2-2 +- update to 2.2.2 (#1470891) + +* Fri Jul 7 2017 Joe Orton - 2.2.1-2 +- trim unnecessary doc, examples content + +* Mon Jun 19 2017 Joe Orton - 2.2.1-1 +- update to 2.2.1 (#1462474) + +* Fri Feb 10 2017 Fedora Release Engineering - 2.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jun 21 2016 Joe Orton - 2.2.0-1 +- update to 2.2.0 (#1247348) + +* Thu Jun 16 2016 Joe Orton - 2.1.1-2 +- add security fixes for CVE-2016-0718, CVE-2012-6702, CVE-2016-5300, + CVE-2016-4472 + +* Mon Apr 18 2016 David Tardon - 2.1.1-1 +- new upstream release + +* Wed Feb 03 2016 Fedora Release Engineering - 2.1.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 2.1.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 2.1.0-11 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Aug 16 2014 Fedora Release Engineering - 2.1.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway - 2.1.0-9 +- fix license handling + +* Sat Jun 07 2014 Fedora Release Engineering - 2.1.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 2.1.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jun 17 2013 Joe Orton - 2.1.0-6 +- fix "xmlwf -h" output (#948534) + +* Wed Feb 13 2013 Fedora Release Engineering - 2.1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 2.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Apr 13 2012 Joe Orton - 2.1.0-3 +- add -static subpackage (#722647) + +* Fri Mar 30 2012 Joe Orton - 2.1.0-1 +- ship .pc file, move library back to libdir (#808399) + +* Mon Mar 26 2012 Joe Orton - 2.1.0-1 +- update to 2.1.0 (#806602) + +* Fri Jan 13 2012 Fedora Release Engineering - 2.0.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 2.0.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Feb 8 2010 Joe Orton - 2.0.1-10 +- revised fix for CVE-2009-3560 regression (#544996) + +* Sun Jan 31 2010 Joe Orton - 2.0.1-9 +- drop static libraries (#556046) +- add fix for regression in CVE-2009-3560 patch (#544996) + +* Tue Dec 1 2009 Joe Orton - 2.0.1-8 +- add security fix for CVE-2009-3560 (#533174) +- add security fix for CVE-2009-3720 (#531697) +- run the test suite + +* Fri Jul 24 2009 Fedora Release Engineering - 2.0.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Feb 24 2009 Fedora Release Engineering - 2.0.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Feb 19 2008 Fedora Release Engineering - 2.0.1-5 +- Autorebuild for GCC 4.3 + +* Wed Jan 23 2008 Joe Orton 2.0.1-4 +- chmod 644 even more documentation (#429806) + +* Tue Jan 8 2008 Joe Orton 2.0.1-3 +- chmod 644 the documentation (#427950) + +* Wed Aug 22 2007 Joe Orton 2.0.1-2 +- rebuild + +* Wed Aug 8 2007 Joe Orton 2.0.1-1 +- update to 2.0.1 +- fix the License tag +- drop the .la file + +* Sun Feb 4 2007 Joe Orton 1.95.8-10 +- remove trailing dot in Summary (#225742) +- use preferred BuildRoot per packaging guidelines (#225742) + +* Tue Jan 30 2007 Joe Orton 1.95.8-9 +- regenerate configure/libtool correctly (#199361) +- strip DSP files from examples (#186889) +- fix expat.h compilation with g++ -pedantic (#190244) + +* Wed Jul 12 2006 Jesse Keating - 1.95.8-8.2.1 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.95.8-8.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.95.8-8.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Tue Jan 31 2006 Joe Orton 1.95.8-8 +- restore .la file for apr-util + +* Mon Jan 30 2006 Joe Orton 1.95.8-7 +- move library to /lib (#178743) +- omit .la file (#170031) + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Mar 8 2005 Joe Orton 1.95.8-6 +- rebuild + +* Thu Nov 25 2004 Ivana Varekova 1.95.8 +- update to 1.95.8 + +* Wed Jun 16 2004 Jeff Johnson 1.95.7-4 +- add -fPIC (#125586). + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Jun 11 2004 Jeff Johnson 1.95.7-2 +- fix: malloc failure from dbus test suite (#124747). + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Sun Feb 22 2004 Joe Orton 1.95.7-1 +- update to 1.95.7, include COPYING file in main package + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Sep 17 2003 Matt Wilson 1.95.5-6 +- rebuild again for #91211 + +* Tue Sep 16 2003 Matt Wilson 1.95.5-5 +- rebuild to fix gzip'ed file md5sums (#91211) + +* Tue Jun 17 2003 Jeff Johnson 1.95.5-4 +- rebuilt because of crt breakage on ppc64. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Mon Nov 11 2002 Jeff Johnson 1.95.5-1 +- update to 1.95.5. + +* Mon Aug 19 2002 Trond Eivind Glomsrød 1,95.4-1 +- 1.95.4. 1.95.3 was withdrawn by the expat developers. + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu Jun 6 2002 Trond Eivind Glomsrød 1,95.3-1 +- 1.95.3 + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Fri Mar 22 2002 Trond Eivind Glomsrød +- Change a prereq in -devel on main package to a req +- License from MIT/X11 to BSD + +* Mon Mar 11 2002 Trond Eivind Glomsrød +- 1.95.2 + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Tue Oct 24 2000 Jeff Johnson +- update to 1.95.1 + +* Sun Oct 8 2000 Jeff Johnson +- Create. diff --git a/sources b/sources new file mode 100644 index 0000000..0e819fa --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (expat-2.2.8.tar.gz) = 2d24641f4ffc20ad3078fb475cdd6054fe06e7c9b39024db679c732f63e2220698c7d76594db164211cfe09f1c1f0d0f298d464893e535b7425db4bf4d3bebc9 diff --git a/tests/fuzz/Makefile b/tests/fuzz/Makefile new file mode 100644 index 0000000..9afbb30 --- /dev/null +++ b/tests/fuzz/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/expat/Sanity/fuzz +# Description: Feed expat with various random input +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/expat/Sanity/fuzz +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Splichal " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Feed expat with various random input" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 90m" >> $(METADATA) + @echo "RunFor: expat" >> $(METADATA) + @echo "Requires: expat" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/fuzz/PURPOSE b/tests/fuzz/PURPOSE new file mode 100644 index 0000000..50ae2dc --- /dev/null +++ b/tests/fuzz/PURPOSE @@ -0,0 +1,7 @@ +PURPOSE of /CoreOS/expat/Sanity/fuzz +Description: Feed expat with various random input +Author: Petr Splichal + +This is a simple fuzzer. Tries to feed the expat library with +various random input. Makes sure it does not crash on it. Files +triggering possible failures are submitted to the scheduler. diff --git a/tests/fuzz/runtest.sh b/tests/fuzz/runtest.sh new file mode 100755 index 0000000..3feb0b7 --- /dev/null +++ b/tests/fuzz/runtest.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/expat/Sanity/fuzz +# Description: Feed expat with various random input +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="expat" +COUNT=${COUNT:-1000} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + for i in `seq -w $COUNT`; do + rlRun "dd if=/dev/urandom of=file$i.xml bs=1024 count=100" \ + 0 "Creating file$i.xml with random content" + if ! rlRun "xmlwf file$i.xml"; then + rlFileSubmit "file$i.xml" + fi + done + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/smoke/Makefile b/tests/smoke/Makefile new file mode 100644 index 0000000..381aad6 --- /dev/null +++ b/tests/smoke/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/expat/Sanity/smoke +# Description: Basic functionality test using xmlwf +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/expat/Sanity/smoke +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Splichal " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Basic functionality test using xmlwf" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: expat" >> $(METADATA) + @echo "Requires: expat" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/smoke/PURPOSE b/tests/smoke/PURPOSE new file mode 100644 index 0000000..6255528 --- /dev/null +++ b/tests/smoke/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/expat/Sanity/smoke +Description: Basic functionality test using xmlwf +Author: Petr Splichal diff --git a/tests/smoke/runtest.sh b/tests/smoke/runtest.sh new file mode 100755 index 0000000..a16c58d --- /dev/null +++ b/tests/smoke/runtest.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/expat/Sanity/smoke +# Description: Basic functionality test using xmlwf +# Author: Petr Splichal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/lib/beakerlib/beakerlib.sh + +PACKAGE="expat" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + # create test xml documents + rlRun "echo '' > empty.xml" 0 "Creating empty.xml" + rlRun "echo ' ' > nesting.xml" \ + 0 "Creating nesting.xml" + rlRun "echo ' is bad ' > quoting.xml" \ + 0 "Creating quoting.xml" + rlRun "echo 'contentcontent' > roots.xml" \ + 0 "Creating roots.xml" + rlRun "echo ' ]> &ent;' > external.xml" \ + 0 "Creating empty.xml" + rlRun "echo 'Content with something nested.' > well.xml" \ + 0 "Creating well.xml" + rlRun "echo 'ěščřžýáíé, 測試, בדיקה, परीक्षण, テスト, 테스트, тестирование, ทดสอบ'> utf8.xml" \ + 0 "Creating utf8.xml" + rlPhaseEnd + + rlPhaseStartTest + # emtpy + rlRun "xmlwf empty.xml | tee output" 0 "Testing empty xml" + rlAssertGrep "no element found" "output" + + # proper nesting + rlRun "xmlwf nesting.xml | tee output" 0 "Testing proper nesting" + rlAssertGrep "mismatched tag" "output" + + # quoting + rlRun "xmlwf < quoting.xml | tee output" 0 "Testing quoting (and redirection)" + rlAssertGrep "invalid token" "output" + + # two roots + rlRun "cat roots.xml | xmlwf | tee output" 0 "Testing proper nesting (and pipe)" + rlAssertGrep "junk after document element" "output" + + # external + rlRun "xmlwf -p external.xml | tee output" 0 "Testing external entity" + rlAssertGrep "mismatched tag" "output" + rlAssertGrep "error in processing external entity" "output" + + # well formed + rlRun "xmlwf well.xml | tee output" 0 "Testing well formed document" + rlAssertNotDiffer "output" "/dev/null" + + # utf8 characters + rlRun "xmlwf utf8.xml | tee output" 0 "Testing document with utf8 characters" + rlAssertNotDiffer "output" "/dev/null" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..413d54a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - container + - atomic + tests: + - smoke + - fuzz