From 4e0c51972157e8bca3c7445e6720b51ee3600e5b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 8 Dec 2006 09:33:32 +0000 Subject: add set_urpmi_cfg_global_options() --- t/helper.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't/helper.pm') diff --git a/t/helper.pm b/t/helper.pm index e76d1396..032d8c9a 100644 --- a/t/helper.pm +++ b/t/helper.pm @@ -6,6 +6,7 @@ our @EXPORT = qw(need_root_and_prepare start_httpd httpd_port urpmi_addmedia urpmi_removemedia urpmi_cmd urpmi urpme + urpmi_cfg set_urpmi_cfg_global_options system_ ); @@ -61,6 +62,16 @@ sub urpme { my ($para) = @_; system_("perl -I.. ../urpme --urpmi-root $::pwd/root $para"); } +sub urpmi_cfg() { + "$::pwd/root/etc/urpmi/urpmi.cfg"; +} +sub set_urpmi_cfg_global_options { + my ($options) = @_; + require_ok('urpm::cfg'); + ok(my $config = urpm::cfg::load_config(urpmi_cfg())); + $config->{global} = $options; + ok(urpm::cfg::dump_config(urpmi_cfg(), $config), 'set_urpmi_cfg_global_options'); +} sub system_ { my ($cmd) = @_; -- cgit v1.2.1