summaryrefslogtreecommitdiffstats
path: root/t/superuser--rpm.t
diff options
context:
space:
mode:
Diffstat (limited to 't/superuser--rpm.t')
-rw-r--r--t/superuser--rpm.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/superuser--rpm.t b/t/superuser--rpm.t
new file mode 100644
index 00000000..4930d30d
--- /dev/null
+++ b/t/superuser--rpm.t
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use lib '.', 't';
+use helper;
+use Test::More 'no_plan';
+
+my $name = 'rpm-query-in-scriptlet';
+
+need_root_and_prepare();
+test_rpm_query_in_scriptlet();
+
+sub test_rpm_query_in_scriptlet {
+ system_("rpm --root $::pwd/root -i media/$name/$name*.rpm --nodeps");
+ check_installed_names($name);
+ rebuilddb();
+ check_installed_names($name);
+}
+
+sub rebuilddb {
+ # testing rebuilddb (could be done elsewhere, but here is
+ system_("rpm --root $::pwd/root --rebuilddb");
+ my ($dir) = glob("$::pwd/root/var/lib/rpmrebuilddb*");
+ is($dir, undef, "$dir should not be there");
+}