Ticket #3751: 3751-0004-extfs-rpm-add-tests.patch

File 3751-0004-extfs-rpm-add-tests.patch, 18.3 KB (added by mooffie, 7 years ago)
  • tests/src/vfs/extfs/helpers-list/Makefile.am

    From 96f6595a7f2b69a38ec1f30892e27667940fb1d0 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Mon, 2 Jan 2017 06:01:36 +0200
    Subject: [PATCH 4/4] Ticket #3751: extfs: rpm: add tests.
    
    Signed-off-by: Mooffie <mooffie@gmail.com>
    ---
     tests/src/vfs/extfs/helpers-list/Makefile.am       |   5 +
     tests/src/vfs/extfs/helpers-list/data/rpm.README   |  14 ++
     tests/src/vfs/extfs/helpers-list/data/rpm.env_vars |   4 +
     tests/src/vfs/extfs/helpers-list/data/rpm.input    | 263 +++++++++++++++++++++
     tests/src/vfs/extfs/helpers-list/data/rpm.output   |  27 +++
     .../src/vfs/extfs/helpers-list/data/rpm.rewrite.sh |  70 ++++++
     6 files changed, 383 insertions(+)
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.README
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.env_vars
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.input
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.output
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.rewrite.sh
    
    diff --git a/tests/src/vfs/extfs/helpers-list/Makefile.am b/tests/src/vfs/extfs/helpers-list/Makefile.am
    index 79d3d2c..cc29adf 100644
    a b data_files_to_distribute = \ 
    3838        data/lslR.3.spaces-iso-noslash.input \ 
    3939        data/lslR.3.spaces-iso-noslash.output \ 
    4040        data/lslR.README \ 
     41        data/rpm.README \ 
     42        data/rpm.env_vars \ 
     43        data/rpm.input \ 
     44        data/rpm.output \ 
     45        data/rpm.rewrite.sh \ 
    4146        data/u7z.README \ 
    4247        data/u7z.complex.env_vars \ 
    4348        data/u7z.complex.input \ 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.README

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.README b/tests/src/vfs/extfs/helpers-list/data/rpm.README
    new file mode 100644
    index 0000000..e08e324
    - +  
     1 
     2The *.input files for the rpm helper are what we call "tags files". 
     3They're generated by rpm2tags. 
     4 
     5The rpm package chosen was glib2-2.46.2-4.el7.i686.rpm (downloadable from 
     6rpmfind.net), as it has scriptlets that demonstrate the INFO/SCRIPTS dir. 
     7 
     8-- 
     9 
     10The way this test works is a bit unconventional: 
     11 
     12We aren't overriding one or two variables in the helper but, instead, 
     13inject a code snippet into it (see 'rpm.rewrite.sh'). This lets us 
     14override a couple of functions to imitate the 'rpm' binary. 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.env_vars

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.env_vars b/tests/src/vfs/extfs/helpers-list/data/rpm.env_vars
    new file mode 100644
    index 0000000..c08b141
    - +  
     1MC_TEST_INPUT="$INPUT"   # export it. 
     2MC_TEST_RPM_REWRITE="$DATA_DIR/rpm.rewrite.sh" 
     3 
     4MCFASTRPM=               # disable "fast mode". 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.input

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.input b/tests/src/vfs/extfs/helpers-list/data/rpm.input
    new file mode 100644
    index 0000000..2e2d6e9
    - +  
     1# -*- Perl -*- 
     2# 
     3# This "tags file" was created by running the following command: 
     4# 
     5#    $ rpm2tags glib2-2.46.2-4.el7.i686.rpm 
     6# 
     7# This file is used in our tests instead of the corresponding RPM file. 
     8# This lets us run the tests on systems where 'rpm' is not installed. 
     9 
     10$tags = { 
     11  'CONFLICTFLAGS:depflags' => '(none)', 
     12  'P' => 'glib2', 
     13  'FILELANGS' => '', 
     14  'VERSION' => '2.46.2', 
     15  'CHANGELOGTEXT' => '- Backport a patch to fix a segfault in file monitor code 
     16- Resolves: #1375753', 
     17  'POSTIN' => '/sbin/ldconfig 
     18gio-querymodules-32 /usr/lib/gio/modules', 
     19  'FILECONTEXTS' => '(none)', 
     20  'TRIGGERTYPE' => '(none)', 
     21  'GROUP' => 'System Environment/Libraries', 
     22  'DESCRIPTION' => 'GLib is the low-level core library that forms the basis for projects 
     23such as GTK+ and GNOME. It provides data structure handling for C, 
     24portability wrappers, and interfaces for such runtime functionality 
     25as an event loop, threads, dynamic loading, and an object system.', 
     26  'NEVR' => 'glib2-2.46.2-4.el7', 
     27  'NOPATCH' => '(none)', 
     28  'SOURCEPACKAGE' => '(none)', 
     29  'VERBOSE' => '(none)', 
     30  'REQUIRENEVRS' => '/bin/sh', 
     31  'TRIGGERSCRIPTFLAGS' => '(none)', 
     32  'VENDOR' => 'CentOS', 
     33  'DSAHEADER' => '(none)', 
     34  'PRETRANSPROG' => '(none)', 
     35  'PROVIDES' => 'glib2', 
     36  'EXCLUSIVEOS' => '(none)', 
     37  'NVRA' => 'glib2-2.46.2-4.el7.i686', 
     38  'URL' => 'http://www.gtk.org', 
     39  'DISTRIBUTION' => '(none)', 
     40  'OBSOLETENEVRS' => '(none)', 
     41  'O' => '(none)', 
     42  'SIGPGP' => '8902150305005831e31824c6a8a7f4a80eb50108452c0ff9011ff528bd335c28b6dab1b1b783cde246b3ca8df41216124a66c86bb13d864fb68fcaffaff69a7c0638c20445cef0d8712b66430ef959b823b7c48253b46e9646fc15bb07024abcd160df2c42be0a3aed81b79ebce4779eee5510148683e10ae0da26959abe5c0df821b18a64a9d0f0c87e4be02c7644999c4dc735aaf36f88e652b12fe786a2fc22e9e9ecee1156681d8ac6f5b088b9593ea5fd0c1c62e14b5b1863d019ab04ab6008ab736e9643bd45fcab373a407b669c4efd4973d36b59411146bf21f1b1caca15ea36616ee510e0a57e5ac412fbc5094637f9bdb3bdb07cf0a5a84a560aeed5b92e99ef796025fdfe25a1dd1ea58e24f7218d2b2a76286c4859feb02c6b1221055a3ba4f61dd997c9a240a7127439c5184f18432da6c9588e5166a665d10d78673067fe006411171eee32e28ff548c1500376b4851691925f0d5fa855c62312d71c8444077a397cfda03e4e026ba065fef29bf5922fc68522e4a394e1e851049b965c9d1a680df8c94c41b703667ff84db43e45a1508916d76ac45928d00fe60643366484d5215cb9e08c4737f0c9d27c3f812fecd72aef6195e07badeab549f1f57adcd860e3e3ea7006faa32d63b9dc65d46a06c0f9ce6d15541e612b76bc2d61d154c18700fe92be41e78dff5679f7cfb69fb430edf873dd8a7adf9e4214ff6d09d814314be641408c073d3a17da631463a8ea6522', 
     43  'PREINPROG' => '(none)', 
     44  'ENHANCENAME' => '(none)', 
     45  'INSTALLCOLOR' => '(none)', 
     46  'OLDENHANCESNAME' => '(none)', 
     47  'OBSOLETES' => '(none)', 
     48  'ARCH' => 'i686', 
     49  'RECOMMENDVERSION' => '(none)', 
     50  'OBSOLETEFLAGS:depflags' => '(none)', 
     51  'POSTUNPROG' => '/bin/sh', 
     52  'POLICYTYPES' => '(none)', 
     53  'RECOMMENDFLAGS' => '(none)', 
     54  'CLASSDICT' => 'ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=1171bf18928201e1c6ec8e190e64303762a1f4d9, stripped', 
     55  'CONFLICTS' => '(none)', 
     56  'NOSOURCE' => '(none)', 
     57  'EXCLUDEOS' => '(none)', 
     58  'FILEMTIMES' => '1478898094', 
     59  'DBINSTANCE' => '0', 
     60  'ORIGBASENAMES' => '(none)', 
     61  'ENHANCEVERSION' => '(none)', 
     62  'FILEFLAGS' => '0', 
     63  'FSCONTEXTS' => '(none)', 
     64  'PROVIDEVERSION' => '2.46.2-4.el7', 
     65  'FILEMD5S' => 'f64bee32e178161f3340ebd97e83193f9302ef5dc22a83608e3923bf450c847d', 
     66  'BASENAMES' => 'gapplication', 
     67  'POLICYTYPESINDEXES' => '(none)', 
     68  'PROVIDENEVRS' => 'glib2 = 2.46.2-4.el7', 
     69  'OS' => 'linux', 
     70  'POSTINPROG' => '/bin/sh', 
     71  'OLDSUGGESTSVERSION' => '(none)', 
     72  'INSTALLTID' => '(none)', 
     73  'PROVIDEFLAGS:depflags' => '=', 
     74  'PREUNFLAGS' => '(none)', 
     75  'OLDFILENAMES' => '(none)', 
     76  'BUILDARCHS' => '(none)', 
     77  'ORIGDIRNAMES' => '(none)', 
     78  'SUGGESTFLAGS' => '(none)', 
     79  'INSTFILENAMES' => '(none)', 
     80  'FILEUSERNAME' => 'root', 
     81  'CONFLICTNEVRS' => '(none)', 
     82  'PROVIDENAME' => 'glib2', 
     83  'LICENSE' => 'LGPLv2+', 
     84  'OLDSUGGESTS' => '(none)', 
     85  'RECOMMENDNAME' => '(none)', 
     86  'PATCHESVERSION' => '(none)', 
     87  'DISTTAG' => '(none)', 
     88  'FILEDIGESTS' => 'f64bee32e178161f3340ebd97e83193f9302ef5dc22a83608e3923bf450c847d', 
     89  'EXCLUSIVEARCH' => '(none)', 
     90  'V' => '2.46.2', 
     91  'OLDENHANCESVERSION' => '(none)', 
     92  'POSTTRANSFLAGS' => '(none)', 
     93  'SUPPLEMENTNEVRS' => '(none)', 
     94  'XPM' => '(none)', 
     95  'PREUN' => '(none)', 
     96  'ORDERFLAGS' => '(none)', 
     97  'ORIGFILENAMES' => '(none)', 
     98  'GIF' => '(none)', 
     99  'ORIGDIRINDEXES' => '(none)', 
     100  'SOURCERPM' => 'glib2-2.46.2-4.el7.src.rpm', 
     101  'OBSOLETEFLAGS' => '(none)', 
     102  'PRETRANSFLAGS' => '(none)', 
     103  'POSTUNFLAGS' => '(none)', 
     104  'ICON' => '(none)', 
     105  'PREINFLAGS' => '(none)', 
     106  'PREIN' => '(none)', 
     107  'DIRINDEXES' => '0', 
     108  'HEADERI18NTABLE' => 'C', 
     109  'POSTTRANS' => '(none)', 
     110  'BUILDTIME:date' => 'Fri Nov 11 23:01:44 2016', 
     111  'ORDERVERSION' => '(none)', 
     112  'SUPPLEMENTNAME' => '(none)', 
     113  'CHANGELOGTIME' => '1473854400', 
     114  'FILECAPS' => '(none)', 
     115  'RECOMMENDS' => '(none)', 
     116  'PAYLOADFORMAT' => 'cpio', 
     117  'RPMVERSION' => '4.11.3', 
     118  'SIZE' => '11147850', 
     119  'FILEINODES' => '1', 
     120  'SUPPLEMENTVERSION' => '(none)', 
     121  'N' => 'glib2', 
     122  'PROVIDEFLAGS' => '8', 
     123  'FILECOLORS' => '1', 
     124  'REMOVETID' => '(none)', 
     125  'INSTPREFIXES' => '(none)', 
     126  'PATCHESFLAGS' => '(none)', 
     127  'HDRID' => '60af3b40a992bea6f874a1ebde5a2abecfe729ab', 
     128  'OBSOLETEVERSION' => '(none)', 
     129  'EXCLUDEARCH' => '(none)', 
     130  'ENHANCEFLAGS' => '(none)', 
     131  'REQUIRENAME' => '/bin/sh', 
     132  'LONGSIGSIZE' => '2374912', 
     133  'C' => '(none)', 
     134  'TRIGGERINDEX' => '(none)', 
     135  'SOURCE' => '(none)', 
     136  'SUGGESTNAME' => '(none)', 
     137  'BUILDHOST' => 'c1bm.rdu2.centos.org', 
     138  'VERIFYSCRIPT' => '(none)', 
     139  'HEADERIMAGE' => '(none)', 
     140  'POSTTRANSPROG' => '(none)', 
     141  'SUPPLEMENTS' => '(none)', 
     142  'FILELINKTOS' => '', 
     143  'EVR' => '2.46.2-4.el7', 
     144  'SUPPLEMENTFLAGS' => '(none)', 
     145  'VCS' => '(none)', 
     146  'SIGSIZE' => '2374912', 
     147  'NAME' => 'glib2', 
     148  'SIGGPG' => '(none)', 
     149  'RECOMMENDNEVRS' => '(none)', 
     150  'NVR' => 'glib2-2.46.2-4.el7', 
     151  'TRIGGERCONDS' => '(none)', 
     152  'OLDENHANCES' => '(none)', 
     153  'VERIFYSCRIPTFLAGS' => '(none)', 
     154  'EPOCH' => '(none)', 
     155  'PLATFORM' => 'i686-redhat-linux-gnu', 
     156  'REQUIREFLAGS:depflags' => '', 
     157  'CONFLICTFLAGS' => '(none)', 
     158  'POLICYFLAGS' => '(none)', 
     159  'SOURCEPKGID' => '(none)', 
     160  'CHANGELOGNAME' => 'Kalev Lember <klember@redhat.com> - 2.46.2-4', 
     161  'BUGURL' => '(none)', 
     162  'POSTINFLAGS' => '(none)', 
     163  'RECONTEXTS' => '(none)', 
     164  'INSTALLTIME' => '(none)', 
     165  'HEADERCOLOR' => '1', 
     166  'PATCH' => '(none)', 
     167  'TRIGGERFLAGS' => '(none)', 
     168  'PAYLOADFLAGS' => '2', 
     169  'REQUIREVERSION' => '', 
     170  'DEPENDSDICT' => '1375731723', 
     171  'POLICIES' => '(none)', 
     172  'ORDERNAME' => '(none)', 
     173  '_INFO' => 'Name        : glib2 
     174Version     : 2.46.2 
     175Release     : 4.el7 
     176Architecture: i686 
     177Install Date: (not installed) 
     178Group       : System Environment/Libraries 
     179Size        : 11147850 
     180License     : LGPLv2+ 
     181Signature   : RSA/SHA256, Sun Nov 20 19:53:28 2016, Key ID 24c6a8a7f4a80eb5 
     182Source RPM  : glib2-2.46.2-4.el7.src.rpm 
     183Build Date  : Fri Nov 11 23:01:44 2016 
     184Build Host  : c1bm.rdu2.centos.org 
     185Relocations : (not relocatable) 
     186Packager    : CentOS BuildSystem <http://bugs.centos.org> 
     187Vendor      : CentOS 
     188URL         : http://www.gtk.org 
     189Summary     : A library of handy utility functions 
     190Description : 
     191GLib is the low-level core library that forms the basis for projects 
     192such as GTK+ and GNOME. It provides data structure handling for C, 
     193portability wrappers, and interfaces for such runtime functionality 
     194as an event loop, threads, dynamic loading, and an object system. 
     195', 
     196  'LONGARCHIVESIZE' => '11168196', 
     197  'OLDSUGGESTSFLAGS' => '(none)', 
     198  'RELEASE' => '4.el7', 
     199  'FILENLINKS' => '1', 
     200  'NEVRA' => 'glib2-2.46.2-4.el7.i686', 
     201  'POSTUN' => '/sbin/ldconfig 
     202[ ! -x /usr/bin/gio-querymodules-32 ] || \\ 
     203gio-querymodules-32 /usr/lib/gio/modules', 
     204  'BUILDTIME' => '1478898104', 
     205  'LONGFILESIZES' => '14936', 
     206  'OLDSUGGESTSNAME' => '(none)', 
     207  'POLICYNAMES' => '(none)', 
     208  'PREFIXES' => '(none)', 
     209  'TRIGGERSCRIPTS' => '(none)', 
     210  'PUBKEYS' => '(none)', 
     211  'SHA1HEADER' => '60af3b40a992bea6f874a1ebde5a2abecfe729ab', 
     212  'SUGGESTVERSION' => '(none)', 
     213  'E' => '(none)', 
     214  'COOKIE' => '(none)', 
     215  'FILEDIGESTALGO' => '8', 
     216  'PRETRANS' => '(none)', 
     217  'FILEGROUPNAME' => 'root', 
     218  'DIRNAMES' => '/usr/bin/', 
     219  'R' => '4.el7', 
     220  'CONFLICTVERSION' => '(none)', 
     221  'FILEMODES' => '33261', 
     222  'TRIGGERVERSION' => '(none)', 
     223  'HEADERREGIONS' => '(none)', 
     224  'SUGGESTS' => '(none)', 
     225  'OLDENHANCESFLAGS' => '(none)', 
     226  'TRIGGERSCRIPTPROG' => '(none)', 
     227  'FILEVERIFYFLAGS' => '4294967295', 
     228  'FILEDEPENDSN' => '15', 
     229  'FILEREQUIRE' => 'libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.4) libc.so.6(GLIBC_2.0) libgio-2.0.so.0 libgobject-2.0.so.0 libgmodule-2.0.so.0 libz.so.1 libselinux.so.1 libresolv.so.2 libffi.so.6 libdl.so.2 libglib-2.0.so.0 libpthread.so.0 libc.so.6 rtld(GNU_HASH)', 
     230  'FILERDEVS' => '0', 
     231  'PKGID' => 'd8300bd6ae89fd3d471b823d4da55e5e', 
     232  'FILEDEVICES' => '1', 
     233  'FILENAMES' => '/usr/bin/gapplication', 
     234  'ENHANCES' => '(none)', 
     235  'EPOCHNUM' => '0', 
     236  'VERIFYSCRIPTPROG' => '(none)', 
     237  'PREUNPROG' => '(none)', 
     238  'CONFLICTNAME' => '(none)', 
     239  'FILESIZES' => '14936', 
     240  'FILEPROVIDE' => '', 
     241  'ARCHIVESIZE' => '11168196', 
     242  'RSAHEADER' => '8902150305005831e31824c6a8a7f4a80eb50108cdf90ffc09656e816376ef5f32f146d136999f958f3e1338f21e0cac90bac97795d92c29301478a97f8b72afee0505896fa7c31195612542ba972da405323e3ec910ecc45350459220f39f2437a9ccbc3f9052b3d042d0e4a6d687f9be827b9c766d7fc680b2d99aebafe5134a54e64f0452be09b5592360d940ed3f3f3b14de7b0b124f510cfbdbd118e1638ee280edcbf6a9f916925f1b0bda0980935aedab1f9bfc342dceae437fa14736cdff2fe330ad37ab2719f6a3de84aaf3982a575a6f4980bc8a8e10a7ba51f53ed967a6c99638565147bbb0b2427c176ffbb8be5774b45f79388ff1407e6976608c3592784b971b791f0eca73a8a2ddafa70f656e3e565c9523aa1f4e78a56acdf39a91ebd90a481c0f02186f4bca965ecf889d075a87922830ed2c701d39ce627c362b222ed153c07b532a875744e1c54e9245c1044cf93520b208384d15413aba6b3425c457781862efd215a24c0c37c32c3ab29af785adfe418d5e86af53662163a9fed16dbac3ff4704120af67e0eb584a4f8766e510e6366eb5fcce0938253962b03972eca392e61f0f979f0dd7a554273d5ca463933033d67be82c7b31bcc2ef5c477907d3734aa596aefb7988a259d48d160413590243b56850eeab96ffa76d06b86faa0b6c9fd6fe43e902669444284e1947aa652673eb58214db9d19d0447de5bd036a45e9746ab4039f4dab7c73481a1bfb5a4d', 
     243  'FILESTATES' => '(none)', 
     244  'PACKAGER' => 'CentOS BuildSystem <http://bugs.centos.org>', 
     245  'SUMMARY' => 'A library of handy utility functions', 
     246  'OPTFLAGS' => '-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m32 -march=x86-64 -mtune=generic -mfpmath=sse -fasynchronous-unwind-tables', 
     247  'OBSOLETENAME' => '(none)', 
     248  'REQUIRES' => '/bin/sh', 
     249  'FILECLASS' => 'ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=1171bf18928201e1c6ec8e190e64303762a1f4d9, stripped', 
     250  'PAYLOADCOMPRESSOR' => 'xz', 
     251  'HEADERSIGNATURES' => '(none)', 
     252  'PATCHESNAME' => '(none)', 
     253  'CHANGELOGTIME:date' => 'Wed Sep 14 15:00:00 2016', 
     254  'ENHANCENEVRS' => '(none)', 
     255  'SIGMD5' => 'd8300bd6ae89fd3d471b823d4da55e5e', 
     256  'FILEDEPENDSX' => '0', 
     257  'DISTURL' => '(none)', 
     258  'REQUIREFLAGS' => '1280', 
     259  'TRIGGERNAME' => '(none)', 
     260  'LONGSIZE' => '11147850', 
     261  'SUGGESTNEVRS' => '(none)' 
     262} 
     263; 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.output

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.output b/tests/src/vfs/extfs/helpers-list/data/rpm.output
    new file mode 100644
    index 0000000..c618cca
    - +  
     1-r--r--r--   1        0        0        868 2016-11-11 00:00:00 HEADER 
     2-r-xr-xr-x   1        0        0         39 2016-11-11 00:00:00 INSTALL 
     3-r-xr-xr-x   1        0        0         39 2016-11-11 00:00:00 UPGRADE 
     4dr-xr-xr-x   3        0        0          0 2016-11-11 00:00:00 INFO 
     5-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/NAME-VERSION-RELEASE 
     6-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/GROUP 
     7-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/BUILDHOST 
     8-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SOURCERPM 
     9-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/BUILDTIME 
     10-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/RPMVERSION 
     11-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/OS 
     12-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SIZE 
     13-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/VENDOR 
     14-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/DESCRIPTION 
     15-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SUMMARY 
     16-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SCRIPTS/POSTIN 
     17-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SCRIPTS/POSTUN 
     18-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SCRIPTS/ALL 
     19-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SCRIPTS/POSTINPROG 
     20-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/SCRIPTS/POSTUNPROG 
     21-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/PACKAGER 
     22-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/URL 
     23-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/LICENSE 
     24-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/REQUIRES 
     25-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/PROVIDES 
     26-r--r--r--   1        0        0          0 2016-11-11 00:00:00 INFO/CHANGELOG 
     27-r--r--r--   1        0        0          0 2016-11-11 00:00:00 CONTENTS.cpio 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.rewrite.sh

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.rewrite.sh b/tests/src/vfs/extfs/helpers-list/data/rpm.rewrite.sh
    new file mode 100644
    index 0000000..a6c4932
    - +  
     1# 
     2# This file gets source'd into our rpm helper. 
     3# 
     4# It imitates the 'rpm' program by overriding a few functions. 
     5# 
     6 
     7# The tags file. 
     8TAGSF="$MC_TEST_INPUT" 
     9 
     10# ---------------------------------------------------------------------------- 
     11 
     12# 
     13# Overrides helper's. 
     14# 
     15# Imitates 'rpm --querytags'. 
     16# 
     17# @Mock 
     18# 
     19mcrpmfs_getSupportedTags() 
     20{ 
     21  perl -e ' 
     22    $tagsf = $ARGV[0]; 
     23 
     24    do $tagsf or die("$tagsf: $!"); 
     25    print join("\n", keys %$tags); 
     26  ' \ 
     27  "$TAGSF" 
     28} 
     29 
     30# ---------------------------------------------------------------------------- 
     31 
     32# 
     33# Imitates 'rpm -qp --qf <TEMPLATE> <PACKAGE_FILE>'. 
     34# 
     35# (It ignores <PACKAGE_FILE>, using our input instead.) 
     36# 
     37# E.g.: given "Name: %{NAME} Ver: %{VERSION}", 
     38# prints "Name: php-pear-Twig Ver: 1.0.0". 
     39# 
     40rpm_qf() 
     41{ 
     42  perl -w -e ' 
     43    $tagsf = $ARGV[0]; 
     44    $tmplt = $ARGV[1]; 
     45 
     46    do $tagsf or die("$tagsf: $!"); 
     47    $tmplt =~ s/\\n/\n/g; 
     48    $tmplt =~ s/%\{(.*?)\}/ 
     49      (my $tag = $1) =~ s,^RPMTAG_,,;  # Tag names may be specified with or without this prefix. 
     50      exists $tags->{$tag} ? $tags->{$tag} : "(none)" 
     51    /eg; 
     52    print $tmplt; 
     53  ' \ 
     54  "$TAGSF" "$1" 
     55} 
     56RPM_QUERY_FMT=rpm_qf  # Tell the helper to use it instead of the 'rpm' binary. 
     57 
     58# ---------------------------------------------------------------------------- 
     59 
     60# 
     61# Overrides helper's. 
     62# 
     63# @Mock 
     64# 
     65mcrpmfs_getDesription() 
     66{ 
     67  rpm_qf "%{_INFO}" 
     68} 
     69 
     70# ----------------------------------------------------------------------------