aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGöktürk Yüksek <gokturk@binghamton.edu>2016-05-05 19:24:46 -0400
committerBrian Dolbec <dolsen@gentoo.org>2016-05-05 23:05:19 -0700
commit920a1fab671cfb62939902ddca2bc793d84fb973 (patch)
treed9148e3007287f85e686f5878685f23b4b116dd4
parentxml-test/valid: valid metadata.xml test based on the example in GLEP 68 (diff)
downloadgen-b0rk-920a1fab.tar.gz
gen-b0rk-920a1fab.tar.bz2
gen-b0rk-920a1fab.zip
xml-test/invalid-attributes: test for invalid and disallowed attributes
Signed-off-by: Göktürk Yüksek <gokturk@binghamton.edu>
-rw-r--r--xml-test/invalid-attributes/invalid-attributes-0.1.ebuild11
-rw-r--r--xml-test/invalid-attributes/metadata.xml38
2 files changed, 49 insertions, 0 deletions
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>larry@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>