added testcase for patches parser
authorJiri Srain <jsrain@suse.cz>
Thu, 1 Dec 2005 13:27:46 +0000 (13:27 +0000)
committerJiri Srain <jsrain@suse.cz>
Thu, 1 Dec 2005 13:27:46 +0000 (13:27 +0000)
more complete repomd.xml

devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml
devel/devel.jsrain/yum/YUMParser.test/001-repomd-correct.test.xml.ref
devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml [new file with mode: 0644]
devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.err.ref [new file with mode: 0644]
devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref [new file with mode: 0644]
devel/devel.jsrain/yum/YUMtest.cc

index 3f34400..99fb851 100644 (file)
@@ -1,19 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <repomd xmlns="http://linux.duke.edu/metadata/repo">
   <data type="other">
-    <location href="repodata/other.xml.gz"/>
+    <location href="repodata/other.xml"/>
     <checksum type="sha">e7ba668ab0d49486f0a3e7a0b168406a88a46ed9</checksum>
     <timestamp>1119534896</timestamp>
     <open-checksum type="sha">394bb178eb19423f1c9f255acfd50719809cabba</open-checksum>
   </data>
   <data type="filelists">
-    <location href="repodata/filelists.xml.gz"/>
+    <location href="repodata/filelists.xml"/>
     <checksum type="sha">603594e2dd7d875a876babaf1b39f3aede460ef1</checksum>
     <timestamp>1119534896</timestamp>
     <open-checksum type="sha">047041a0149308416aa1b62eb5e11a191ca6c2e9</open-checksum>
   </data>
   <data type="primary">
-    <location href="repodata/primary.xml.gz"/>
+    <location href="repodata/primary.xml"/>
+    <checksum type="sha">20f45621426fcd74364d6fabe6929d1164797801</checksum>
+    <timestamp>1119534896</timestamp>
+    <open-checksum type="sha">e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a</open-checksum>
+  </data>
+  <data type="product">
+    <location href="repodata/product.xml"/>
+    <checksum type="sha">20f45621426fcd74364d6fabe6929d1164797801</checksum>
+    <timestamp>1119534896</timestamp>
+    <open-checksum type="sha">e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a</open-checksum>
+  </data>
+  <data type="group">
+    <location href="repodata/group.xml"/>
+    <checksum type="sha">20f45621426fcd74364d6fabe6929d1164797801</checksum>
+    <timestamp>1119534896</timestamp>
+    <open-checksum type="sha">e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a</open-checksum>
+  </data>
+  <data type="patches">
+    <location href="repodata/patches.xml"/>
     <checksum type="sha">20f45621426fcd74364d6fabe6929d1164797801</checksum>
     <timestamp>1119534896</timestamp>
     <open-checksum type="sha">e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a</open-checksum>
index e4e1bd6..3357d23 100644 (file)
@@ -1,6 +1,6 @@
 Repomd Data: 
   type: 'other'
-  location: 'repodata/other.xml.gz'
+  location: 'repodata/other.xml'
   checksumType: 'sha'
   checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9'
   timestamp: '1119534896'
@@ -8,7 +8,7 @@ Repomd Data:
   openChecksum: '394bb178eb19423f1c9f255acfd50719809cabba'
 Repomd Data: 
   type: 'filelists'
-  location: 'repodata/filelists.xml.gz'
+  location: 'repodata/filelists.xml'
   checksumType: 'sha'
   checksum: '603594e2dd7d875a876babaf1b39f3aede460ef1'
   timestamp: '1119534896'
@@ -16,7 +16,31 @@ Repomd Data:
   openChecksum: '047041a0149308416aa1b62eb5e11a191ca6c2e9'
 Repomd Data: 
   type: 'primary'
-  location: 'repodata/primary.xml.gz'
+  location: 'repodata/primary.xml'
+  checksumType: 'sha'
+  checksum: '20f45621426fcd74364d6fabe6929d1164797801'
+  timestamp: '1119534896'
+  openChecksumType: 'sha'
+  openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a'
+Repomd Data: 
+  type: 'product'
+  location: 'repodata/product.xml'
+  checksumType: 'sha'
+  checksum: '20f45621426fcd74364d6fabe6929d1164797801'
+  timestamp: '1119534896'
+  openChecksumType: 'sha'
+  openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a'
+Repomd Data: 
+  type: 'group'
+  location: 'repodata/group.xml'
+  checksumType: 'sha'
+  checksum: '20f45621426fcd74364d6fabe6929d1164797801'
+  timestamp: '1119534896'
+  openChecksumType: 'sha'
+  openChecksum: 'e8f9b1f8b3aa049ba3e3e813ee33e37302e9b16a'
+Repomd Data: 
+  type: 'patches'
+  location: 'repodata/patches.xml'
   checksumType: 'sha'
   checksum: '20f45621426fcd74364d6fabe6929d1164797801'
   timestamp: '1119534896'
diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml
new file mode 100644 (file)
index 0000000..e148913
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<patches xmlns="http://novell.com/package/metadata/suse/patches">
+  <patch id="12345">
+    <checksum type="sha">e7ba668ab0d49486f0a3e7a0b168406a88a46ed9</checksum>
+    <location href="repodata/patch.xml"/>
+  </patch>
+  <patch id="54321">
+    <checksum type="md5">e7ba668ab0d49486f0a3e7a0b168406a88a46ed9</checksum>
+    <location href="repodata/patch2.xml"/>
+  </patch>
+</patches>
diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.err.ref b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.err.ref
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref b/devel/devel.jsrain/yum/YUMParser.test/008-patches-correct.test.xml.ref
new file mode 100644 (file)
index 0000000..c6ddd4e
--- /dev/null
@@ -0,0 +1,13 @@
+-------------------------------------------------
+Patches Entry Data: 
+  patch ID: 12345
+  location: repodata/patch.xml
+  checksumType: 'sha'
+  checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9'
+-------------------------------------------------
+Patches Entry Data: 
+  patch ID: 54321
+  location: repodata/patch2.xml
+  checksumType: 'md5'
+  checksum: 'e7ba668ab0d49486f0a3e7a0b168406a88a46ed9'
+Exit Code: 0
index a5f58ad..8e78361 100644 (file)
@@ -30,7 +30,7 @@ namespace {
   void usage() {
     cerr << "YUMtest usage: "<< endl
     << "YUMtest TYPE" << endl
-    << "TYPE: repomd|primary|group|filelist|other|patch|product" << endl;
+    << "TYPE: repomd|primary|group|filelist|other|patch|patches|product" << endl;
   }
 }
 
@@ -105,6 +105,16 @@ int main(int argc, char **argv)
       if (iter.errorStatus())
         throw *iter.errorStatus();
     }
+    else if (!strcmp(argv[1],"patches")) {
+      YUMPatchesParser iter(cin,"");
+      for (;
+           !iter.atEnd();
+           ++iter) {
+             cout << **iter;
+           }
+      if (iter.errorStatus())
+        throw *iter.errorStatus();
+    }
     else if (!strcmp(argv[1],"product")) {
       YUMProductParser iter(cin,"");
       for (;