This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6a391e714f3a7c2f155214ff29775bd2eec459d8

commit 6a391e714f3a7c2f155214ff29775bd2eec459d8
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Dec 14 01:54:03 2013 +0100

    t-switch-dir-to-symlink: Improve test case
    
    Add new tests, and rename old ones to be more consistent and clear.
---
 t-switch-dir-to-symlink/Makefile                   | 122 ++++++++++++++++++---
 .../pkg-dir-file-moved}/DEBIAN/control             |   6 +-
 .../test-dir/file-normal}                          |   0
 .../pkg-dir-file-other}/DEBIAN/control             |   5 +-
 .../test-path/file-other}                          |   0
 .../pkg-dir-real/DEBIAN/control                    |   7 --
 .../DEBIAN/control                                 |   2 +-
 .../test-path/file-normal}                         |   0
 .../DEBIAN/control                                 |   3 +-
 .../DEBIAN/postinst                                |   0
 .../DEBIAN/postrm                                  |   0
 .../DEBIAN/preinst                                 |   0
 .../test-path                                      |   0
 .../DEBIAN/control                                 |   2 +-
 .../pkg-dir-symlink-int-0/test-path/file-normal    |   0
 .../DEBIAN/control                                 |   2 +-
 .../DEBIAN/postinst                                |   0
 .../DEBIAN/postrm                                  |   0
 .../DEBIAN/preinst                                 |   0
 .../pkg-dir-symlink-int-1/test-dir/file-other      |   0
 .../test-path                                      |   0
 21 files changed, 116 insertions(+), 33 deletions(-)

diff --git a/t-switch-dir-to-symlink/Makefile b/t-switch-dir-to-symlink/Makefile
index 098870344..c5f8c84cd 100644
--- a/t-switch-dir-to-symlink/Makefile
+++ b/t-switch-dir-to-symlink/Makefile
@@ -1,5 +1,7 @@
-TESTS_DEB := pkg-dir-real pkg-dir-symlink-0 pkg-dir-symlink-1 \
-             pkg-dir-conffile-0 pkg-dir-conffile-1
+TESTS_DEB := \
+       pkg-dir-conffile-0 pkg-dir-conffile-1 \
+       pkg-dir-file-other pkg-dir-symlink-int-0 pkg-dir-symlink-int-1 \
+       pkg-dir-file-moved pkg-dir-symlink-ext-0 pkg-dir-symlink-ext-1
 
 include ../Test.mk
 
@@ -12,37 +14,127 @@ test-case:
        $(DPKG_PURGE) pkg-dir-conffile
 
        # Cannot switch a directory containing files owned by another package
-       $(DPKG_INSTALL) pkg-dir-real.deb
-       $(DPKG_INSTALL) pkg-dir-symlink-0.deb
+       $(DPKG_INSTALL) pkg-dir-file-other.deb
+       $(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
        test -d /test-path
        ! test -h /test-path
-       ! $(DPKG_INSTALL) pkg-dir-symlink-1.deb
+       ! $(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
        test -d /test-path
        ! test -h /test-path
-       $(DPKG_PURGE) pkg-dir-symlink
-       $(DPKG_PURGE) pkg-dir-real
+       $(DPKG_PURGE) pkg-dir-symlink-int
+       $(DPKG_PURGE) pkg-dir-file-other
 
        # Cannot switch a directory containing local files
-       $(DPKG_INSTALL) pkg-dir-symlink-0.deb
+       $(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
        test -d /test-path
        ! test -h /test-path
        touch '/test-path/local file'
-       ! $(DPKG_INSTALL) pkg-dir-symlink-1.deb
+       ! $(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
        test -d /test-path
        ! test -h /test-path
        rm '/test-path/local file'
-       $(DPKG_PURGE) pkg-dir-symlink
+       $(DPKG_PURGE) pkg-dir-symlink-int
 
+       #
        # Otherwise allow the switch
-       $(DPKG_INSTALL) pkg-dir-symlink-0.deb
+       #
+
+       # Switch a directory to a symlink, contents moved within the package,
+       # with intermediate full installs.
+       $(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
+       test -d /test-path
+       ! test -h /test-path
+       $(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
+       test -h /test-path
+       $(DPKG_PURGE) pkg-dir-symlink-int
+       ! test -e /test-path
+
+       # Switch a directory to a symlink, contents moved within the package,
+       # with full install, upgrade with upack and configure.
+       $(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
+       ! test -h /test-path
+       test -d /test-path
+       $(DPKG_UNPACK) pkg-dir-symlink-int-1.deb
+       ! test -h /test-path
+       test -d /test-path
+       $(DPKG_CONFIGURE) pkg-dir-symlink-int
+       test -h /test-path
+       $(DPKG_PURGE) pkg-dir-symlink-int
+       ! test -e /test-path
+
+       # Switch a directory to a symlink, contents moved within the package,
+       # with two unpacks and configure.
+       $(DPKG_UNPACK) pkg-dir-symlink-int-0.deb
+       ! test -h /test-path
        test -d /test-path
+       $(DPKG_UNPACK) pkg-dir-symlink-int-1.deb
        ! test -h /test-path
-       $(DPKG_INSTALL) pkg-dir-symlink-1.deb
+       test -d /test-path
+       $(DPKG_CONFIGURE) pkg-dir-symlink-int
        test -h /test-path
-       $(DPKG_PURGE) pkg-dir-symlink
+       $(DPKG_PURGE) pkg-dir-symlink-int
        ! test -e /test-path
 
+       # Switch a directory to a symlink, contents moved to another package,
+       # with intermediate full installs.
+       $(DPKG_INSTALL) pkg-dir-symlink-ext-0.deb
+       test -d /test-path
+       $(DPKG_INSTALL) pkg-dir-file-moved.deb
+       test -d /test-path
+       test -d /test-dir
+       $(DPKG_INSTALL) pkg-dir-symlink-ext-1.deb
+       test -h /test-path
+       test -d /test-path
+       test "`readlink -f /test-path`" = "/test-dir"
+       ! test -h /test-dir
+       test -d /test-dir
+       test -f /test-dir/file-normal
+       $(DPKG_PURGE) pkg-dir-symlink-ext
+       $(DPKG_PURGE) pkg-dir-file-moved
+
+       # Switch a directory to a symlink, contents moved to another package,
+       # with full installs, upgrade with upack and configure.
+       $(DPKG_INSTALL) pkg-dir-symlink-ext-0.deb
+       test -d /test-path
+       $(DPKG_INSTALL) pkg-dir-file-moved.deb
+       test -d /test-path
+       test -d /test-dir
+       $(DPKG_UNPACK) pkg-dir-symlink-ext-1.deb
+       test -d /test-path
+       test -d /test-dir
+       $(DPKG_CONFIGURE) -a
+       test -h /test-path
+       test -d /test-path
+       test "`readlink -f /test-path`" = "/test-dir"
+       ! test -h /test-dir
+       test -d /test-dir
+       test -f /test-dir/file-normal
+       $(DPKG_PURGE) pkg-dir-symlink-ext
+       $(DPKG_PURGE) pkg-dir-file-moved
+
+       # Switch a directory to a symlink, contents moved to another package,
+       # with three unpacks and configure.
+       $(DPKG_UNPACK) pkg-dir-symlink-ext-0.deb
+       test -d /test-path
+       $(DPKG_UNPACK) pkg-dir-file-moved.deb
+       test -d /test-path
+       test -d /test-dir
+       $(DPKG_UNPACK) pkg-dir-symlink-ext-1.deb
+       test -d /test-path
+       test -d /test-dir
+       $(DPKG_CONFIGURE) -a
+       test -h /test-path
+       test -d /test-path
+       test "`readlink -f /test-path`" = "/test-dir"
+       ! test -h /test-dir
+       test -d /test-dir
+       test -f /test-dir/file-normal
+       $(DPKG_PURGE) pkg-dir-symlink-ext
+       $(DPKG_PURGE) pkg-dir-file-moved
+
 test-clean:
        $(DPKG_PURGE) pkg-dir-conffile
-       $(DPKG_PURGE) pkg-dir-symlink
-       $(DPKG_PURGE) pkg-dir-real
+       $(DPKG_PURGE) pkg-dir-symlink-int
+       $(DPKG_PURGE) pkg-dir-symlink-ext
+       $(DPKG_PURGE) pkg-dir-file-other
+       $(DPKG_PURGE) pkg-dir-file-moved
diff --git a/t-conffile-forceask/pkg-conff-forceask-1/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-file-moved/DEBIAN/control
similarity index 52%
copy from t-conffile-forceask/pkg-conff-forceask-1/DEBIAN/control
copy to t-switch-dir-to-symlink/pkg-dir-file-moved/DEBIAN/control
index be39ec81a..db492ddef 100644
--- a/t-conffile-forceask/pkg-conff-forceask-1/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-file-moved/DEBIAN/control
@@ -1,9 +1,7 @@
-Package: pkg-conff-forceask
+Package: pkg-dir-file-moved
 Version: 1
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
-Description: test package - force-confask behaviour
- Debbug: ??
-
+Description: test package - package with file moved from dir-to-symlink switch
diff --git a/t-switch-dir-to-symlink/pkg-dir-real/test-path/file-dir 
b/t-switch-dir-to-symlink/pkg-dir-file-moved/test-dir/file-normal
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-real/test-path/file-dir
rename to t-switch-dir-to-symlink/pkg-dir-file-moved/test-dir/file-normal
diff --git a/t-conffile-conflict/pkg-conff-a/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-file-other/DEBIAN/control
similarity index 56%
copy from t-conffile-conflict/pkg-conff-a/DEBIAN/control
copy to t-switch-dir-to-symlink/pkg-dir-file-other/DEBIAN/control
index a346baefc..985c6db48 100644
--- a/t-conffile-conflict/pkg-conff-a/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-file-other/DEBIAN/control
@@ -1,8 +1,7 @@
-Package: pkg-conff-a
+Package: pkg-dir-file-other
 Version: 0
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
-Description: test package - conflicting conffile
-
+Description: test package - package with real dir and contents
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-0/test-path/file-path 
b/t-switch-dir-to-symlink/pkg-dir-file-other/test-path/file-other
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-0/test-path/file-path
rename to t-switch-dir-to-symlink/pkg-dir-file-other/test-path/file-other
diff --git a/t-switch-dir-to-symlink/pkg-dir-real/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-real/DEBIAN/control
deleted file mode 100644
index 1e94e7a6c..000000000
--- a/t-switch-dir-to-symlink/pkg-dir-real/DEBIAN/control
+++ /dev/null
@@ -1,7 +0,0 @@
-Package: pkg-dir-real
-Version: 0
-Section: test
-Priority: extra
-Maintainer: Dpkg Developers <[email protected]>
-Architecture: all
-Description: test package - package with real dir
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-0/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-0/DEBIAN/control
similarity index 86%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-0/DEBIAN/control
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-0/DEBIAN/control
index 59c826668..f9aca91b0 100644
--- a/t-switch-dir-to-symlink/pkg-dir-symlink-0/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-0/DEBIAN/control
@@ -1,4 +1,4 @@
-Package: pkg-dir-symlink
+Package: pkg-dir-symlink-ext
 Version: 0
 Section: test
 Priority: extra
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/test-dir/file-dir 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-0/test-path/file-normal
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/test-dir/file-dir
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-0/test-path/file-normal
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/control
similarity index 73%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/control
copy to t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/control
index 69f4d7490..255195be7 100644
--- a/t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/control
@@ -1,7 +1,8 @@
-Package: pkg-dir-conffile
+Package: pkg-dir-symlink-ext
 Version: 1
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
+Depends: pkg-dir-file-moved (>= 1)
 Description: test package - package switching dir to symlink
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/postinst 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/postinst
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/postinst
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/postinst
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/postrm 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/postrm
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/postrm
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/postrm
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/preinst 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/preinst
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/preinst
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/DEBIAN/preinst
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/test-path 
b/t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/test-path
similarity index 100%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/test-path
rename to t-switch-dir-to-symlink/pkg-dir-symlink-ext-1/test-path
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-0/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-0/DEBIAN/control
similarity index 86%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-0/DEBIAN/control
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-0/DEBIAN/control
index 57fdc536d..352666467 100644
--- a/t-switch-dir-to-symlink/pkg-dir-conffile-0/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-symlink-int-0/DEBIAN/control
@@ -1,4 +1,4 @@
-Package: pkg-dir-conffile
+Package: pkg-dir-symlink-int
 Version: 0
 Section: test
 Priority: extra
diff --git a/dpkgdb/available 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-0/test-path/file-normal
similarity index 100%
copy from dpkgdb/available
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-0/test-path/file-normal
diff --git a/t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/control 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/control
similarity index 86%
rename from t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/control
rename to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/control
index 35c08fc64..6852587e7 100644
--- a/t-switch-dir-to-symlink/pkg-dir-symlink-1/DEBIAN/control
+++ b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/control
@@ -1,4 +1,4 @@
-Package: pkg-dir-symlink
+Package: pkg-dir-symlink-int
 Version: 1
 Section: test
 Priority: extra
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/postinst 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/postinst
similarity index 100%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/postinst
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/postinst
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/postrm 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/postrm
similarity index 100%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/postrm
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/postrm
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/preinst 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/preinst
similarity index 100%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-1/DEBIAN/preinst
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/DEBIAN/preinst
diff --git a/dpkgdb/available 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/test-dir/file-other
similarity index 100%
copy from dpkgdb/available
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/test-dir/file-other
diff --git a/t-switch-dir-to-symlink/pkg-dir-conffile-1/test-path 
b/t-switch-dir-to-symlink/pkg-dir-symlink-int-1/test-path
similarity index 100%
copy from t-switch-dir-to-symlink/pkg-dir-conffile-1/test-path
copy to t-switch-dir-to-symlink/pkg-dir-symlink-int-1/test-path

-- 
Dpkg.Org's dpkg

Reply via email to