[Pkg-libvirt-commits] [libguestfs] 07/179: tests: rsync: Skip this test when the backend is libvirt.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 31 19:07:53 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 765dc6237ce7b93dd2f33d99be53eae92e048a7a
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed Oct 1 20:12:41 2014 +0100
tests: rsync: Skip this test when the backend is libvirt.
It would work, except if you have a host firewall which will block
inbound connections on virbr0 to non-standard ports.
---
tests/rsync/test-rsync.sh | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/tests/rsync/test-rsync.sh b/tests/rsync/test-rsync.sh
index 793d59d..53fcab8 100755
--- a/tests/rsync/test-rsync.sh
+++ b/tests/rsync/test-rsync.sh
@@ -33,10 +33,33 @@ if ! rsync --help >/dev/null 2>&1; then
exit 77
fi
-if [ "$(guestfish get-backend)" = "uml" ]; then
- echo "$0: skipping test because networking is not available in the UML backend"
- exit 77
-fi
+# Get host IP address. XXX Bit of a hack.
+backend="$(guestfish get-backend)"
+case "$backend" in
+ direct)
+ ip=169.254.2.2
+ listen_address=localhost
+ ;;
+ libvirt|libvirt:*)
+ # This would work, except that the host firewall is effective
+ # on virbr0, and that is likely to block the non-standard port
+ # number that we listen on.
+# ip="$(ip -4 -o address show virbr0 |
+# awk '{print $4}' |
+# awk -F/ '{print $1}')"
+# listen_address="$ip"
+ echo "$0: skipping test because host firewall will probably prevent this test from working"
+ exit 77
+ ;;
+ uml)
+ echo "$0: skipping test because networking is not available in the UML backend"
+ exit 77
+ ;;
+ *)
+ echo "$0: don't know how to get IP address of backend $backend"
+ exit 77
+ ;;
+esac
# If rsync is not available, bail.
if ! guestfish -a /dev/null run : available rsync; then
@@ -56,7 +79,7 @@ port="$(awk 'BEGIN{srand(); print 65000+int(500*rand())}' </dev/null)"
# Write an rsync daemon config file.
cat > rsyncd.conf <<EOF
-address = localhost
+address = $listen_address
port = $port
pid file = $pwd/rsyncd.pid
[src]
@@ -80,8 +103,6 @@ function cleanup ()
}
trap cleanup INT TERM QUIT EXIT
-# XXX
-ip=169.254.2.2
user="$(id -un)"
guestfish --network -N test-rsync.img=fs -m /dev/sda1 <<EOF
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list