summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-10 12:41:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-10 12:41:21 +0000
commite86b036f8f31495d41041510999f7ece130f9cc9 (patch)
tree5c65e239758f6f6ce33b3f18b0bdb7a03ee8d342 /regress
parent20a5ad21a165c521787d37a793783e6f12101c59 (diff)
more signatures checks
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/pkg_add/Makefile11
-rwxr-xr-xregress/usr.sbin/pkg_add/check-sig13
-rw-r--r--regress/usr.sbin/pkg_add/signatures.ref6
3 files changed, 22 insertions, 8 deletions
diff --git a/regress/usr.sbin/pkg_add/Makefile b/regress/usr.sbin/pkg_add/Makefile
index 490750b6322..4e1df260a8d 100644
--- a/regress/usr.sbin/pkg_add/Makefile
+++ b/regress/usr.sbin/pkg_add/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.31 2010/01/10 11:49:56 espie Exp $
+# $OpenBSD: Makefile,v 1.32 2010/01/10 12:41:20 espie Exp $
REGRESS_TARGETS=pkgnames signatures depends-check longnames update-check1 \
collision-check3 partial-update-test conflict-update \
@@ -22,8 +22,11 @@ DEST$i ?= ${D$i}/usr/local
pkgnames:
perl ${.CURDIR}/check-name
-signatures:
- perl ${.CURDIR}/check-sig
+signatures.out:
+ perl ${.CURDIR}/check-sig 2>signatures.out
+
+signatures: signatures.out
+ diff -u signatures.out ${.CURDIR}/signatures.ref
depends-check: rep0/a-0.tgz rep0/b-0.tgz rep1/a-1.tgz rep1/b-1.tgz
@-rm -rf ${D1}
@@ -357,6 +360,6 @@ rep0/tk-8.5.7.tgz:
collision-check1 collision-check2 collision-check4 collision-check5
clean:
- -rm -rf rep* dest* plist* src*
+ -rm -rf rep* dest* plist* src* signatures.out
.include <bsd.regress.mk>
diff --git a/regress/usr.sbin/pkg_add/check-sig b/regress/usr.sbin/pkg_add/check-sig
index 99a273efc7b..56059214f90 100755
--- a/regress/usr.sbin/pkg_add/check-sig
+++ b/regress/usr.sbin/pkg_add/check-sig
@@ -1,9 +1,9 @@
#! /usr/bin/perl
-# $OpenBSD: check-sig,v 1.1 2010/01/10 11:49:56 espie Exp $
+# $OpenBSD: check-sig,v 1.2 2010/01/10 12:41:20 espie Exp $
# Written by Marc Espie
# Public domain
-use Test::Simple tests => 9;
+use Test::Simple tests => 11;
use OpenBSD::PackingList;
sub mycode
{
@@ -17,7 +17,7 @@ sub mycode
my @sig;
my $fh = \*DATA;
-for my $i (1..6) {
+for my $i (1..7) {
push(@sig, OpenBSD::PackingList->read($fh, \&mycode)->signature);
}
@@ -30,6 +30,8 @@ ok($sig[0]->compare($sig[2]) < 0, "pkgname");
ok($sig[1]->compare($sig[0]) > 0, "other way");
ok($sig[3]->compare($sig[4]) < 0, "lib");
ok($sig[3]->compare($sig[5]) < 0, "depend");
+ok(!defined($sig[0]->compare($sig[6])), "non comparable");
+ok(!defined($sig[6]->compare($sig[0])), "non comparable");
__DATA__
@name foo-1.0
@@ -55,4 +57,7 @@ __END__ #5
@name bar-1.0
@depend test/x:x-*:x-2.0
@wantlib a.1.5
-__END__
+__END__ #6
+@name foo-1.0
+@depend test/x:x-*:x-1.0
+@depend test/y:y-*:y-2.0
diff --git a/regress/usr.sbin/pkg_add/signatures.ref b/regress/usr.sbin/pkg_add/signatures.ref
new file mode 100644
index 00000000000..a922fc2906a
--- /dev/null
+++ b/regress/usr.sbin/pkg_add/signatures.ref
@@ -0,0 +1,6 @@
+Error: foo-1.0 exists in two non-comparable versions
+Someone forgot to bump a PKGNAME
+foo-1.0,x-1.0 vs. foo-1.0,x-1.0,y-2.0
+Error: foo-1.0 exists in two non-comparable versions
+Someone forgot to bump a PKGNAME
+foo-1.0,x-1.0,y-2.0 vs. foo-1.0,x-1.0