summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/superuser--srpm-bootstrapping.t28
1 files changed, 26 insertions, 2 deletions
diff --git a/t/superuser--srpm-bootstrapping.t b/t/superuser--srpm-bootstrapping.t
index e0182ec0..a6c21a26 100644
--- a/t/superuser--srpm-bootstrapping.t
+++ b/t/superuser--srpm-bootstrapping.t
@@ -10,5 +10,29 @@ need_root_and_prepare();
my $name = 'srpm-bootstrapping';
urpmi_addmedia("$name $::pwd/media/$name");
-urpmi("--auto media/SRPMS-$name/$name-*.src.rpm");
-is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
+test("media/SRPMS-$name/$name-*.src.rpm");
+
+urpmi_addmedia("$name-src $::pwd/media/SRPMS-$name");
+test("--src $name");
+
+sub test {
+ my ($para) = @_;
+
+ urpmi("--auto $para");
+ check_installed_names($name); # check the buildrequires is installed
+
+ install_src_rpm($para);
+ check_installed_and_remove($name);
+}
+
+sub install_src_rpm {
+ my ($para) = @_;
+
+ system_('mkdir -p root/usr/src/rpm/SOURCES');
+
+ $ENV{HOME} = '/';
+ urpmi("--install-src $para");
+
+ system_("cmp root/usr/src/rpm/SPECS/$name.spec data/SPECS/$name.spec");
+ system_('rm -rf root/usr/src/rpm');
+}