summaryrefslogtreecommitdiffstats
path: root/t/superuser--buggy-rpms.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
commit4df7583caa71a35d6d68c373fc0c62d1be6d955b (patch)
treebddf36169b314d82ff20036dea7e47fa4fec5bcd /t/superuser--buggy-rpms.t
parent7a606ec3537b2f465f8e06e99b445c756bfcca8f (diff)
downloadurpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.gz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.bz2
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.xz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.zip
re-sync after the big svn loss
Diffstat (limited to 't/superuser--buggy-rpms.t')
-rw-r--r--t/superuser--buggy-rpms.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/superuser--buggy-rpms.t b/t/superuser--buggy-rpms.t
new file mode 100644
index 00000000..34bacbdd
--- /dev/null
+++ b/t/superuser--buggy-rpms.t
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+use lib '.', 't';
+use helper;
+use Test::More 'no_plan';
+BEGIN { use_ok "URPM" }
+
+need_root_and_prepare();
+
+#- things are going to be noisy, and that's normal
+open STDERR, '>/dev/null';
+
+my @pkgs = map { "data/rpm-buggy/$_" } 'invalid-signature.rpm', 'not-a-rpm.rpm', 'weird-header.rpm';
+foreach (@pkgs) {
+ system("rpm -K $_");
+ is($?, 1 << 8, "rpm -K $_");
+
+ system(urpmi_cmd() . " $_");
+ is($?, 2 << 8, "urpmi $_");
+
+ my $verif = URPM::verify_signature($_);
+ ok($verif =~ /NOT OK/);
+}