diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-12-18 14:06:59 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-12-18 14:06:59 +0000 |
commit | a03bae98662e36648ee8005656b09c03aa0c4d33 (patch) | |
tree | 1d6fed1d043fdf5412707596afe4d1f0b017b736 | |
parent | 3fd42683ec8785f5b37210d09587a100ba8f0b92 (diff) | |
download | urpmi-a03bae98662e36648ee8005656b09c03aa0c4d33.tar urpmi-a03bae98662e36648ee8005656b09c03aa0c4d33.tar.gz urpmi-a03bae98662e36648ee8005656b09c03aa0c4d33.tar.bz2 urpmi-a03bae98662e36648ee8005656b09c03aa0c4d33.tar.xz urpmi-a03bae98662e36648ee8005656b09c03aa0c4d33.zip |
add tests for %ghost conflicts (which should be allowed)
-rw-r--r-- | t/data/SPECS/file-conflicts/fa.spec | 22 | ||||
-rw-r--r-- | t/data/SPECS/file-conflicts/fb.spec | 22 | ||||
-rw-r--r-- | t/superuser--file-conflicts.t | 33 |
3 files changed, 77 insertions, 0 deletions
diff --git a/t/data/SPECS/file-conflicts/fa.spec b/t/data/SPECS/file-conflicts/fa.spec new file mode 100644 index 00000000..98dc2c79 --- /dev/null +++ b/t/data/SPECS/file-conflicts/fa.spec @@ -0,0 +1,22 @@ +Summary: x +Name: fa +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildArch: noarch + +%description +x + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/etc +ln -s fa $RPM_BUILD_ROOT/etc/foo + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%ghost /etc/foo diff --git a/t/data/SPECS/file-conflicts/fb.spec b/t/data/SPECS/file-conflicts/fb.spec new file mode 100644 index 00000000..6fc6e4ef --- /dev/null +++ b/t/data/SPECS/file-conflicts/fb.spec @@ -0,0 +1,22 @@ +Summary: x +Name: fb +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildArch: noarch + +%description +x + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/etc +ln -s fb $RPM_BUILD_ROOT/etc/foo + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%ghost /etc/foo diff --git a/t/superuser--file-conflicts.t b/t/superuser--file-conflicts.t index 9edf794d..d341de95 100644 --- a/t/superuser--file-conflicts.t +++ b/t/superuser--file-conflicts.t @@ -4,6 +4,8 @@ # a and c contents the same file name, with same content => should work # a and d contents the same directory name => should work # a and e contents the same path for a directory vs a symlink => should fail +# +# fa and fb contains the same file name, with different content but %ghost => should work # # a and gc/gc_/gd contains different file => should work # ga and a and gc/gc_ contains the same resulting file, through symlink in ga, with same content => should work @@ -49,6 +51,13 @@ sub test_rpm_same_transaction { test_rpm_i_fail('a', 'e'); check_nothing_installed(); } + + # WARNING: should it really fail? + test_rpm_i_fail('a', 'fa'); + check_nothing_installed(); + + test_rpm_i_succeeds('fa', 'fb'); + check_installed_and_remove('fa', 'fb'); } sub test_rpm_different_transactions { @@ -66,6 +75,15 @@ sub test_rpm_different_transactions { test_rpm_i_succeeds('d'); check_installed_and_remove('a', 'd'); + # WARNING: should it really fail? + test_rpm_i_succeeds('a'); + test_rpm_i_fail('fa'); + check_installed_and_remove('a'); + + test_rpm_i_succeeds('fa'); + test_rpm_i_succeeds('fb'); + check_installed_and_remove('fa', 'fb'); + # the following need to be done in different transactions otherwise rpm is lost test_rpm_i_succeeds('a'); test_rpm_i_succeeds('gd'); @@ -105,6 +123,13 @@ sub test_urpmi_same_transaction { test_urpmi_fail('a e'); check_nothing_installed(); } + + # WARNING: should it really fail? + test_urpmi_fail('a fa'); + check_nothing_installed(); + + urpmi('fa fb'); + check_installed_and_remove('fa', 'fb'); } sub test_urpmi_different_transactions { @@ -123,6 +148,14 @@ sub test_urpmi_different_transactions { urpmi('d'); check_installed_and_remove('a', 'd'); + urpmi('a'); + test_urpmi_fail('fa'); + check_installed_and_remove('a'); + + urpmi('fa'); + urpmi('fb'); + check_installed_and_remove('fa', 'fb'); + # the following need to be done in different transactions otherwise rpm is lost urpmi('a'); urpmi('gd'); |