[Libosinfo] [osinfo-db-tools PATCH 3/7] tests: Add tests data

Fabiano Fidêncio fidencio at redhat.com
Fri Apr 5 11:33:15 UTC 2019


The added data consists in:
- positive:
  - valid data for validation, importing, exporting tests
- negative:
  - invalid data for validation tests
- license:
  - just a license file to be used for exporting tests

https://gitlab.com/libosinfo/osinfo-db-tools/issues/2

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 tests/data/license                            |   2 +
 .../os/fedoraproject.org/fedora-rawhide.xml   |  74 ++
 tests/data/negative/schema/osinfo.rng         | 899 ++++++++++++++++++
 .../positive/datamap/x.org/x11-keyboard.xml   | 150 +++
 .../positive/device/ibm.com/ps2-keyboard.xml  |  22 +
 .../silverblue-kickstart-desktop.xml          | 116 +++
 .../os/fedoraproject.org/fedora-rawhide.xml   |  74 ++
 .../platform/linux-kvm.org/qemu-kvm-1.2.0.xml |  29 +
 tests/data/positive/schema/osinfo.rng         | 899 ++++++++++++++++++
 9 files changed, 2265 insertions(+)
 create mode 100644 tests/data/license
 create mode 100644 tests/data/negative/os/fedoraproject.org/fedora-rawhide.xml
 create mode 100644 tests/data/negative/schema/osinfo.rng
 create mode 100644 tests/data/positive/datamap/x.org/x11-keyboard.xml
 create mode 100644 tests/data/positive/device/ibm.com/ps2-keyboard.xml
 create mode 100644 tests/data/positive/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml
 create mode 100644 tests/data/positive/os/fedoraproject.org/fedora-rawhide.xml
 create mode 100644 tests/data/positive/platform/linux-kvm.org/qemu-kvm-1.2.0.xml
 create mode 100644 tests/data/positive/schema/osinfo.rng

diff --git a/tests/data/license b/tests/data/license
new file mode 100644
index 0000000..e5eaa97
--- /dev/null
+++ b/tests/data/license
@@ -0,0 +1,2 @@
+This work is licensed under the GNU GPLv2 or later.
+See the COPYING file in the top-level directory.
diff --git a/tests/data/negative/os/fedoraproject.org/fedora-rawhide.xml b/tests/data/negative/os/fedoraproject.org/fedora-rawhide.xml
new file mode 100644
index 0000000..75b31a5
--- /dev/null
+++ b/tests/data/negative/os/fedoraproject.org/fedora-rawhide.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <os id="http://fedoraproject.org/fedora/rawhide">
+    <short-id>fedora-rawhide</short-id>
+    <name>Fedora Rawhide</name>
+    <version>Rawhide</version>
+    <vendor>Fedora Project</vendor>
+    <vendor xml:lang="ca">Projecte Fedora</vendor>
+    <vendor xml:lang="de">Fedora-Projekt</vendor>
+    <vendor xml:lang="es">Fedora Project</vendor>
+    <vendor xml:lang="fr">Fedora Project</vendor>
+    <vendor xml:lang="id">Proyek Fedora</vendor>
+    <vendor xml:lang="it">Progetto Fedora</vendor>
+    <vendor xml:lang="ja">Fedora Project</vendor>
+    <vendor xml:lang="pl">Projekt Fedora</vendor>
+    <vendor xml:lang="pt">Projecto Fedora </vendor>
+    <vendor xml:lang="pt_BR">Projeto Fedora</vendor>
+    <vendor xml:lang="uk">Проект Fedora</vendor>
+    <family>linux</family>
+    <distro>fedora</distro>
+    <upgrades id="http://fedoraproject.org/fedora/29"/>
+    <derives-from id="http://fedoraproject.org/fedora/29"/>
+    <release-status>prerelease</release-status>
+
+    <media arch="x86_64">
+      <iso>
+        <volume-id>Fedora-.*-dvd-x86_64-rawh</volume-id>
+      </iso>
+      <kernel>isolinux/vmlinuz</kernel>
+      <initrd>isolinux/initrd.img</initrd>
+    </media>
+
+    <media live="true" arch="x86_64" non-existent="false">
+      <iso>
+        <volume-id>Fedora-.*-Live-rawh.*</volume-id>
+      </iso>
+    </media>
+
+    <tree arch="x86_64">
+      <url>https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/os</url>
+      <treeinfo>
+        <family>Fedora</family>
+        <version>Rawhide</version>
+        <arch>x86_64</arch>
+        <variant>Workstation</variant>
+      </treeinfo>
+    </tree>
+
+    <tree arch="x86_64">
+      <url>https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os</url>
+      <treeinfo>
+        <family>Fedora</family>
+        <version>Rawhide</version>
+        <arch>x86_64</arch>
+        <variant>Server</variant>
+      </treeinfo>
+    </tree>
+
+    <resources arch="all">
+      <minimum>
+        <n-cpus>1</n-cpus>
+        <cpu>1000000000</cpu>
+        <ram>1073741824</ram>
+        <storage>10737418240</storage>
+      </minimum>
+
+      <recommended>
+        <ram>2147483648</ram>
+        <storage>21474836480</storage>
+      </recommended>
+    </resources>
+  </os>
+</libosinfo>
diff --git a/tests/data/negative/schema/osinfo.rng b/tests/data/negative/schema/osinfo.rng
new file mode 100644
index 0000000..6228c52
--- /dev/null
+++ b/tests/data/negative/schema/osinfo.rng
@@ -0,0 +1,899 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!-- Schema distributed with osinfo-db-20190329 -->
+
+  <start>
+    <ref name='libosinfo'/>
+  </start>
+
+  <define name='libosinfo'>
+    <element name='libosinfo'>
+      <attribute name='version'>
+        <choice>
+          <value>0.0.1</value>
+        </choice>
+      </attribute>
+
+      <zeroOrMore>
+        <choice>
+          <ref name='datamap'/>
+          <ref name='device'/>
+          <ref name='os'/>
+          <ref name='platform'/>
+          <ref name='deployment'/>
+          <ref name='install-script'/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='datamap'>
+    <element name='datamap'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <oneOrMore>
+        <element name='entry'>
+          <attribute name='inval'>
+            <text/>
+          </attribute>
+          <attribute name='outval'>
+            <text/>
+          </attribute>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='device'>
+    <element name='device'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <interleave>
+        <oneOrMore>
+          <element name='name'>
+            <optional>
+              <attribute name='xml:lang'>
+                <text/>
+              </attribute>
+            </optional>
+            <text/>
+          </element>
+        </oneOrMore>
+        <optional>
+          <element name='bus-type'>
+            <choice>
+              <value>isa</value>
+              <value>pci</value>
+              <value>usb</value>
+              <value>xen</value>
+              <value>ps2</value>
+            </choice>
+          </element>
+        </optional>
+        <optional>
+          <element name='class'>
+            <choice>
+              <value>audio</value>
+              <value>block</value>
+              <value>console</value>
+              <value>chipset</value>
+              <value>controller.usb</value>
+              <value>filesystem</value>
+              <value>input</value>
+              <value>memory.balloon</value>
+              <value>net</value>
+              <value>video</value>
+              <value>watchdog</value>
+              <value>rng</value>
+            </choice>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <element name='vendor'>
+            <optional>
+              <attribute name='xml:lang'>
+                <text/>
+              </attribute>
+            </optional>
+            <text/>
+          </element>
+        </zeroOrMore>
+        <optional>
+          <element name='vendor-id'>
+            <ref name='hexid'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='product'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='product-id'>
+            <choice>
+              <ref name='hexid'/>
+              <ref name='alpha'/>
+            </choice>
+          </element>
+        </optional>
+        <optional>
+          <element name='subsystem'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name="product-attr">
+    <attribute name='id'>
+      <ref name='url'/>
+    </attribute>
+  </define>
+
+  <define name="product-content">
+    <interleave>
+      <oneOrMore>
+        <element name='vendor'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+      <oneOrMore>
+        <element name='name'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+      <oneOrMore>
+        <element name='short-id'>
+          <text/>
+        </element>
+      </oneOrMore>
+      <optional>
+        <element name='version'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='codename'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='family'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='distro'>
+          <text/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="product-dates">
+    <interleave>
+      <optional>
+        <element name='release-date'>
+          <ref name='date'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='eol-date'>
+          <ref name='date'/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="product-rel">
+    <interleave>
+      <zeroOrMore>
+        <element name="upgrades">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+      <zeroOrMore>
+        <element name="derives-from">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+      <optional>
+        <element name="clones">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name='variant'>
+    <element name='variant'>
+      <attribute name='id'>
+      </attribute>
+      <oneOrMore>
+        <element name='name'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='devices-rel'>
+    <element name='devices'>
+      <zeroOrMore>
+        <element name='device'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+          <optional>
+            <attribute name='supported'>
+              <ref name='bool'/>
+            </attribute>
+          </optional>
+          <optional>
+            <element name='driver'>
+              <text/>
+            </element>
+          </optional>
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='resource-attr'>
+    <interleave>
+      <optional>
+        <element name='cpu'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='n-cpus'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='ram'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='storage'>
+          <ref name='num'/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name='resources'>
+    <element name='resources'>
+      <attribute name='arch'>
+        <ref name='archnamesorwildcard'/>
+      </attribute>
+      <optional>
+        <attribute name='inherit'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='network-install'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='minimum'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='recommended'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='maximum'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='iso'>
+    <element name='iso'>
+      <interleave>
+        <optional>
+          <element name='volume-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='publisher-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='application-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='system-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='volume-size'>
+            <ref name='num'/>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <ref name='media-lang'/>
+        </zeroOrMore>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='media'>
+    <element name='media'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <optional>
+        <attribute name="live">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="installer">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='installer-script'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='installer-reboots'>
+          <ref name='num'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='eject-after-install'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='iso'/>
+        </optional>
+        <optional>
+          <element name='initrd'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='kernel'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <zeroOrMore>
+            <ref name='installer'/>
+          </zeroOrMore>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='media-lang'>
+    <element name='l10n-language'>
+      <optional>
+        <attribute name="regex">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="l10n-language-map">
+          <ref name='url'/>
+        </attribute>
+      </optional>
+      <text/>
+    </element>
+  </define>
+
+  <define name='treeinfo'>
+    <element name='treeinfo'>
+      <interleave>
+        <optional>
+          <element name='family'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='variant'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='version'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='arch'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='tree'>
+    <element name='tree'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='treeinfo'/>
+        </optional>
+        <optional>
+          <element name='initrd'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='kernel'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='boot-iso'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='image'>
+    <element name='image'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <attribute name='format'>
+        <ref name='imageformats'/>
+      </attribute>
+      <optional>
+        <attribute name='cloud-init'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='installer'>
+    <element name='installer'>
+      <zeroOrMore>
+        <element name="script">
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='driver'>
+    <element name='driver'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <attribute name='location'>
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="pre-installable">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="signed">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <element name='file'>
+          <text/>
+        </element>
+      </zeroOrMore>
+      <oneOrMore>
+        <element name='device'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='os'>
+    <element name='os'>
+      <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
+        <ref name='product-dates'/>
+        <ref name='product-rel'/>
+        <optional>
+          <ref name='devices-rel'/>
+        </optional>
+        <optional>
+          <ref name='release-status'/>
+        </optional>
+        <zeroOrMore>
+          <ref name='variant'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='resources'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='media'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='tree'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='image'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='installer'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='driver'/>
+        </zeroOrMore>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='platform'>
+    <element name='platform'>
+      <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
+        <ref name='product-dates'/>
+        <ref name='product-rel'/>
+        <optional>
+          <ref name='devices-rel'/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='deployment'>
+    <element name='deployment'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <interleave>
+        <element name='os'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <element name='platform'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <ref name='devices-rel'/>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='install-script'>
+    <element name='install-script'>
+      <interleave>
+        <element name='profile'>
+          <text/>
+        </element>
+        <optional>
+          <element name='path-format'>
+            <ref name='path-formats'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='expected-filename'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='avatar-format'/>
+        </optional>
+        <optional>
+          <element name='config'>
+            <oneOrMore>
+              <element name='param'>
+                <attribute name="name"/>
+                <attribute name="policy">
+                  <ref name='policies'/>
+                </attribute>
+                <optional>
+                  <attribute name="value-map"/>
+                </optional>
+              </element>
+            </oneOrMore>
+          </element>
+        </optional>
+        <optional>
+          <element name='product-key-format'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='needs-internet'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='can-pre-install-drivers'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='pre-install-drivers-signing-req'>
+            <ref name='driver-signing-reqs'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='can-post-install-drivers'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='post-install-drivers-signing-req'>
+            <ref name='driver-signing-reqs'/>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <ref name='injection-method'/>
+        </zeroOrMore>
+        <element name='template'>
+          <choice>
+            <group>
+              <attribute name="uri"/>
+              <empty/>
+            </group>
+            <ref name="customElement"/>
+          </choice>
+        </element>
+        <ref name='product-attr'/>
+        <ref name='product-rel'/>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='avatar-format'>
+    <element name='avatar-format'>
+      <interleave>
+        <oneOrMore>
+          <element name="mime-type">
+            <text/>
+          </element>
+        </oneOrMore>
+        <optional>
+          <element name="width">
+            <ref name='num'/>
+          </element>
+        </optional>
+        <optional>
+          <element name="height">
+            <ref name='num'/>
+          </element>
+        </optional>
+        <optional>
+          <element name="alpha">
+            <ref name='bool'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name="customElement">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+        <choice>
+          <attribute>
+            <anyName/>
+          </attribute>
+          <text/>
+          <ref name="customElement"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='archnamesorwildcard'>
+    <choice>
+      <value>all</value>
+      <ref name='archnames'/>
+    </choice>
+  </define>
+  <define name='archnames'>
+    <choice>
+      <value>aarch64</value>
+      <value>alpha</value>
+      <value>armv7l</value>
+      <value>cris</value>
+      <value>i686</value>
+      <value>ia64</value>
+      <value>lm32</value>
+      <value>m68k</value>
+      <value>microblaze</value>
+      <value>microblazeel</value>
+      <value>mips</value>
+      <value>mipsel</value>
+      <value>mips64</value>
+      <value>mips64el</value>
+      <value>openrisc</value>
+      <value>parisc</value>
+      <value>parisc64</value>
+      <value>ppc</value>
+      <value>ppc64</value>
+      <value>ppc64le</value>
+      <value>ppcemb</value>
+      <value>s390</value>
+      <value>s390x</value>
+      <value>sh4</value>
+      <value>sh4eb</value>
+      <value>sparc</value>
+      <value>sparc64</value>
+      <value>unicore32</value>
+      <value>x86_64</value>
+      <value>xtensa</value>
+      <value>xtensaeb</value>
+    </choice>
+  </define>
+
+  <define name='imageformats'>
+    <choice>
+      <value>qcow2</value>
+      <value>raw</value>
+      <value>vhdx</value>
+      <value>vmdk</value>
+    </choice>
+  </define>
+
+  <define name='date'>
+    <data type="string">
+      <param name="pattern">[0-9]{4}-[0-9]{2}-[0-9]{2}</param>
+    </data>
+  </define>
+
+  <define name='hexid'>
+    <data type="string">
+      <param name="pattern">[0-9a-fA-F]+</param>
+    </data>
+  </define>
+
+  <define name='alpha'>
+    <data type="string">
+      <param name="pattern">[a-zA-Z]+</param>
+    </data>
+  </define>
+
+  <define name='bool'>
+    <choice>
+      <data type='string'>
+        <param name='pattern'>true|false</param>
+      </data>
+      <empty/>
+    </choice>
+  </define>
+
+  <define name='num'>
+    <data type="string">
+      <param name="pattern">[0-9]+</param>
+    </data>
+  </define>
+
+  <define name='url'>
+    <data type="string">
+      <param name="pattern">\w+://.*</param>
+    </data>
+  </define>
+
+  <define name='policies'>
+    <data type="string">
+      <param name="pattern">required|optional</param>
+    </data>
+  </define>
+
+  <define name='path-formats'>
+    <data type="string">
+      <param name="pattern">dos|unix</param>
+    </data>
+  </define>
+  <define name='driver-signing-reqs'>
+    <data type="string">
+      <param name="pattern">strict|warn|none</param>
+    </data>
+  </define>
+
+  <define name='release-status'>
+    <element name='release-status'>
+      <data type="string">
+        <param name="pattern">snapshot|prerelease|released|rolling</param>
+      </data>
+    </element>
+  </define>
+
+  <define name='injection-method'>
+    <element name='injection-method'>
+      <data type="string">
+        <param name="pattern">cdrom|disk|floppy|initrd|web</param>
+      </data>
+    </element>
+  </define>
+</grammar>
diff --git a/tests/data/positive/datamap/x.org/x11-keyboard.xml b/tests/data/positive/datamap/x.org/x11-keyboard.xml
new file mode 100644
index 0000000..bd02938
--- /dev/null
+++ b/tests/data/positive/datamap/x.org/x11-keyboard.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <datamap id="http://x.org/x11-keyboard">
+    <entry outval="za" inval="af_ZA"/>
+    <entry outval="ae" inval="ar_AE"/>
+    <entry outval="bh" inval="ar_BH"/>
+    <entry outval="dz" inval="ar_DZ"/>
+    <entry outval="eg" inval="ar_EG"/>
+    <entry outval="in" inval="ar_IN"/>
+    <entry outval="iq" inval="ar_IQ"/>
+    <entry outval="jo" inval="ar_JO"/>
+    <entry outval="kw" inval="ar_KW"/>
+    <entry outval="lb" inval="ar_LB"/>
+    <entry outval="ly" inval="ar_LY"/>
+    <entry outval="ma" inval="ar_MA"/>
+    <entry outval="om" inval="ar_OM"/>
+    <entry outval="qa" inval="ar_QA"/>
+    <entry outval="sa" inval="ar_SA"/>
+    <entry outval="sd" inval="ar_SD"/>
+    <entry outval="sy" inval="ar_SY"/>
+    <entry outval="tn" inval="ar_TN"/>
+    <entry outval="ye" inval="ar_YE"/>
+    <entry outval="in" inval="as_IN"/>
+    <entry outval="es (ast)" inval="ast_ES"/>
+    <entry outval="by" inval="be_BY"/>
+    <entry outval="bg" inval="bg_BG"/>
+    <entry outval="bd" inval="bn_BD"/>
+    <entry outval="in (ben)" inval="bn_IN"/>
+    <entry outval="fr (bre)" inval="br_FR"/>
+    <entry outval="ba" inval="bs_BA"/>
+    <entry outval="es (cat)" inval="ca_ES"/>
+    <entry outval="cz" inval="cs_CZ"/>
+    <entry outval="gb" inval="cy_GB"/>
+    <entry outval="dk" inval="da_DK"/>
+    <entry outval="at" inval="de_AT"/>
+    <entry outval="be" inval="de_BE"/>
+    <entry outval="ch" inval="de_CH"/>
+    <entry outval="de" inval="de_DE"/>
+    <entry outval="lu" inval="de_LU"/>
+    <entry outval="gr" inval="el_GR"/>
+    <entry outval="au" inval="en_AU"/>
+    <entry outval="bw" inval="en_BW"/>
+    <entry outval="ca (eng)" inval="en_CA"/>
+    <entry outval="dk" inval="en_DK"/>
+    <entry outval="gb" inval="en_GB"/>
+    <entry outval="hk" inval="en_HK"/>
+    <entry outval="ie" inval="en_IE"/>
+    <entry outval="in (eng)" inval="en_IN"/>
+    <entry outval="nz" inval="en_NZ"/>
+    <entry outval="ph" inval="en_PH"/>
+    <entry outval="sg" inval="en_SG"/>
+    <entry outval="us" inval="en_US"/>
+    <entry outval="za" inval="en_ZA"/>
+    <entry outval="zw" inval="en_ZW"/>
+    <entry outval="ar" inval="es_AR"/>
+    <entry outval="bo" inval="es_BO"/>
+    <entry outval="cl" inval="es_CL"/>
+    <entry outval="co" inval="es_CO"/>
+    <entry outval="cr" inval="es_CR"/>
+    <entry outval="do" inval="es_DO"/>
+    <entry outval="ec" inval="es_EC"/>
+    <entry outval="es" inval="es_ES"/>
+    <entry outval="gt" inval="es_GT"/>
+    <entry outval="hn" inval="es_HN"/>
+    <entry outval="mx" inval="es_MX"/>
+    <entry outval="ni" inval="es_NI"/>
+    <entry outval="pa" inval="es_PA"/>
+    <entry outval="pe" inval="es_PE"/>
+    <entry outval="pr" inval="es_PR"/>
+    <entry outval="py" inval="es_PY"/>
+    <entry outval="sv" inval="es_SV"/>
+    <entry outval="us" inval="es_US"/>
+    <entry outval="uy" inval="es_UY"/>
+    <entry outval="ve" inval="es_VE"/>
+    <entry outval="ee" inval="et_EE"/>
+    <entry outval="es" inval="eu_ES"/>
+    <entry outval="ir" inval="fa_IR"/>
+    <entry outval="fi" inval="fi_FI"/>
+    <entry outval="fo" inval="fo_FO"/>
+    <entry outval="be" inval="fr_BE"/>
+    <entry outval="ca" inval="fr_CA"/>
+    <entry outval="ch (fr)" inval="fr_CH"/>
+    <entry outval="fr" inval="fr_FR"/>
+    <entry outval="lu" inval="fr_LU"/>
+    <entry outval="ie" inval="ga_IE"/>
+    <entry outval="es" inval="gl_ES"/>
+    <entry outval="in (guj)" inval="gu_IN"/>
+    <entry outval="gb" inval="gv_GB"/>
+    <entry outval="il" inval="he_IL"/>
+    <entry outval="in" inval="hi_IN"/>
+    <entry outval="hr" inval="hr_HR"/>
+    <entry outval="hu" inval="hu_HU"/>
+    <entry outval="id" inval="id_ID"/>
+    <entry outval="is" inval="is_IS"/>
+    <entry outval="ch" inval="it_CH"/>
+    <entry outval="it" inval="it_IT"/>
+    <entry outval="jp" inval="ja_JP"/>
+    <entry outval="gl" inval="kl_GL"/>
+    <entry outval="in (kan)" inval="kn_IN"/>
+    <entry outval="kr" inval="ko_KR"/>
+    <entry outval="gb" inval="kw_GB"/>
+    <entry outval="la" inval="lo_LA"/>
+    <entry outval="lt" inval="lt_LT"/>
+    <entry outval="lv" inval="lv_LV"/>
+    <entry outval="in" inval="mai_IN"/>
+    <entry outval="mk" inval="mk_MK"/>
+    <entry outval="in (mal)" inval="ml_IN"/>
+    <entry outval="in" inval="mr_IN"/>
+    <entry outval="my" inval="ms_MY"/>
+    <entry outval="mt" inval="mt_MT"/>
+    <entry outval="no" inval="nb_NO"/>
+    <entry outval="de" inval="nds_DE"/>
+    <entry outval="np" inval="ne_NP"/>
+    <entry outval="be" inval="nl_BE"/>
+    <entry outval="nl" inval="nl_NL"/>
+    <entry outval="no" inval="nn_NO"/>
+    <entry outval="fr (oci)" inval="oc_FR"/>
+    <entry outval="in (ori)" inval="or_IN"/>
+    <entry outval="in (guru)" inval="pa_IN"/>
+    <entry outval="pl" inval="pl_PL"/>
+    <entry outval="br" inval="pt_BR"/>
+    <entry outval="pt" inval="pt_PT"/>
+    <entry outval="ro" inval="ro_RO"/>
+    <entry outval="ru" inval="ru_RU"/>
+    <entry outval="ua" inval="ru_UA"/>
+    <entry outval="no (smi)" inval="se_NO"/>
+    <entry outval="lk" inval="si_LK"/>
+    <entry outval="sk" inval="sk_SK"/>
+    <entry outval="si" inval="sl_SI"/>
+    <entry outval="al" inval="sq_AL"/>
+    <entry outval="rs" inval="sr_RS"/>
+    <entry outval="fi" inval="sv_FI"/>
+    <entry outval="se" inval="sv_SE"/>
+    <entry outval="in (tam)" inval="ta_IN"/>
+    <entry outval="in (tel)" inval="te_IN"/>
+    <entry outval="th" inval="th_TH"/>
+    <entry outval="ph" inval="tl_PH"/>
+    <entry outval="tr" inval="tr_TR"/>
+    <entry outval="ua" inval="uk_UA"/>
+    <entry outval="pk" inval="ur_PK"/>
+    <entry outval="uz" inval="uz_UZ"/>
+    <entry outval="be" inval="wa_BE"/>
+    <entry outval="za" inval="xh_ZA"/>
+    <entry outval="cn" inval="zh_CN"/>
+    <entry outval="hk" inval="zh_HK"/>
+    <entry outval="tw" inval="zh_TW"/>
+    <entry outval="za" inval="zu_ZA"/>
+  </datamap>
+</libosinfo>
diff --git a/tests/data/positive/device/ibm.com/ps2-keyboard.xml b/tests/data/positive/device/ibm.com/ps2-keyboard.xml
new file mode 100644
index 0000000..0109e2c
--- /dev/null
+++ b/tests/data/positive/device/ibm.com/ps2-keyboard.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <device id="http://ibm.com/ps2/keyboard">
+    <name>keyboard</name>
+    <bus-type>ps2</bus-type>
+    <class>input</class>
+    <vendor>Qemu/KVM</vendor>
+    <vendor xml:lang="ca">Qemu/KVM</vendor>
+    <vendor xml:lang="de">Qemu/KVM</vendor>
+    <vendor xml:lang="es">Qemu/KVM</vendor>
+    <vendor xml:lang="fr">Qemu/KVM</vendor>
+    <vendor xml:lang="id">Qemu/KVM</vendor>
+    <vendor xml:lang="it">Qemu/KVM</vendor>
+    <vendor xml:lang="ja">QEMU/KVM</vendor>
+    <vendor xml:lang="pl">QEMU/KVM</vendor>
+    <vendor xml:lang="pt">Qemu/KVM</vendor>
+    <vendor xml:lang="pt_BR">Qemu/KVM</vendor>
+    <vendor xml:lang="uk">Qemu/KVM</vendor>
+    <product>Keyboard</product>
+  </device>
+</libosinfo>
diff --git a/tests/data/positive/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml b/tests/data/positive/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml
new file mode 100644
index 0000000..f8af5dc
--- /dev/null
+++ b/tests/data/positive/install-script/fedoraproject.org/silverblue-kickstart-desktop.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <install-script id='http://fedoraproject.org/silverblue/kickstart/desktop'>
+    <profile>desktop</profile>
+    <expected-filename>silverblue.ks</expected-filename>
+    <config>
+        <param value-map="http://x.org/x11-keyboard" policy="optional" name="l10n-keyboard"/>
+        <param policy="optional" name="l10n-language"/>
+        <param policy="optional" name="l10n-timezone"/>
+        <param policy="optional" name="hostname"/>
+        <param policy="required" name="user-login"/>
+        <param policy="optional" name="user-password"/>
+        <param policy="optional" name="admin-password"/>
+        <param policy="required" name="script-disk"/>
+    </config>
+    <injection-method>cdrom</injection-method>
+    <injection-method>disk</injection-method>
+    <injection-method>floppy</injection-method>
+    <injection-method>initrd</injection-method>
+    <template>
+      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+        <xsl:output method="text"/>
+
+        <xsl:template name="script-disk">
+          <xsl:variable name="script-disk">
+            <xsl:value-of select="config/script-disk"/>
+          </xsl:variable>
+          <xsl:value-of select="substring-after($script-disk, '/dev/')"/>
+        </xsl:template>
+
+        <xsl:template match="/command-line">
+          <xsl:text>ks=</xsl:text>
+          <xsl:choose>
+            <xsl:when test="script/preferred-injection-method = 'initrd'">
+              <xsl:text>file:/</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>hd:</xsl:text>
+              <xsl:call-template name="script-disk"/>
+              <xsl:text>:/</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+          <xsl:value-of select="script/expected-filename"/>
+        </xsl:template>
+
+        <xsl:template match="/install-script-config">
+# Install script for <xsl:value-of select="os/short-id"/> profile <xsl:value-of select="script/profile"/>
+install
+keyboard '<xsl:value-of select="config/l10n-keyboard"/>'
+lang <xsl:value-of select="config/l10n-language"/>
+network --onboot yes --bootproto dhcp --noipv6 --hostname=<xsl:value-of select="config/hostname"/>
+rootpw dummyPa55w0rd # Actual password set (or unset) in %post below
+firewall --disabled
+timezone --utc <xsl:value-of select="config/l10n-timezone"/>
+bootloader --location=mbr
+zerombr
+
+clearpart --all --drives=/dev/vda
+
+firstboot --disable
+
+autopart
+
+<xsl:choose>
+  <xsl:when test="os/version < 29">
+ostreesetup --osname="fedora-workstation" --remote="fedora-<xsl:value-of select="os/version"/>" --url="file:///ostree/repo" --ref="fedora/<xsl:value-of select="os/version"/>/<xsl:value-of select="config/hardware-arch"/>/workstation" --nogpg
+  </xsl:when>
+  <xsl:otherwise>
+ostreesetup --osname="fedora-silverblue" --remote="fedora-<xsl:value-of select="os/version"/>" --url="file:///ostree/repo" --ref="fedora/<xsl:value-of select="os/version"/>/<xsl:value-of select="config/hardware-arch"/>/silverblue" --nogpg
+  </xsl:otherwise>
+</xsl:choose>
+graphical
+reboot
+
+%post --erroronfail
+
+useradd -G wheel <xsl:value-of select="config/user-login"/> # Add user
+if test -z '<xsl:value-of select="config/user-password"/>'; then
+    passwd -d <xsl:value-of select="config/user-login"/> # Make user account passwordless
+else
+    echo '<xsl:value-of select="config/user-password"/>' |passwd --stdin <xsl:value-of select="config/user-login"/>
+fi
+
+if test -z '<xsl:value-of select="config/admin-password"/>'; then
+    passwd -d root # Make root account passwordless
+else
+    echo '<xsl:value-of select="config/admin-password"/>' |passwd --stdin root
+fi
+
+# Enable autologin
+echo "[daemon]
+AutomaticLoginEnable=true
+AutomaticLogin=<xsl:value-of select="config/user-login"/>
+
+[security]
+
+[xdmcp]
+
+[greeter]
+
+[chooser]
+
+[debug]
+" > /etc/gdm/custom.conf
+
+rm -f /etc/ostree/remotes.d/fedora-'<xsl:value-of select="os/version"/>'.conf
+ostree remote add --if-not-exists --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-<xsl:value-of select="os/version"/>-primary fedora-<xsl:value-of select="os/version"/> 'https://dl.fedoraproject.org/atomic/repo/'
+
+%end
+        </xsl:template>
+      </xsl:stylesheet>
+    </template>
+  </install-script>
+</libosinfo>
diff --git a/tests/data/positive/os/fedoraproject.org/fedora-rawhide.xml b/tests/data/positive/os/fedoraproject.org/fedora-rawhide.xml
new file mode 100644
index 0000000..85ff2f4
--- /dev/null
+++ b/tests/data/positive/os/fedoraproject.org/fedora-rawhide.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <os id="http://fedoraproject.org/fedora/rawhide">
+    <short-id>fedora-rawhide</short-id>
+    <name>Fedora Rawhide</name>
+    <version>Rawhide</version>
+    <vendor>Fedora Project</vendor>
+    <vendor xml:lang="ca">Projecte Fedora</vendor>
+    <vendor xml:lang="de">Fedora-Projekt</vendor>
+    <vendor xml:lang="es">Fedora Project</vendor>
+    <vendor xml:lang="fr">Fedora Project</vendor>
+    <vendor xml:lang="id">Proyek Fedora</vendor>
+    <vendor xml:lang="it">Progetto Fedora</vendor>
+    <vendor xml:lang="ja">Fedora Project</vendor>
+    <vendor xml:lang="pl">Projekt Fedora</vendor>
+    <vendor xml:lang="pt">Projecto Fedora </vendor>
+    <vendor xml:lang="pt_BR">Projeto Fedora</vendor>
+    <vendor xml:lang="uk">Проект Fedora</vendor>
+    <family>linux</family>
+    <distro>fedora</distro>
+    <upgrades id="http://fedoraproject.org/fedora/29"/>
+    <derives-from id="http://fedoraproject.org/fedora/29"/>
+    <release-status>prerelease</release-status>
+
+    <media arch="x86_64">
+      <iso>
+        <volume-id>Fedora-.*-dvd-x86_64-rawh</volume-id>
+      </iso>
+      <kernel>isolinux/vmlinuz</kernel>
+      <initrd>isolinux/initrd.img</initrd>
+    </media>
+
+    <media live="true" arch="x86_64">
+      <iso>
+        <volume-id>Fedora-.*-Live-rawh.*</volume-id>
+      </iso>
+    </media>
+
+    <tree arch="x86_64">
+      <url>https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/os</url>
+      <treeinfo>
+        <family>Fedora</family>
+        <version>Rawhide</version>
+        <arch>x86_64</arch>
+        <variant>Workstation</variant>
+      </treeinfo>
+    </tree>
+
+    <tree arch="x86_64">
+      <url>https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os</url>
+      <treeinfo>
+        <family>Fedora</family>
+        <version>Rawhide</version>
+        <arch>x86_64</arch>
+        <variant>Server</variant>
+      </treeinfo>
+    </tree>
+
+    <resources arch="all">
+      <minimum>
+        <n-cpus>1</n-cpus>
+        <cpu>1000000000</cpu>
+        <ram>1073741824</ram>
+        <storage>10737418240</storage>
+      </minimum>
+
+      <recommended>
+        <ram>2147483648</ram>
+        <storage>21474836480</storage>
+      </recommended>
+    </resources>
+  </os>
+</libosinfo>
diff --git a/tests/data/positive/platform/linux-kvm.org/qemu-kvm-1.2.0.xml b/tests/data/positive/platform/linux-kvm.org/qemu-kvm-1.2.0.xml
new file mode 100644
index 0000000..ddb369a
--- /dev/null
+++ b/tests/data/positive/platform/linux-kvm.org/qemu-kvm-1.2.0.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<libosinfo version="0.0.1">
+
+  <platform id="http://linux-kvm.org/qemu-kvm/1.2.0">
+    <short-id>qemu-kvm-1.2.0</short-id>
+    <name>QEMU-KVM 1.2.0</name>
+    <name xml:lang="ca">QEMU-KVM 1.2.0</name>
+    <name xml:lang="es">QEMU-KVM 1.2.0</name>
+    <name xml:lang="fr">QEMU-KVM 1.2.0</name>
+    <name xml:lang="id">QEMU-KVM 1.2.0</name>
+    <name xml:lang="it">QEMU-KVM 1.2.0</name>
+    <name xml:lang="pl">QEMU-KVM 1.2.0</name>
+    <name xml:lang="pt_BR">QEMU-KVM 1.2.0</name>
+    <name xml:lang="uk">QEMU-KVM 1.2.0</name>
+    <vendor>linux-kvm.org</vendor>
+    <vendor xml:lang="ca">linux-kvm.org</vendor>
+    <vendor xml:lang="es">linux-kvm.org</vendor>
+    <vendor xml:lang="fr">linux-kvm.org</vendor>
+    <vendor xml:lang="id">linux-kvm.org</vendor>
+    <vendor xml:lang="it">linux-kvm.org</vendor>
+    <vendor xml:lang="pl">linux-kvm.org</vendor>
+    <vendor xml:lang="pt_BR">linux-kvm.org</vendor>
+    <vendor xml:lang="uk">linux-kvm.org</vendor>
+    <version>1.2.0</version>
+    <release-date>2012-09-10</release-date>
+    <upgrades id="http://linux-kvm.org/qemu-kvm/1.1.2"/>
+    <derives-from id="http://qemu.org/qemu/1.2.0"/>
+  </platform>
+</libosinfo>
diff --git a/tests/data/positive/schema/osinfo.rng b/tests/data/positive/schema/osinfo.rng
new file mode 100644
index 0000000..6228c52
--- /dev/null
+++ b/tests/data/positive/schema/osinfo.rng
@@ -0,0 +1,899 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!-- Schema distributed with osinfo-db-20190329 -->
+
+  <start>
+    <ref name='libosinfo'/>
+  </start>
+
+  <define name='libosinfo'>
+    <element name='libosinfo'>
+      <attribute name='version'>
+        <choice>
+          <value>0.0.1</value>
+        </choice>
+      </attribute>
+
+      <zeroOrMore>
+        <choice>
+          <ref name='datamap'/>
+          <ref name='device'/>
+          <ref name='os'/>
+          <ref name='platform'/>
+          <ref name='deployment'/>
+          <ref name='install-script'/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='datamap'>
+    <element name='datamap'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <oneOrMore>
+        <element name='entry'>
+          <attribute name='inval'>
+            <text/>
+          </attribute>
+          <attribute name='outval'>
+            <text/>
+          </attribute>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='device'>
+    <element name='device'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <interleave>
+        <oneOrMore>
+          <element name='name'>
+            <optional>
+              <attribute name='xml:lang'>
+                <text/>
+              </attribute>
+            </optional>
+            <text/>
+          </element>
+        </oneOrMore>
+        <optional>
+          <element name='bus-type'>
+            <choice>
+              <value>isa</value>
+              <value>pci</value>
+              <value>usb</value>
+              <value>xen</value>
+              <value>ps2</value>
+            </choice>
+          </element>
+        </optional>
+        <optional>
+          <element name='class'>
+            <choice>
+              <value>audio</value>
+              <value>block</value>
+              <value>console</value>
+              <value>chipset</value>
+              <value>controller.usb</value>
+              <value>filesystem</value>
+              <value>input</value>
+              <value>memory.balloon</value>
+              <value>net</value>
+              <value>video</value>
+              <value>watchdog</value>
+              <value>rng</value>
+            </choice>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <element name='vendor'>
+            <optional>
+              <attribute name='xml:lang'>
+                <text/>
+              </attribute>
+            </optional>
+            <text/>
+          </element>
+        </zeroOrMore>
+        <optional>
+          <element name='vendor-id'>
+            <ref name='hexid'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='product'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='product-id'>
+            <choice>
+              <ref name='hexid'/>
+              <ref name='alpha'/>
+            </choice>
+          </element>
+        </optional>
+        <optional>
+          <element name='subsystem'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name="product-attr">
+    <attribute name='id'>
+      <ref name='url'/>
+    </attribute>
+  </define>
+
+  <define name="product-content">
+    <interleave>
+      <oneOrMore>
+        <element name='vendor'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+      <oneOrMore>
+        <element name='name'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+      <oneOrMore>
+        <element name='short-id'>
+          <text/>
+        </element>
+      </oneOrMore>
+      <optional>
+        <element name='version'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='codename'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='family'>
+          <text/>
+        </element>
+      </optional>
+      <optional>
+        <element name='distro'>
+          <text/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="product-dates">
+    <interleave>
+      <optional>
+        <element name='release-date'>
+          <ref name='date'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='eol-date'>
+          <ref name='date'/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name="product-rel">
+    <interleave>
+      <zeroOrMore>
+        <element name="upgrades">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+      <zeroOrMore>
+        <element name="derives-from">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+      <optional>
+        <element name="clones">
+          <attribute name='id'>
+            <ref name="url"/>
+          </attribute>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name='variant'>
+    <element name='variant'>
+      <attribute name='id'>
+      </attribute>
+      <oneOrMore>
+        <element name='name'>
+          <optional>
+            <attribute name='xml:lang'>
+              <text/>
+            </attribute>
+          </optional>
+          <text/>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='devices-rel'>
+    <element name='devices'>
+      <zeroOrMore>
+        <element name='device'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+          <optional>
+            <attribute name='supported'>
+              <ref name='bool'/>
+            </attribute>
+          </optional>
+          <optional>
+            <element name='driver'>
+              <text/>
+            </element>
+          </optional>
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='resource-attr'>
+    <interleave>
+      <optional>
+        <element name='cpu'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='n-cpus'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='ram'>
+          <ref name='num'/>
+        </element>
+      </optional>
+      <optional>
+        <element name='storage'>
+          <ref name='num'/>
+        </element>
+      </optional>
+    </interleave>
+  </define>
+
+  <define name='resources'>
+    <element name='resources'>
+      <attribute name='arch'>
+        <ref name='archnamesorwildcard'/>
+      </attribute>
+      <optional>
+        <attribute name='inherit'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='network-install'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='minimum'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='recommended'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='maximum'>
+            <ref name='resource-attr'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='iso'>
+    <element name='iso'>
+      <interleave>
+        <optional>
+          <element name='volume-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='publisher-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='application-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='system-id'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='volume-size'>
+            <ref name='num'/>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <ref name='media-lang'/>
+        </zeroOrMore>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='media'>
+    <element name='media'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <optional>
+        <attribute name="live">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="installer">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='installer-script'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='installer-reboots'>
+          <ref name='num'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name='eject-after-install'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='iso'/>
+        </optional>
+        <optional>
+          <element name='initrd'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='kernel'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <zeroOrMore>
+            <ref name='installer'/>
+          </zeroOrMore>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='media-lang'>
+    <element name='l10n-language'>
+      <optional>
+        <attribute name="regex">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="l10n-language-map">
+          <ref name='url'/>
+        </attribute>
+      </optional>
+      <text/>
+    </element>
+  </define>
+
+  <define name='treeinfo'>
+    <element name='treeinfo'>
+      <interleave>
+        <optional>
+          <element name='family'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='variant'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='version'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='arch'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='tree'>
+    <element name='tree'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='treeinfo'/>
+        </optional>
+        <optional>
+          <element name='initrd'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='kernel'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='boot-iso'>
+            <text/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='image'>
+    <element name='image'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <attribute name='format'>
+        <ref name='imageformats'/>
+      </attribute>
+      <optional>
+        <attribute name='cloud-init'>
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <interleave>
+        <optional>
+          <element name='variant'>
+            <attribute name='id'>
+            </attribute>
+          </element>
+        </optional>
+        <optional>
+          <element name='url'>
+            <ref name='url'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='installer'>
+    <element name='installer'>
+      <zeroOrMore>
+        <element name="script">
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='driver'>
+    <element name='driver'>
+      <attribute name='arch'>
+        <ref name='archnames'/>
+      </attribute>
+      <attribute name='location'>
+        <text/>
+      </attribute>
+      <optional>
+        <attribute name="pre-installable">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="signed">
+          <ref name='bool'/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <element name='file'>
+          <text/>
+        </element>
+      </zeroOrMore>
+      <oneOrMore>
+        <element name='device'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+
+  <define name='os'>
+    <element name='os'>
+      <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
+        <ref name='product-dates'/>
+        <ref name='product-rel'/>
+        <optional>
+          <ref name='devices-rel'/>
+        </optional>
+        <optional>
+          <ref name='release-status'/>
+        </optional>
+        <zeroOrMore>
+          <ref name='variant'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='resources'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='media'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='tree'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='image'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='installer'/>
+        </zeroOrMore>
+        <zeroOrMore>
+          <ref name='driver'/>
+        </zeroOrMore>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='platform'>
+    <element name='platform'>
+      <interleave>
+        <ref name='product-attr'/>
+        <ref name='product-content'/>
+        <ref name='product-dates'/>
+        <ref name='product-rel'/>
+        <optional>
+          <ref name='devices-rel'/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='deployment'>
+    <element name='deployment'>
+      <attribute name='id'>
+        <ref name='url'/>
+      </attribute>
+      <interleave>
+        <element name='os'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <element name='platform'>
+          <attribute name='id'>
+            <ref name='url'/>
+          </attribute>
+        </element>
+        <ref name='devices-rel'/>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='install-script'>
+    <element name='install-script'>
+      <interleave>
+        <element name='profile'>
+          <text/>
+        </element>
+        <optional>
+          <element name='path-format'>
+            <ref name='path-formats'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='expected-filename'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <ref name='avatar-format'/>
+        </optional>
+        <optional>
+          <element name='config'>
+            <oneOrMore>
+              <element name='param'>
+                <attribute name="name"/>
+                <attribute name="policy">
+                  <ref name='policies'/>
+                </attribute>
+                <optional>
+                  <attribute name="value-map"/>
+                </optional>
+              </element>
+            </oneOrMore>
+          </element>
+        </optional>
+        <optional>
+          <element name='product-key-format'>
+            <text/>
+          </element>
+        </optional>
+        <optional>
+          <element name='needs-internet'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='can-pre-install-drivers'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='pre-install-drivers-signing-req'>
+            <ref name='driver-signing-reqs'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='can-post-install-drivers'>
+            <ref name='bool'/>
+          </element>
+        </optional>
+        <optional>
+          <element name='post-install-drivers-signing-req'>
+            <ref name='driver-signing-reqs'/>
+          </element>
+        </optional>
+        <zeroOrMore>
+          <ref name='injection-method'/>
+        </zeroOrMore>
+        <element name='template'>
+          <choice>
+            <group>
+              <attribute name="uri"/>
+              <empty/>
+            </group>
+            <ref name="customElement"/>
+          </choice>
+        </element>
+        <ref name='product-attr'/>
+        <ref name='product-rel'/>
+      </interleave>
+    </element>
+  </define>
+
+  <define name='avatar-format'>
+    <element name='avatar-format'>
+      <interleave>
+        <oneOrMore>
+          <element name="mime-type">
+            <text/>
+          </element>
+        </oneOrMore>
+        <optional>
+          <element name="width">
+            <ref name='num'/>
+          </element>
+        </optional>
+        <optional>
+          <element name="height">
+            <ref name='num'/>
+          </element>
+        </optional>
+        <optional>
+          <element name="alpha">
+            <ref name='bool'/>
+          </element>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+
+  <define name="customElement">
+    <element>
+      <anyName/>
+      <zeroOrMore>
+        <choice>
+          <attribute>
+            <anyName/>
+          </attribute>
+          <text/>
+          <ref name="customElement"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+
+  <define name='archnamesorwildcard'>
+    <choice>
+      <value>all</value>
+      <ref name='archnames'/>
+    </choice>
+  </define>
+  <define name='archnames'>
+    <choice>
+      <value>aarch64</value>
+      <value>alpha</value>
+      <value>armv7l</value>
+      <value>cris</value>
+      <value>i686</value>
+      <value>ia64</value>
+      <value>lm32</value>
+      <value>m68k</value>
+      <value>microblaze</value>
+      <value>microblazeel</value>
+      <value>mips</value>
+      <value>mipsel</value>
+      <value>mips64</value>
+      <value>mips64el</value>
+      <value>openrisc</value>
+      <value>parisc</value>
+      <value>parisc64</value>
+      <value>ppc</value>
+      <value>ppc64</value>
+      <value>ppc64le</value>
+      <value>ppcemb</value>
+      <value>s390</value>
+      <value>s390x</value>
+      <value>sh4</value>
+      <value>sh4eb</value>
+      <value>sparc</value>
+      <value>sparc64</value>
+      <value>unicore32</value>
+      <value>x86_64</value>
+      <value>xtensa</value>
+      <value>xtensaeb</value>
+    </choice>
+  </define>
+
+  <define name='imageformats'>
+    <choice>
+      <value>qcow2</value>
+      <value>raw</value>
+      <value>vhdx</value>
+      <value>vmdk</value>
+    </choice>
+  </define>
+
+  <define name='date'>
+    <data type="string">
+      <param name="pattern">[0-9]{4}-[0-9]{2}-[0-9]{2}</param>
+    </data>
+  </define>
+
+  <define name='hexid'>
+    <data type="string">
+      <param name="pattern">[0-9a-fA-F]+</param>
+    </data>
+  </define>
+
+  <define name='alpha'>
+    <data type="string">
+      <param name="pattern">[a-zA-Z]+</param>
+    </data>
+  </define>
+
+  <define name='bool'>
+    <choice>
+      <data type='string'>
+        <param name='pattern'>true|false</param>
+      </data>
+      <empty/>
+    </choice>
+  </define>
+
+  <define name='num'>
+    <data type="string">
+      <param name="pattern">[0-9]+</param>
+    </data>
+  </define>
+
+  <define name='url'>
+    <data type="string">
+      <param name="pattern">\w+://.*</param>
+    </data>
+  </define>
+
+  <define name='policies'>
+    <data type="string">
+      <param name="pattern">required|optional</param>
+    </data>
+  </define>
+
+  <define name='path-formats'>
+    <data type="string">
+      <param name="pattern">dos|unix</param>
+    </data>
+  </define>
+  <define name='driver-signing-reqs'>
+    <data type="string">
+      <param name="pattern">strict|warn|none</param>
+    </data>
+  </define>
+
+  <define name='release-status'>
+    <element name='release-status'>
+      <data type="string">
+        <param name="pattern">snapshot|prerelease|released|rolling</param>
+      </data>
+    </element>
+  </define>
+
+  <define name='injection-method'>
+    <element name='injection-method'>
+      <data type="string">
+        <param name="pattern">cdrom|disk|floppy|initrd|web</param>
+      </data>
+    </element>
+  </define>
+</grammar>
-- 
2.21.0




More information about the Libosinfo mailing list