diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-12-07 08:14:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-12-07 08:14:22 +0000 |
commit | 059814e5e53d724994ffdbd277b3d04add254e7f (patch) | |
tree | d69fda79012adc3f1a1392cfad782a5632fc3432 | |
parent | c30bf0d1e28c3fc75b43d37cc59138ff81c73344 (diff) | |
download | urpmi-059814e5e53d724994ffdbd277b3d04add254e7f.tar urpmi-059814e5e53d724994ffdbd277b3d04add254e7f.tar.gz urpmi-059814e5e53d724994ffdbd277b3d04add254e7f.tar.bz2 urpmi-059814e5e53d724994ffdbd277b3d04add254e7f.tar.xz urpmi-059814e5e53d724994ffdbd277b3d04add254e7f.zip |
prepare next commit
-rw-r--r-- | t/superuser--addmedia.t | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/t/superuser--addmedia.t b/t/superuser--addmedia.t index 2a2f1dfe..6080063b 100644 --- a/t/superuser--addmedia.t +++ b/t/superuser--addmedia.t @@ -10,26 +10,36 @@ need_root_and_prepare(); my $name = 'various'; -my @fields = qw(hdlist synthesis with_hdlist media_info_dir); -try('', { media_info_dir => 'media_info' }); +my @fields = qw(hdlist synthesis with_hdlist media_info_dir virtual); -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_medium('', { media_info_dir => 'media_info' }); -try('--probe-synthesis', +try_medium('--probe-hdlist', + { hdlist => 1, media_info_dir => 'media_info' }); +try_medium('with media_info/hdlist.cz', + { hdlist => 1, media_info_dir => 'media_info' }); +try_medium("with ../media_info/hdlist_$name.cz", + { hdlist => 1, with_hdlist => "../media_info/hdlist_$name.cz" }); + +try_medium('--probe-synthesis', { synthesis => 1, media_info_dir => 'media_info' }); -try('with media_info/synthesis.hdlist.cz', +try_medium('with media_info/synthesis.hdlist.cz', { synthesis => 1, media_info_dir => 'media_info' }); -try("with ../media_info/synthesis.hdlist_$name.cz", +try_medium("with ../media_info/synthesis.hdlist_$name.cz", { synthesis => 1, with_hdlist => "../media_info/synthesis.hdlist_$name.cz" }); -sub try { +sub try_medium { my ($options, $want) = @_; urpmi_addmedia("$name $::pwd/media/$name $options"); + try_($want); + urpmi_removemedia($name); + urpmi_addmedia("$name $::pwd/media/$name --virtual $options"); + try_({ virtual => 1, %$want }); + urpmi_removemedia($name); +} + +sub try_ { + my ($want) = @_; my $config = urpm::cfg::load_config("root/etc/urpmi/urpmi.cfg"); my ($medium) = @{$config->{media}}; ok($medium); @@ -39,5 +49,4 @@ sub try { urpmi($name); is(`rpm -qa --root $::pwd/root`, "$name-1-1\n"); urpme($name); - urpmi_removemedia($name); } |