summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-12 18:37:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-12 18:37:04 +0000
commitf14f1e0e797b3305e2e6a53a4ad14e5064076559 (patch)
tree798d7328eec4003c75a2d149b2a776e7937859bd /t
parent43adcb41d2209dbc1b573cca46c080790a5ce5c9 (diff)
downloadurpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar
urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.gz
urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.bz2
urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.tar.xz
urpmi-f14f1e0e797b3305e2e6a53a4ad14e5064076559.zip
one more test
Diffstat (limited to 't')
-rw-r--r--t/superuser--rpmnew.t26
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();
}