Signed-off-by: Göktürk Yüksek <gokt...@binghamton.edu> --- .../invalid-attributes-0.1.ebuild | 11 +++++++ xml-test/invalid-attributes/metadata.xml | 38 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 xml-test/invalid-attributes/invalid-attributes-0.1.ebuild create mode 100644 xml-test/invalid-attributes/metadata.xml
diff --git a/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild new file mode 100644 index 0000000..3076b2a --- /dev/null +++ b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild @@ -0,0 +1,11 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +DESCRIPTION="Metadata example with invalid attribute values and locations" +HOMEPAGE="https://wiki.gentoo.org/wiki/GLEP:68" +LICENSE="HPND" +SLOT="0" +KEYWORDS="~amd64" diff --git a/xml-test/invalid-attributes/metadata.xml b/xml-test/invalid-attributes/metadata.xml new file mode 100644 index 0000000..66902dc --- /dev/null +++ b/xml-test/invalid-attributes/metadata.xml @@ -0,0 +1,38 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <longdescription> + Tests for invalid attribute values and attributes appearing + in elements that they're not supposed to. + + There's a multitude of invalid attribute values and combinations. + We only consider a few sane cases that are likely to happen: + - type attribute in upstream maintainer (allowed only in downstream) + - status attribute in downstream maintainer (allowed only in upstream) + - invalid values for enumerated attributes: type, status, lang + + We also introduce multiple violations in a single element to test + repoman's ability to display errors. + </longdescription> + <!-- + The errors for the following are: + (1) invalid value for type + (2) status attribute is not allowed in downstream maintainer + (3) status attribute has invalid value + There's no point in reporting (3) due to (2), so it + should only print errors for the first two. + --> + <maintainer type='cow' status='retired'> + <email>la...@gentoo.org</email> + <!-- invalid value for lang --> + <description lang="english">Moo</description> + </maintainer> + <upstream> + <!-- type attribute isn't allowed in upstream maintainer --> + <maintainer status='active' type='person'> + <name>Gen B0rk</name> + </maintainer> + <!-- invalid value for type --> + <remote-id type='gen-b0rk'>gentoo/gen-b0rk</remote-id> + </upstream> +</pkgmetadata> -- 2.7.3