diff options
Diffstat (limited to 't/superuser--buggy-rpms.t')
-rw-r--r-- | t/superuser--buggy-rpms.t | 24 |
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/); +} |