[Pkg-libvirt-commits] [libguestfs] 90/266: tests/guests: Fix RPM database in phony Fedora guest.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit 5b6a2e68b8ef8c05577379e19ab0bbf3f66ca216
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Aug 13 13:07:28 2014 +0100

    tests/guests: Fix RPM database in phony Fedora guest.
    
    Fix the Name and Packages database so it looks enough like a modern
    RPM database to fool inspection.  I'm not sure whether or not the old
    version ever worked, but it doesn't work now.
    
    The format is not documented, but in brief:
    
    The Name database contains (Name, link) pairs.  The link is an
    arbitrary 32 bit integer.
    
    The Packages database contains (link, RPM-blob) pairs.
    
    The RPM-blob is a binary blob formatted like this:
    
     * Number of fields               4 bytes, big endian
     * Size in bytes of the store     4 bytes, big endian
     * Field descriptions:
         list of (RPMTAG, 0, offset in store, 0)
                                      4 * 4 * nr_fields bytes, big endian
     * The store                      binary data containing ASCIIZ strings
    
    For the values of RPMTAG_* that we understand, see src/inspect-apps.c.
---
 inspector/expected-fedora.img.xml             | 21 ++++++++++++++++++++-
 tests/guests/guest-aux/fedora-name.db.txt     |  6 +++---
 tests/guests/guest-aux/fedora-packages.db.txt | 12 ++++++------
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/inspector/expected-fedora.img.xml b/inspector/expected-fedora.img.xml
index 1cea7b5..5b6f1af 100644
--- a/inspector/expected-fedora.img.xml
+++ b/inspector/expected-fedora.img.xml
@@ -28,6 +28,25 @@
         <uuid>01234567-0123-0123-0123-012345678901</uuid>
       </filesystem>
     </filesystems>
-    <applications/>
+    <applications>
+      <application>
+        <name>test1</name>
+        <version>1.0</version>
+        <release>1.fc14</release>
+        <arch>x86_64</arch>
+      </application>
+      <application>
+        <name>test2</name>
+        <version>2.0</version>
+        <release>2.fc14</release>
+        <arch>x86_64</arch>
+      </application>
+      <application>
+        <name>test3</name>
+        <version>3.0</version>
+        <release>3.fc14</release>
+        <arch>x86_64</arch>
+      </application>
+    </applications>
   </operatingsystem>
 </operatingsystems>
diff --git a/tests/guests/guest-aux/fedora-name.db.txt b/tests/guests/guest-aux/fedora-name.db.txt
index 105b0fe..8456097 100644
--- a/tests/guests/guest-aux/fedora-name.db.txt
+++ b/tests/guests/guest-aux/fedora-name.db.txt
@@ -5,9 +5,9 @@ h_nelem=3
 db_pagesize=4096
 HEADER=END
  test1
- !\0b\00\00\00\00\00\00
+ \01\00\00\00\00\00\00\00
  test2
- 7\0b\00\00\00\00\00\00
+ \02\00\00\00\00\00\00\00
  test3
- \dd\0c\00\00\00\00\00\00
+ \03\00\00\00\00\00\00\00
 DATA=END
diff --git a/tests/guests/guest-aux/fedora-packages.db.txt b/tests/guests/guest-aux/fedora-packages.db.txt
index 3939d6b..f16a5aa 100644
--- a/tests/guests/guest-aux/fedora-packages.db.txt
+++ b/tests/guests/guest-aux/fedora-packages.db.txt
@@ -4,10 +4,10 @@ type=hash
 h_nelem=3
 db_pagesize=4096
 HEADER=END
- !\0b\00\00
- \00test1\001.0\001.fc14\00
- 7\0b\00\00
- \00test2\002.0\002.fc14\00
- \dd\0c\00\00
- \00test3\003.0\003.fc14\00
+ \01\00\00\00
+ \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\001.0\001.fc14\00x86_64\00
+ \02\00\00\00
+ \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\002.0\002.fc14\00x86_64\00
+ \03\00\00\00
+ \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\003.0\003.fc14\00x86_64\00
 DATA=END

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list