From ed654fa31d41be62b134c5300b577b121ce6344f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 6 Dec 2006 11:00:06 +0000 Subject: also test urpmi works with that configuration --- t/superuser--addmedia.t | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 't/superuser--addmedia.t') diff --git a/t/superuser--addmedia.t b/t/superuser--addmedia.t index d8e31ad3..2a2f1dfe 100644 --- a/t/superuser--addmedia.t +++ b/t/superuser--addmedia.t @@ -10,9 +10,22 @@ need_root_and_prepare(); my $name = 'various'; -try('', { hdlist => undef, synthesis => undef }); -try('--probe-hdlist', { hdlist => "hdlist.$name.cz", synthesis => undef }); -try('--probe-synthesis', { hdlist => undef, synthesis => 1 }); +my @fields = qw(hdlist synthesis with_hdlist media_info_dir); +try('', { media_info_dir => 'media_info' }); + +try('--probe-hdlist', + { hdlist => "hdlist.$name.cz", media_info_dir => 'media_info' }); +try('with media_info/hdlist.cz', + { hdlist => "hdlist.$name.cz", media_info_dir => 'media_info' }); +try("with ../media_info/hdlist_$name.cz", + { hdlist => "hdlist.$name.cz", with_hdlist => "../media_info/hdlist_$name.cz" }); + +try('--probe-synthesis', + { synthesis => 1, media_info_dir => 'media_info' }); +try('with media_info/synthesis.hdlist.cz', + { synthesis => 1, media_info_dir => 'media_info' }); +try("with ../media_info/synthesis.hdlist_$name.cz", + { synthesis => 1, with_hdlist => "../media_info/synthesis.hdlist_$name.cz" }); sub try { my ($options, $want) = @_; @@ -20,8 +33,11 @@ sub try { my $config = urpm::cfg::load_config("root/etc/urpmi/urpmi.cfg"); my ($medium) = @{$config->{media}}; ok($medium); - foreach my $field (keys %$want) { - is($medium->{$field}, $want->{$field}); + foreach my $field (@fields) { + is($medium->{$field}, $want->{$field}, $field); } + urpmi($name); + is(`rpm -qa --root $::pwd/root`, "$name-1-1\n"); + urpme($name); urpmi_removemedia($name); } -- cgit v1.2.1