diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-08-12 18:37:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-08-12 18:37:04 +0000 |
commit | f14f1e0e797b3305e2e6a53a4ad14e5064076559 (patch) | |
tree | 798d7328eec4003c75a2d149b2a776e7937859bd /t/superuser--rpmnew.t | |
parent | 43adcb41d2209dbc1b573cca46c080790a5ce5c9 (diff) | |
download | urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.gz urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.bz2 urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.xz urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.zip |
one more test
Diffstat (limited to 't/superuser--rpmnew.t')
-rw-r--r-- | t/superuser--rpmnew.t | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/t/superuser--rpmnew.t b/t/superuser--rpmnew.t index 71c4d851..8c71b02c 100644 --- a/t/superuser--rpmnew.t +++ b/t/superuser--rpmnew.t @@ -16,8 +16,10 @@ my $urpmi_cmd = urpmi_cmd(); test1($rpm_cmd); test2($rpm_cmd); +test3($rpm_cmd); test1($urpmi_cmd); test2($urpmi_cmd); +test3($urpmi_cmd); sub test1 { my ($cmd) = @_; @@ -33,6 +35,24 @@ sub test1 { sub test2 { my ($cmd) = @_; + mkdir "$::pwd/root/etc"; + system("echo orig > $::pwd/root/etc/$_") foreach @names; + + test($cmd, + ['orig', 'orig', 'orig'], + ['orig', 'orig', 'orig'], + ['changed', 'changed', 'changed']); + + ok(unlink "$::pwd/root/etc/config.rpmorig"); + ok(unlink "$::pwd/root/etc/config-noreplace.rpmnew"); + + check_no_etc_files(); +} + +sub test3 { + my ($cmd) = @_; + + mkdir "$::pwd/root/etc"; system("echo foo > $::pwd/root/etc/$_") foreach @names; test($cmd, @@ -43,9 +63,9 @@ sub test2 { check_one_content('<removed>', 'config.rpmorig', 'foo'); check_one_content('<removed>', 'config-noreplace.rpmsave', 'foo'); check_one_content('<removed>', 'config-noreplace.rpmnew', 'changed'); - unlink "$::pwd/root/etc/config.rpmorig"; - unlink "$::pwd/root/etc/config-noreplace.rpmsave"; - unlink "$::pwd/root/etc/config-noreplace.rpmnew"; + ok(unlink "$::pwd/root/etc/config.rpmorig"); + ok(unlink "$::pwd/root/etc/config-noreplace.rpmsave"); + ok(unlink "$::pwd/root/etc/config-noreplace.rpmnew"); check_no_etc_files(); } |