summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-07-06 10:56:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-07-06 10:56:05 +0000
commit3a885ca6fb32a5318abc142810ebfa2b4762b148 (patch)
tree815176ec13d5996ab7a59207d88ec9d292b2ac7b /t
parent3cce30bc391b238dedc3d470892319ab8ed412a1 (diff)
downloadurpmi-3a885ca6fb32a5318abc142810ebfa2b4762b148.tar
urpmi-3a885ca6fb32a5318abc142810ebfa2b4762b148.tar.gz
urpmi-3a885ca6fb32a5318abc142810ebfa2b4762b148.tar.bz2
urpmi-3a885ca6fb32a5318abc142810ebfa2b4762b148.tar.xz
urpmi-3a885ca6fb32a5318abc142810ebfa2b4762b148.zip
fix & enhance test
Diffstat (limited to 't')
-rw-r--r--t/superuser--rpmnew.t23
1 files changed, 18 insertions, 5 deletions
diff --git a/t/superuser--rpmnew.t b/t/superuser--rpmnew.t
index 9714d143..a6bfee8d 100644
--- a/t/superuser--rpmnew.t
+++ b/t/superuser--rpmnew.t
@@ -11,17 +11,30 @@ my @names = ('config-noreplace', 'config', 'normal');
need_root_and_prepare();
-urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
-
test(['orig', 'orig', 'orig'],
['orig', 'orig', 'orig'],
['changed', 'changed', 'changed']);
+if (my @l = glob("$::pwd/root/etc/*")) {
+ fail(join(' ', @l) . " files should not be there");
+}
+
system("echo foo > $::pwd/root/etc/$_") foreach @names;
-test(['foo', 'foo', 'orig'],
- ['foo', 'foo', 'orig'],
- ['foo', 'foo', 'changed']);
+test(['foo', 'orig', 'orig'],
+ ['foo', 'orig', 'orig'],
+ ['foo', 'changed', 'changed']);
+
+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";
+
+if (my @l = glob("$::pwd/root/etc/*")) {
+ fail(join(' ', @l) . " files should not be there");
+}
sub check_content {
my ($rpm, $config_noreplace, $config, $normal) = @_;