diff options
Diffstat (limited to 't/superuser--addmedia.t')
-rw-r--r-- | t/superuser--addmedia.t | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/t/superuser--addmedia.t b/t/superuser--addmedia.t index 776da2d1..661dce19 100644 --- a/t/superuser--addmedia.t +++ b/t/superuser--addmedia.t @@ -10,12 +10,17 @@ need_root_and_prepare(); my $name = 'various'; my $name2 = 'various2'; +my $name3 = 'various3'; -my @fields = qw(hdlist synthesis with_hdlist media_info_dir virtual); +my @fields = qw(hdlist synthesis with_hdlist media_info_dir list virtual ignore); try_medium({ media_info_dir => 'media_info' }, ''); +try_medium_({ list => 'list.various' }, { list => 'list.various2' }, + '--probe-rpms', '--probe-rpms'); + + try_medium({ hdlist => 1, media_info_dir => 'media_info' }, '--probe-hdlist'); try_medium({ hdlist => 1, media_info_dir => 'media_info' }, @@ -37,6 +42,23 @@ try_medium({ synthesis => 1, "with ../media_info/synthesis.hdlist_$name.cz", "with ../media_info/synthesis.hdlist_$name2.cz"); +try_distrib({ hdlist => 1, + with_hdlist => "../..//media/media_info/hdlist_$name.cz", + with_hdlist2 => "../..//media/media_info/hdlist_$name2.cz", + with_hdlist3 => "../..//media/media_info/hdlist_$name3.cz" }, + ''); +try_distrib({ hdlist => 1, + with_hdlist => "../..//media/media_info/hdlist_$name.cz", + with_hdlist2 => "../..//media/media_info/hdlist_$name2.cz", + with_hdlist3 => "../..//media/media_info/hdlist_$name3.cz" }, + '--probe-hdlist'); +try_distrib({ synthesis => 1, + with_hdlist => "../..//media/media_info/synthesis.hdlist_$name.cz", + with_hdlist2 => "../..//media/media_info/synthesis.hdlist_$name2.cz", + with_hdlist3 => "../..//media/media_info/synthesis.hdlist_$name3.cz" }, + '--probe-synthesis'); + + sub try_medium { my ($want, $options, $o_options2) = @_; my $want2 = { %$want, with_hdlist => $want->{with_hdlist2} || $want->{with_hdlist} }; @@ -47,6 +69,17 @@ sub try_medium { try_medium_($want, $want2, '--virtual ' . $options, '--virtual ' . ($o_options2 || $options)); } +sub try_distrib { + my ($want, $options) = @_; + my $want2 = { %$want, with_hdlist => $want->{with_hdlist2} || $want->{with_hdlist} }; + my $want3 = { %$want, with_hdlist => $want->{with_hdlist3} || $want->{with_hdlist}, ignore => 1 }; + + try_distrib_($want, $want2, $want3, $options); + + $want3->{virtual} = $want2->{virtual} = $want->{virtual} = 1; + try_distrib_($want, $want2, $want3, '--virtual ' . $options); +} + sub try_medium_ { my ($want, $want2, $options, $options2) = @_; @@ -62,6 +95,15 @@ sub try_medium_ { urpmi_removemedia($name); } +sub try_distrib_ { + my ($want, $want2, $want3, $options) = @_; + + urpmi_addmedia("--distrib $name $::pwd $options"); + check_conf($want, $want2, $want3); + check_urpmi($name, $name2); + urpmi_removemedia('-a'); +} + sub check_conf { my (@want) = @_; my $config = urpm::cfg::load_config("root/etc/urpmi/urpmi.cfg"); |