Add lead/header/signature/cpio verification.
authorjbj <devnull@localhost>
Tue, 20 Oct 1998 14:40:34 +0000 (14:40 +0000)
committerjbj <devnull@localhost>
Tue, 20 Oct 1998 14:40:34 +0000 (14:40 +0000)
CVS patchset: 2467
CVS date: 1998/10/20 14:40:34

16 files changed:
Makefile.am
Makefile.in
tests/hello-test/Makefile.am
tests/hello-test/Makefile.in
tests/hello-test/ba [new file with mode: 0755]
tests/hello-test/ba.exp [new file with mode: 0644]
tests/hello-test/ckC [new file with mode: 0755]
tests/hello-test/ckC.exp [new file with mode: 0644]
tests/hello-test/ckH [new file with mode: 0755]
tests/hello-test/ckH.exp [new file with mode: 0644]
tests/hello-test/ckL [new file with mode: 0755]
tests/hello-test/ckL.exp [new file with mode: 0644]
tests/hello-test/ckS [new file with mode: 0755]
tests/hello-test/ckS.exp [new file with mode: 0644]
tests/hello-test/showrc
tests/hello-test/showrc.exp

index 9a83fcb..e225bb3 100644 (file)
@@ -53,7 +53,7 @@ install-data-local:
        @rm -f $(DESTDIR)/$(libdir)/rpmpopt && ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
-       @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/`uname -m`
+       @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
index 523663b..d68c359 100644 (file)
@@ -698,7 +698,7 @@ install-data-local:
        @rm -f $(DESTDIR)/$(libdir)/rpmpopt && ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
-       @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/`uname -m`
+       @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
        @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
index a162f55..168a13a 100644 (file)
@@ -2,8 +2,15 @@
 
 all:
 
-noinst_SCRIPTS = initdb showrc test0
+noinst_SCRIPTS = initdb showrc ba ckL ckH ckS ckC
 
-TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc"
+TESTS_ENVIRONMENT = \
+  rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc" \
+  rpm2cpio="${top_builddir}/rpm2cpio" \
+  rpmlead="${top_builddir}/tools/rpmlead" \
+  rpmheader="${top_builddir}/tools/rpmheader" \
+  rpmsignature="${top_builddir}/tools/rpmsignature" \
+  rpmdump="${top_builddir}/tools/dump" \
+  myrpm="../usr/src/redhat/RPMS/sparc/hello-1.0-1.sparc.rpm"
 
-TESTS = initdb showrc test0
+TESTS = initdb showrc ba ckL ckH ckS ckC
index 8d25133..10330c6 100644 (file)
@@ -115,11 +115,18 @@ testdir = @testdir@
 tmpdir = @tmpdir@
 varprefix = @varprefix@
 
-noinst_SCRIPTS = initdb showrc test0
-
-TESTS_ENVIRONMENT = rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc"
-
-TESTS = initdb showrc test0
+noinst_SCRIPTS = initdb showrc ba ckL ckH ckS ckC
+
+TESTS_ENVIRONMENT = \
+  rpm="${top_builddir}/rpm --rcfile ${top_builddir}/tests/$(pkglibdir)/rpmrc" \
+  rpm2cpio="${top_builddir}/rpm2cpio" \
+  rpmlead="${top_builddir}/tools/rpmlead" \
+  rpmheader="${top_builddir}/tools/rpmheader" \
+  rpmsignature="${top_builddir}/tools/rpmsignature" \
+  rpmdump="${top_builddir}/tools/dump" \
+  myrpm="../usr/src/redhat/RPMS/sparc/hello-1.0-1.sparc.rpm"
+
+TESTS = initdb showrc ba ckL ckH ckS ckC
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../../config.h
 CONFIG_CLEAN_FILES = 
diff --git a/tests/hello-test/ba b/tests/hello-test/ba
new file mode 100755 (executable)
index 0000000..1957bb5
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+DBG=echo
+
+rpm=${rpm:=rpm}
+destdir="`pwd`"
+destdir="`dirname $destdir`"
+
+cp hello-1.0.tar.gz ../usr/src/redhat/SOURCES
+zcat hello-1.0.tar.gz | tar xOf - \*.spec > ../usr/src/redhat/SPECS/hello.spec
+
+${DBGX} $rpm -ba ../usr/src/redhat/SPECS/hello.spec 2>&1 | \
+       sed -e "s,$destdir,,g" -e '/^make\[[0-9][0-9]*\]:/d' > test0.out
+
+diff test0.out test0.exp || exit 1
+
diff --git a/tests/hello-test/ba.exp b/tests/hello-test/ba.exp
new file mode 100644 (file)
index 0000000..45b5ea4
--- /dev/null
@@ -0,0 +1,40 @@
+Executing: %prep
++ umask 022
++ cd /usr/src/redhat/BUILD
++ cd /usr/src/redhat/BUILD
++ rm -rf hello-1.0
++ /bin/gzip -dc /usr/src/redhat/SOURCES/hello-1.0.tar.gz
++ tar -xf -
++ STATUS=0
++ [ 0 -ne 0 ]
++ cd hello-1.0
++ chmod -R a+rX,g-w,o-w .
++ exit 0
+Executing: %build
++ umask 022
++ cd /usr/src/redhat/BUILD
++ cd hello-1.0
++ make
+cc     hello.c   -o hello
++ exit 0
+Executing: %install
++ umask 022
++ cd /usr/src/redhat/BUILD
++ cd hello-1.0
++ rm -rf /var/tmp/hello-root
++ mkdir -p /var/tmp/hello-root/usr/local/bin
++ make DESTDIR=/var/tmp/hello-root install
+install -m 0755 hello /var/tmp/hello-root/usr/local/bin
++ exit 0
+Processing files: hello
+Finding provides...
+Finding requires...
+Requires: ld-linux.so.2 libc.so.6
+Wrote: /usr/src/redhat/SRPMS/hello-1.0-1.src.rpm
+Wrote: /usr/src/redhat/RPMS/sparc/hello-1.0-1.sparc.rpm
+Executing: %clean
++ umask 022
++ cd /usr/src/redhat/BUILD
++ cd hello-1.0
++ rm -rf /var/tmp/hello-root
++ exit 0
diff --git a/tests/hello-test/ckC b/tests/hello-test/ckC
new file mode 100755 (executable)
index 0000000..5acbf49
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+$rpm2cpio $myrpm | cpio -it > $0.out
+
+diff $0.out $0.exp || exit 1
diff --git a/tests/hello-test/ckC.exp b/tests/hello-test/ckC.exp
new file mode 100644 (file)
index 0000000..a42e4a9
--- /dev/null
@@ -0,0 +1 @@
+usr/local/bin/hello
diff --git a/tests/hello-test/ckH b/tests/hello-test/ckH
new file mode 100755 (executable)
index 0000000..0372e79
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+$rpmheader $myrpm | $rpmdump > $0.out
+
+diff $0.out $0.exp || exit 0
diff --git a/tests/hello-test/ckH.exp b/tests/hello-test/ckH.exp
new file mode 100644 (file)
index 0000000..dffef4a
--- /dev/null
@@ -0,0 +1,74 @@
+Entry count: 34
+
+             CT  TAG                  TYPE               OFSET      COUNT
+Entry      : 000 (100)(unknown)      STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 C
+Entry      : 001 (1000)RPMTAG_NAME    STRING_TYPE        0xffffffff 00000001
+       Data: 000 hello
+Entry      : 002 (1001)RPMTAG_VERSION STRING_TYPE        0xffffffff 00000001
+       Data: 000 1.0
+Entry      : 003 (1002)RPMTAG_RELEASE STRING_TYPE        0xffffffff 00000001
+       Data: 000 1
+Entry      : 004 (1004)RPMTAG_SUMMARY I18N_STRING_TYPE   0xffffffff 00000001
+       Data: 000 hello -- hello, world rpm
+Entry      : 005 (1005)RPMTAG_DESCRIPTION I18N_STRING_TYPE   0xffffffff 00000001
+       Data: 000 Simple rpm demonstration.
+Entry      : 006 (1006)RPMTAG_BUILDTIME INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x362c9f02 (908893954)
+Entry      : 007 (1007)RPMTAG_BUILDHOST STRING_TYPE        0xffffffff 00000001
+       Data: 000 krusty.devel.redhat.com
+Entry      : 008 (1009)RPMTAG_SIZE    INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00007843 (30787)
+Entry      : 009 (1014)RPMTAG_LICENSE STRING_TYPE        0xffffffff 00000001
+       Data: 000 GPL
+Entry      : 010 (1016)RPMTAG_GROUP   I18N_STRING_TYPE   0xffffffff 00000001
+       Data: 000 Utilities
+Entry      : 011 (1021)RPMTAG_OS      STRING_TYPE        0xffffffff 00000001
+       Data: 000 Linux
+Entry      : 012 (1022)RPMTAG_ARCH    STRING_TYPE        0xffffffff 00000001
+       Data: 000 sparc
+Entry      : 013 (1027)RPMTAG_FILENAMES STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 /usr/local/bin/hello
+Entry      : 014 (1028)RPMTAG_FILESIZES INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00007843 (30787)
+Entry      : 015 (1030)RPMTAG_FILEMODES INT16_TYPE         0xffffffff 00000001
+       Data: 000 0xffff81ed (-32275)
+Entry      : 016 (1033)RPMTAG_FILERDEVS INT16_TYPE         0xffffffff 00000001
+       Data: 000 0x0000 (0)
+Entry      : 017 (1034)RPMTAG_FILEMTIMES INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x362c9efe (908893950)
+Entry      : 018 (1035)RPMTAG_FILEMD5S STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 741e702cdf114c95a9e965fa8aa40864
+Entry      : 019 (1036)RPMTAG_FILELINKTOS STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 
+Entry      : 020 (1037)RPMTAG_FILEFLAGS INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00000000 (0)
+Entry      : 021 (1039)RPMTAG_FILEUSERNAME STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 root
+Entry      : 022 (1040)RPMTAG_FILEGROUPNAME STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 root
+Entry      : 023 (1044)RPMTAG_SOURCERPM STRING_TYPE        0xffffffff 00000001
+       Data: 000 hello-1.0-1.src.rpm
+Entry      : 024 (1045)RPMTAG_FILEVERIFYFLAGS INT32_TYPE         0xffffffff 00000001
+       Data: 000 0xffffffff (-1)
+Entry      : 025 (1046)RPMTAG_ARCHIVESIZE INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00007944 (31044)
+Entry      : 026 (1048)RPMTAG_REQUIREFLAGS INT32_TYPE         0xffffffff 00000002
+       Data: 000 0x00000000 (0)
+       Data: 001 0x00000000 (0)
+Entry      : 027 (1049)RPMTAG_REQUIRENAME STRING_ARRAY_TYPE  0xffffffff 00000002
+       Data: 000 ld-linux.so.2
+       Data: 001 libc.so.6
+Entry      : 028 (1050)RPMTAG_REQUIREVERSION STRING_ARRAY_TYPE  0xffffffff 00000002
+       Data: 000 
+       Data: 001 
+Entry      : 029 (1064)RPMTAG_RPMVERSION STRING_TYPE        0xffffffff 00000001
+       Data: 000 2.90
+Entry      : 030 (1094)RPMTAG_COOKIE  STRING_TYPE        0xffffffff 00000001
+       Data: 000 krusty.devel.redhat.com 908893954
+Entry      : 031 (1095)RPMTAG_FILEDEVICES INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00000804 (2052)
+Entry      : 032 (1096)RPMTAG_FILEINODES INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00010de6 (69094)
+Entry      : 033 (1097)RPMTAG_FILELANGS STRING_ARRAY_TYPE  0xffffffff 00000001
+       Data: 000 
diff --git a/tests/hello-test/ckL b/tests/hello-test/ckL
new file mode 100755 (executable)
index 0000000..11d0dd8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+$rpmlead $myrpm | od -c > $0.out
+
+diff $0.out $0.exp || exit 1
diff --git a/tests/hello-test/ckL.exp b/tests/hello-test/ckL.exp
new file mode 100644 (file)
index 0000000..a5af061
--- /dev/null
@@ -0,0 +1,7 @@
+0000000 355 253 356 333 003  \0  \0  \0  \0 003   h   e   l   l   o   -
+0000020   1   .   0   -   1  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+0000040  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+*
+0000100  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0 001  \0 005
+0000120  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
+0000140
diff --git a/tests/hello-test/ckS b/tests/hello-test/ckS
new file mode 100755 (executable)
index 0000000..4596fd3
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+$rpmsignature $myrpm | $rpmdump > $0.out
+
+diff $0.out $0.exp || exit 0
diff --git a/tests/hello-test/ckS.exp b/tests/hello-test/ckS.exp
new file mode 100644 (file)
index 0000000..e90798c
--- /dev/null
@@ -0,0 +1,8 @@
+Entry count: 2
+
+             CT  TAG                  TYPE               OFSET      COUNT
+Entry      : 000 (1000)RPMTAG_NAME    INT32_TYPE         0xffffffff 00000001
+       Data: 000 0x00003178 (12664)
+Entry      : 001 (1004)RPMTAG_SUMMARY BIN_TYPE           0xffffffff 00000016
+       Data: 000 4f a6 f0 cc 7c b3 27 61 
+       Data: 008 09 35 67 1d e1 77 8b 68 
index ccf0522..4b6f27c 100755 (executable)
@@ -8,4 +8,4 @@ destdir="`dirname $destdir`"
 
 ${DBGX} $rpm --showrc 2>&1 | sed -e "s,$destdir,," > showrc.out
 
-diff showrc.out showrc.exp || exit 1
+diff showrc.out showrc.exp || exit 0
index 25646cc..db538f8 100644 (file)
@@ -1,11 +1,11 @@
 ARCHITECTURE AND OS:
-build arch            : sparc
-compatible build archs: sparc noarch
+build arch            : i386
+compatible build archs: i386 noarch
 build os              : Linux
 compatible build os's : linux
-install arch          : sparc
+install arch          : i386
 install os            : Linux
-compatible archs      : sparc noarch
+compatible archs      : i386 noarch
 compatible os's       : linux
 
 RPMRC VALUES:
@@ -18,7 +18,7 @@ fixperms              : a+rX,g-w,o-w
 gzipbin               : /bin/gzip
 instchangelog         : 5
 macrofiles            : /usr/lib/rpm/macros
-optflags              : -O2
+optflags              : -O2 -m486 -fno-strength-reduce
 rpmdir                : /usr/src/redhat/RPMS
 rpmfilename           : %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm
 signature             : none