[Git][debian-gis-team/postgis][experimental] debian/tests/control: Tests don't need root, but support running as root.

Christoph Berg gitlab at salsa.debian.org
Tue Jul 2 14:49:27 BST 2019



Christoph Berg pushed to branch experimental at Debian GIS Project / postgis


Commits:
d8f9818b by Christoph Berg at 2019-07-02T13:49:09Z
debian/tests/control: Tests don't need root, but support running as root.

- - - - -


4 changed files:

- debian/changelog
- + debian/clean
- debian/tests/control
- debian/tests/regress


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+postgis (3.0.0~alpha3+dfsg-1~exp2) UNRELEASED; urgency=medium
+
+  * debian/tests/control: Tests don't need root, but support running as root.
+
+ -- Christoph Berg <myon at debian.org>  Tue, 02 Jul 2019 14:38:52 +0200
+
 postgis (3.0.0~alpha3+dfsg-1~exp1) experimental; urgency=medium
 
   [ Christoph Berg ]


=====================================
debian/clean
=====================================
@@ -0,0 +1,3 @@
+# created by debian/tests/regress
+loader/pgsql2shp
+loader/shp2pgsql


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
 Depends: @, postgresql-server-dev-all, postgresql-all
 Tests: test-extension-creation regress
-Restrictions: needs-root, allow-stderr
+Restrictions: allow-stderr


=====================================
debian/tests/regress
=====================================
@@ -2,8 +2,20 @@
 
 set -eux
 
-ln -sf /usr/bin/shp2pgsql /usr/bin/pgsql2shp loader
+# link shape loader/dumper to where the testsuite expects them
+for prg in shp2pgsql pgsql2shp; do
+  test -x loader/$prg || ln -s /usr/bin/$prg loader $prg
+done
+
+# re-start ourselves as nobody since PG can't run as root
+if [ "$(id -un)" = "root" ]; then
+  exec su nobody -s /bin/sh "$0" "$@$"
+fi
+
+# clean up on exit
+trap "rm -rf /tmp/pgis_reg" EXIT
 
+# run the regession tests
 for v in $(pg_buildext supported-versions); do
   pg_virtualenv -v $v <<-EOF
 	set -eux



View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/commit/d8f9818b46aabc9c73d067366c36a63564513ac0

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/commit/d8f9818b46aabc9c73d067366c36a63564513ac0
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20190702/375da869/attachment-0001.html>


More information about the Pkg-grass-devel mailing list