From 37b66b6b34d29c9e628c4a0bbf5babdb5e1340fe Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 30 Nov 2006 13:28:03 +0000 Subject: using --urpmi-root, create some tests using urpmi.addmedia, urpmi, urpme one drawback of the superuser--*.t is the need to be root (the rpmlib needs it to install in a root partition), so for now "make test" tests *.t but superuser--*.t are skipped. Then as root, run "sudo make test TEST_FILES='t/superuser--*.t'" --- t/02create_pkgs.t | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 t/02create_pkgs.t (limited to 't/02create_pkgs.t') diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t new file mode 100644 index 00000000..8a716226 --- /dev/null +++ b/t/02create_pkgs.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Test::More 'no_plan'; + +chdir 't' if -d 't'; +system('rm -rf BUILD RPMS media'); +for (qw(media BUILD RPMS RPMS/noarch)) { + mkdir $_; +} +# locally build a test rpms +foreach my $spec (glob("SPECS/*.spec")) { + system_("rpmbuild --quiet --define '_topdir .' -bb --clean $spec"); + my ($name) = $spec =~ m!([^/]*)\.spec$!; + mkdir "media/$name"; + system_("mv RPMS/*/*.rpm media/$name"); +} + +sub system_ { + my ($cmd) = @_; + system($cmd); + ok($? == 0, $cmd); +} -- cgit v1.2.1