tests: Add new xml files for testing of xml parsing.
authorTomas Mlcoch <xtojaj@gmail.com>
Sun, 26 May 2013 09:53:28 +0000 (11:53 +0200)
committerTomas Mlcoch <xtojaj@gmail.com>
Sun, 26 May 2013 09:53:28 +0000 (11:53 +0200)
12 files changed:
tests/fixtures.h
tests/testdata/modified_repo_files/no_pkgid-filelists.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/no_pkgid-other.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_00-filelists.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_00-other.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_00-primary.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_01-filelists.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_01-other.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_01-primary.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_02-filelists.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_02-other.xml [new file with mode: 0644]
tests/testdata/modified_repo_files/unknown_element_02-primary.xml [new file with mode: 0644]

index f46d395..172eacf 100644 (file)
 #ifndef __C_CREATEREPOLIB_TEST_FIXTURES_H__
 #define __C_CREATEREPOLIB_TEST_FIXTURES_H__
 
-#define TEST_DATA_PATH              "testdata/"
+#define TMPDIR_TEMPLATE                 "/tmp/cr_testXXXXXX"
 
-#define TEST_FILES_PATH             TEST_DATA_PATH"test_files/"
-#define TEST_REPO_00                TEST_DATA_PATH"repo_00/"
-#define TEST_REPO_01                TEST_DATA_PATH"repo_01/"
-#define TEST_REPO_02                TEST_DATA_PATH"repo_02/"
-#define TEST_PACKAGES_PATH          TEST_DATA_PATH"packages/"
-#define TEST_COMPRESSED_FILES_PATH  TEST_DATA_PATH"compressed_files/"
+#define TEST_DATA_PATH                  "testdata/"
 
-#define TMPDIR_TEMPLATE            "/tmp/cr_testXXXXXX"
+#define TEST_COMPRESSED_FILES_PATH      TEST_DATA_PATH"compressed_files/"
+#define TEST_MODIFIED_REPO_FILES_PATH   TEST_DATA_PATH"modified_repo_files/"
+#define TEST_PACKAGES_PATH              TEST_DATA_PATH"packages/"
+#define TEST_REPO_00                    TEST_DATA_PATH"repo_00/"
+#define TEST_REPO_01                    TEST_DATA_PATH"repo_01/"
+#define TEST_REPO_02                    TEST_DATA_PATH"repo_02/"
+#define TEST_FILES_PATH                 TEST_DATA_PATH"test_files/"
 
 // Repo files
 
 #define TEST_REPO_02_FILELISTS  TEST_REPO_02"repodata/3b7e6ecd01af9cb674aff6458186911d7081bb5676d5562a21a963afc8a8bcc7-filelists.xml.gz"
 #define TEST_REPO_02_OTHER      TEST_REPO_02"repodata/ab5d3edeea50f9b4ec5ee13e4d25c147e318e3a433dbabc94d3461f58ac28255-other.xml.gz"
 
+// Modified repo files (MFR)
+
+#define TEST_MRF_NO_PKGID_FIL   TEST_MODIFIED_REPO_FILES_PATH"no_pkgid-filelists.xml"
+#define TEST_MRF_NO_PKGID_OTH   TEST_MODIFIED_REPO_FILES_PATH"no_pkgid-other.xml"
+#define TEST_MRF_UE_PRI_00      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_00-primary.xml"
+#define TEST_MRF_UE_PRI_01      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_01-primary.xml"
+#define TEST_MRF_UE_PRI_02      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_02-primary.xml"
+#define TEST_MRF_UE_FIL_00      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_00-filelists.xml"
+#define TEST_MRF_UE_FIL_01      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_01-filelists.xml"
+#define TEST_MRF_UE_FIL_02      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_02-filelists.xml"
+#define TEST_MRF_UE_OTH_00      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_00-other.xml"
+#define TEST_MRF_UE_OTH_01      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_01-other.xml"
+#define TEST_MRF_UE_OTH_02      TEST_MODIFIED_REPO_FILES_PATH"unknown_element_02-other.xml"
+
 #endif
diff --git a/tests/testdata/modified_repo_files/no_pkgid-filelists.xml b/tests/testdata/modified_repo_files/no_pkgid-filelists.xml
new file mode 100644 (file)
index 0000000..bc167c0
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <file>/usr/bin/fake_bash</file>
+</package>
+<package name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <file>/usr/bin/super_kernel</file>
+  <file>/usr/share/man/super_kernel.8.gz</file>
+</package>
+</filelists>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/no_pkgid-other.xml b/tests/testdata/modified_repo_files/no_pkgid-other.xml
new file mode 100644 (file)
index 0000000..29e3d3b
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 1.1.1-1" date="1334664000">- First release</changelog>
+  <foo>foo element</foo>
+</package>
+<package name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-1" date="1334664000">- First release</changelog>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-2" date="1334664001">- Second release</changelog>
+</package>
+</otherdata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_00-filelists.xml b/tests/testdata/modified_repo_files/unknown_element_00-filelists.xml
new file mode 100644 (file)
index 0000000..ebb8752
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <file>/usr/bin/fake_bash</file>
+  <foo>foo_element</foo>
+</package>
+<package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <file>/usr/bin/super_kernel</file>
+  <file>/usr/share/man/super_kernel.8.gz</file>
+</package>
+</filelists>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_00-other.xml b/tests/testdata/modified_repo_files/unknown_element_00-other.xml
new file mode 100644 (file)
index 0000000..044b0de
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 1.1.1-1" date="1334664000">- First release</changelog>
+  <foo>foo element</foo>
+</package>
+<package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-1" date="1334664000">- First release</changelog>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-2" date="1334664001">- Second release</changelog>
+</package>
+</otherdata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_00-primary.xml b/tests/testdata/modified_repo_files/unknown_element_00-primary.xml
new file mode 100644 (file)
index 0000000..c15d3fd
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="2">
+<package type="rpm">
+  <name>fake_bash</name>
+  <arch>x86_64</arch>
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <checksum type="sha256" pkgid="YES">90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7</checksum>
+  <summary>Fake bash</summary>
+  <description>Fake bash package</description>
+  <packager></packager>
+  <foo>foo element</foo>
+  <url>http://fake_bash_shell.com/</url>
+  <time file="1334670842" build="1334670842"/>
+  <size package="2237" installed="0" archive="256"/>
+<location href="fake_bash-1.1.1-1.x86_64.rpm"/>
+  <format>
+    <rpm:license>GPL</rpm:license>
+    <rpm:vendor/>
+    <rpm:group>System Environment/Shells</rpm:group>
+    <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+    <rpm:sourcerpm>fake_bash-1.1.1-1.src.rpm</rpm:sourcerpm>
+    <rpm:header-range start="280" end="2057"/>
+    <rpm:provides>
+      <rpm:entry name="bash"/>
+      <rpm:entry name="fake_bash" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+      <rpm:entry name="fake_bash(x86-64)" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+    </rpm:provides>
+    <rpm:requires>
+      <rpm:entry name="super_kernel"/>
+    </rpm:requires>
+    <file>/usr/bin/fake_bash</file>
+  </format>
+</package>
+<package type="rpm">
+  <name>super_kernel</name>
+  <arch>x86_64</arch>
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <checksum type="sha256" pkgid="YES">6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3</checksum>
+  <summary>Test package</summary>
+  <description>This package has provides, requires, obsoletes, conflicts options.</description>
+  <packager></packager>
+  <url>http://so_super_kernel.com/it_is_awesome/yep_it_really_is</url>
+  <time file="1334670843" build="1334670843"/>
+  <size package="2845" installed="0" archive="404"/>
+<location href="super_kernel-6.0.1-2.x86_64.rpm"/>
+  <format>
+    <rpm:license>LGPLv2</rpm:license>
+    <rpm:vendor/>
+    <rpm:group>Applications/System</rpm:group>
+    <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+    <rpm:sourcerpm>super_kernel-6.0.1-2.src.rpm</rpm:sourcerpm>
+    <rpm:header-range start="280" end="2637"/>
+    <rpm:provides>
+      <rpm:entry name="not_so_super_kernel" flags="LT" epoch="0" ver="5.8.0"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.0"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+      <rpm:entry name="super_kernel(x86-64)" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+    </rpm:provides>
+    <rpm:requires>
+      <rpm:entry name="bzip2" flags="GE" epoch="0" ver="1.0.0" pre="1"/>
+      <rpm:entry name="expat" pre="1"/>
+      <rpm:entry name="glib" flags="GE" epoch="0" ver="2.26.0"/>
+      <rpm:entry name="zlib"/>
+    </rpm:requires>
+    <rpm:conflicts>
+      <rpm:entry name="kernel"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.0.0"/>
+      <rpm:entry name="super_kernel" flags="LT" epoch="0" ver="4.0.0"/>
+    </rpm:conflicts>
+    <rpm:obsoletes>
+      <rpm:entry name="kernel"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.9.0"/>
+    </rpm:obsoletes>
+    <file>/usr/bin/super_kernel</file>
+  </format>
+</package>
+</metadata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_01-filelists.xml b/tests/testdata/modified_repo_files/unknown_element_01-filelists.xml
new file mode 100644 (file)
index 0000000..78804af
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <file>/usr/bin/fake_bash</file>
+</package>
+<bar>
+  <package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+    <version epoch="0" ver="6.0.1" rel="2"/>
+    <file>/usr/bin/super_kernel</file>
+    <file>/usr/share/man/super_kernel.8.gz</file>
+  </package>
+</bar>
+</filelists>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_01-other.xml b/tests/testdata/modified_repo_files/unknown_element_01-other.xml
new file mode 100644 (file)
index 0000000..2c02cb1
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 1.1.1-1" date="1334664000">- First release</changelog>
+</package>
+<bar>
+  <package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+    <version epoch="0" ver="6.0.1" rel="2"/>
+    <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-1" date="1334664000">- First release</changelog>
+    <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-2" date="1334664001">- Second release</changelog>
+  </package>
+</bar>
+</otherdata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_01-primary.xml b/tests/testdata/modified_repo_files/unknown_element_01-primary.xml
new file mode 100644 (file)
index 0000000..c124b0a
--- /dev/null
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="2">
+<package type="rpm">
+  <name>fake_bash</name>
+  <arch>x86_64</arch>
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <checksum type="sha256" pkgid="YES">90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7</checksum>
+  <summary>Fake bash</summary>
+  <description>Fake bash package</description>
+  <packager></packager>
+  <url>http://fake_bash_shell.com/</url>
+  <time file="1334670842" build="1334670842"/>
+  <size package="2237" installed="0" archive="256"/>
+<location href="fake_bash-1.1.1-1.x86_64.rpm"/>
+  <format>
+    <rpm:license>GPL</rpm:license>
+    <rpm:vendor/>
+    <rpm:group>System Environment/Shells</rpm:group>
+    <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+    <rpm:sourcerpm>fake_bash-1.1.1-1.src.rpm</rpm:sourcerpm>
+    <rpm:header-range start="280" end="2057"/>
+    <rpm:provides>
+      <rpm:entry name="bash"/>
+      <rpm:entry name="fake_bash" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+      <rpm:entry name="fake_bash(x86-64)" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+    </rpm:provides>
+    <rpm:requires>
+      <rpm:entry name="super_kernel"/>
+    </rpm:requires>
+    <file>/usr/bin/fake_bash</file>
+  </format>
+</package>
+<bar>
+  <package type="rpm">
+    <name>super_kernel</name>
+    <arch>x86_64</arch>
+    <version epoch="0" ver="6.0.1" rel="2"/>
+    <checksum type="sha256" pkgid="YES">6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3</checksum>
+    <summary>Test package</summary>
+    <description>This package has provides, requires, obsoletes, conflicts options.</description>
+    <packager></packager>
+    <url>http://so_super_kernel.com/it_is_awesome/yep_it_really_is</url>
+    <time file="1334670843" build="1334670843"/>
+    <size package="2845" installed="0" archive="404"/>
+    <location href="super_kernel-6.0.1-2.x86_64.rpm"/>
+    <format>
+      <rpm:license>LGPLv2</rpm:license>
+      <rpm:vendor/>
+      <rpm:group>Applications/System</rpm:group>
+      <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+      <rpm:sourcerpm>super_kernel-6.0.1-2.src.rpm</rpm:sourcerpm>
+      <rpm:header-range start="280" end="2637"/>
+      <rpm:provides>
+        <rpm:entry name="not_so_super_kernel" flags="LT" epoch="0" ver="5.8.0"/>
+        <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.0"/>
+        <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+        <rpm:entry name="super_kernel(x86-64)" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+      </rpm:provides>
+      <rpm:requires>
+        <rpm:entry name="bzip2" flags="GE" epoch="0" ver="1.0.0" pre="1"/>
+        <rpm:entry name="expat" pre="1"/>
+        <rpm:entry name="glib" flags="GE" epoch="0" ver="2.26.0"/>
+        <rpm:entry name="zlib"/>
+      </rpm:requires>
+      <rpm:conflicts>
+        <rpm:entry name="kernel"/>
+        <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.0.0"/>
+        <rpm:entry name="super_kernel" flags="LT" epoch="0" ver="4.0.0"/>
+      </rpm:conflicts>
+      <rpm:obsoletes>
+        <rpm:entry name="kernel"/>
+        <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.9.0"/>
+      </rpm:obsoletes>
+      <file>/usr/bin/super_kernel</file>
+    </format>
+  </package>
+</bar>
+</metadata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_02-filelists.xml b/tests/testdata/modified_repo_files/unknown_element_02-filelists.xml
new file mode 100644 (file)
index 0000000..53015cf
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<filelists xmlns="http://linux.duke.edu/metadata/filelists" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <file>/usr/bin/fake_bash</file>
+  <bar>
+    <foo>foo_element</foo>
+    <package pkgid="foobar"/>
+  </bar>
+</package>
+<package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <file>/usr/bin/super_kernel</file>
+  <file>/usr/share/man/super_kernel.8.gz</file>
+</package>
+</filelists>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_02-other.xml b/tests/testdata/modified_repo_files/unknown_element_02-other.xml
new file mode 100644 (file)
index 0000000..ba528bb
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<otherdata xmlns="http://linux.duke.edu/metadata/other" packages="2">
+<package pkgid="90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7" name="fake_bash" arch="x86_64">
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 1.1.1-1" date="1334664000">- First release</changelog>
+  <bar>
+    <foo>foo element</foo>
+    <package pkgid="foobar"/>
+  </bar>
+</package>
+<package pkgid="6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3" name="super_kernel" arch="x86_64">
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-1" date="1334664000">- First release</changelog>
+  <changelog author="Tomas Mlcoch &lt;tmlcoch@redhat.com&gt; - 6.0.1-2" date="1334664001">- Second release</changelog>
+</package>
+</otherdata>
\ No newline at end of file
diff --git a/tests/testdata/modified_repo_files/unknown_element_02-primary.xml b/tests/testdata/modified_repo_files/unknown_element_02-primary.xml
new file mode 100644 (file)
index 0000000..d034559
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="2">
+<package type="rpm">
+  <name>fake_bash</name>
+  <arch>x86_64</arch>
+  <version epoch="0" ver="1.1.1" rel="1"/>
+  <checksum type="sha256" pkgid="YES">90f61e546938a11449b710160ad294618a5bd3062e46f8cf851fd0088af184b7</checksum>
+  <summary>Fake bash</summary>
+  <description>Fake bash package</description>
+  <packager></packager>
+  <foo>foo element</foo>
+  <url>http://fake_bash_shell.com/</url>
+  <time file="1334670842" build="1334670842"/>
+  <size package="2237" installed="0" archive="256"/>
+<location href="fake_bash-1.1.1-1.x86_64.rpm"/>
+  <format>
+    <rpm:license>GPL</rpm:license>
+    <rpm:vendor/>
+    <rpm:group>System Environment/Shells</rpm:group>
+    <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+    <rpm:sourcerpm>fake_bash-1.1.1-1.src.rpm</rpm:sourcerpm>
+    <rpm:header-range start="280" end="2057"/>
+    <rpm:provides>
+      <rpm:entry name="bash"/>
+      <rpm:entry name="fake_bash" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+      <rpm:entry name="fake_bash(x86-64)" flags="EQ" epoch="0" ver="1.1.1" rel="1"/>
+    </rpm:provides>
+    <rpm:requires>
+      <rpm:entry name="super_kernel"/>
+    </rpm:requires>
+    <file>/usr/bin/fake_bash</file>
+  </format>
+</package>
+<bar>
+  <foo>foo element</foo>
+  <package type="foobar"/>
+</bar>
+<package type="rpm">
+  <name>super_kernel</name>
+  <arch>x86_64</arch>
+  <version epoch="0" ver="6.0.1" rel="2"/>
+  <checksum type="sha256" pkgid="YES">6d43a638af70ef899933b1fd86a866f18f65b0e0e17dcbf2e42bfd0cdd7c63c3</checksum>
+  <summary>Test package</summary>
+  <description>This package has provides, requires, obsoletes, conflicts options.</description>
+  <packager></packager>
+  <url>http://so_super_kernel.com/it_is_awesome/yep_it_really_is</url>
+  <time file="1334670843" build="1334670843"/>
+  <size package="2845" installed="0" archive="404"/>
+<location href="super_kernel-6.0.1-2.x86_64.rpm"/>
+  <format>
+    <rpm:license>LGPLv2</rpm:license>
+    <rpm:vendor/>
+    <rpm:group>Applications/System</rpm:group>
+    <rpm:buildhost>localhost.localdomain</rpm:buildhost>
+    <rpm:sourcerpm>super_kernel-6.0.1-2.src.rpm</rpm:sourcerpm>
+    <rpm:header-range start="280" end="2637"/>
+    <rpm:provides>
+      <rpm:entry name="not_so_super_kernel" flags="LT" epoch="0" ver="5.8.0"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.0"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+      <rpm:entry name="super_kernel(x86-64)" flags="EQ" epoch="0" ver="6.0.1" rel="2"/>
+    </rpm:provides>
+    <rpm:requires>
+      <rpm:entry name="bzip2" flags="GE" epoch="0" ver="1.0.0" pre="1"/>
+      <rpm:entry name="expat" pre="1"/>
+      <rpm:entry name="glib" flags="GE" epoch="0" ver="2.26.0"/>
+      <rpm:entry name="zlib"/>
+    </rpm:requires>
+    <rpm:conflicts>
+      <rpm:entry name="kernel"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.0.0"/>
+      <rpm:entry name="super_kernel" flags="LT" epoch="0" ver="4.0.0"/>
+    </rpm:conflicts>
+    <rpm:obsoletes>
+      <rpm:entry name="kernel"/>
+      <rpm:entry name="super_kernel" flags="EQ" epoch="0" ver="5.9.0"/>
+    </rpm:obsoletes>
+    <file>/usr/bin/super_kernel</file>
+  </format>
+</package>
+</metadata>
\ No newline at end of file