[Pkg-fedora-ds-maintainers] Bug#888745: suggested workaround to detect unexpected networking
Christian Ehrhardt
christian.ehrhardt at canonical.com
Mon Jan 29 14:38:31 UTC 2018
I don't know enough what 389-ds is doing here to write something much better.
OTOH that isn't even needed we just have to assume that network can be
different and then I think it is reasonable to verify the assumptions
and skip the test if that is the case.
Something like the following would do that:
--- a/debian/tests/setup
+++ b/debian/tests/setup
@@ -4,6 +4,13 @@
IP=`ip route get 1.1.1.1 | sed -n -e's/.*src //; s/ .*//; p; q'`
HOSTNAME=`cat /etc/hosts| grep '127.0.1.1' | awk '{print $NF; exit}'`
+if [ -z "$IP" -o -z "$HOSTNAME" ]; then
+ echo "warning: incompatible network in test environment"
+ echo "(IP=$IP / HOSTNAME=$HOSTNAME)"
+ echo "SKIP Test"
+ exit 0
+fi
+
echo "$IP $HOSTNAME.debci $HOSTNAME" >> /etc/hosts
/usr/sbin/setup-ds --silent -- \
--
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
More information about the Pkg-fedora-ds-maintainers
mailing list