diff options
-rw-r--r-- | t/superuser--addmedia.t | 26 |
1 files changed, 21 insertions, 5 deletions
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); } |