Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/gen-b0rk:master commit in: xml-test/invalid-attributes/
Date: Fri, 06 May 2016 06:08:16
Message-Id: 1462514719.920a1fab671cfb62939902ddca2bc793d84fb973.dolsen@gentoo
1 commit: 920a1fab671cfb62939902ddca2bc793d84fb973
2 Author: Göktürk Yüksek <gokturk <AT> binghamton <DOT> edu>
3 AuthorDate: Thu May 5 23:24:46 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Fri May 6 06:05:19 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/gen-b0rk.git/commit/?id=920a1fab
7
8 xml-test/invalid-attributes: test for invalid and disallowed attributes
9
10 Signed-off-by: Göktürk Yüksek <gokturk <AT> binghamton.edu>
11
12 .../invalid-attributes-0.1.ebuild | 11 +++++++
13 xml-test/invalid-attributes/metadata.xml | 38 ++++++++++++++++++++++
14 2 files changed, 49 insertions(+)
15
16 diff --git a/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild
17 new file mode 100644
18 index 0000000..3076b2a
19 --- /dev/null
20 +++ b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild
21 @@ -0,0 +1,11 @@
22 +# Copyright 1999-2016 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI=6
27 +
28 +DESCRIPTION="Metadata example with invalid attribute values and locations"
29 +HOMEPAGE="https://wiki.gentoo.org/wiki/GLEP:68"
30 +LICENSE="HPND"
31 +SLOT="0"
32 +KEYWORDS="~amd64"
33
34 diff --git a/xml-test/invalid-attributes/metadata.xml b/xml-test/invalid-attributes/metadata.xml
35 new file mode 100644
36 index 0000000..66902dc
37 --- /dev/null
38 +++ b/xml-test/invalid-attributes/metadata.xml
39 @@ -0,0 +1,38 @@
40 +<?xml version='1.0' encoding='UTF-8'?>
41 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
42 +<pkgmetadata>
43 + <longdescription>
44 + Tests for invalid attribute values and attributes appearing
45 + in elements that they're not supposed to.
46 +
47 + There's a multitude of invalid attribute values and combinations.
48 + We only consider a few sane cases that are likely to happen:
49 + - type attribute in upstream maintainer (allowed only in downstream)
50 + - status attribute in downstream maintainer (allowed only in upstream)
51 + - invalid values for enumerated attributes: type, status, lang
52 +
53 + We also introduce multiple violations in a single element to test
54 + repoman's ability to display errors.
55 + </longdescription>
56 + <!--
57 + The errors for the following are:
58 + (1) invalid value for type
59 + (2) status attribute is not allowed in downstream maintainer
60 + (3) status attribute has invalid value
61 + There's no point in reporting (3) due to (2), so it
62 + should only print errors for the first two.
63 + -->
64 + <maintainer type='cow' status='retired'>
65 + <email>larry@g.o</email>
66 + <!-- invalid value for lang -->
67 + <description lang="english">Moo</description>
68 + </maintainer>
69 + <upstream>
70 + <!-- type attribute isn't allowed in upstream maintainer -->
71 + <maintainer status='active' type='person'>
72 + <name>Gen B0rk</name>
73 + </maintainer>
74 + <!-- invalid value for type -->
75 + <remote-id type='gen-b0rk'>gentoo/gen-b0rk</remote-id>
76 + </upstream>
77 +</pkgmetadata>