Workaround missing zip snapshot
At the moment, xenserver installation depends on github snapshots.
Unfortunately, git.openstack.org does not have that capability. This
fix includes:
- Exit with error code, if a download fails
- create proper urls, even if they are using the git protocol
- set git base to github - so we are able to do snapshots
Fixes bug: 1259905
Change-Id: I8d0cf8bf8abb16ee0a4b138a6719409c75e7a146
diff --git a/tools/xen/test_functions.sh b/tools/xen/test_functions.sh
index 1455186..373d996 100755
--- a/tools/xen/test_functions.sh
+++ b/tools/xen/test_functions.sh
@@ -29,6 +29,9 @@
XE_CALLS=$(mktemp)
truncate -s 0 $XE_CALLS
+
+ DEAD_MESSAGES=$(mktemp)
+ truncate -s 0 $DEAD_MESSAGES
}
# Teardown
@@ -64,6 +67,10 @@
grep -qe "^$1\$" $XE_CALLS
}
+function assert_died_with {
+ diff -u <(echo "$1") $DEAD_MESSAGES
+}
+
function mock_out {
local FNNAME="$1"
local OUTPUT="$2"
@@ -109,10 +116,16 @@
grep "[ -d /usr/lib/xcp/plugins/ ]" $LIST_OF_ACTIONS
}
-function test_zip_snapshot_location {
+function test_zip_snapshot_location_http {
diff \
- <(zip_snapshot_location "git://git.openstack.org/openstack/nova.git" "master") \
- <(echo "git://git.openstack.org/openstack/nova/zipball/master")
+ <(zip_snapshot_location "http://github.com/openstack/nova.git" "master") \
+ <(echo "http://github.com/openstack/nova/zipball/master")
+}
+
+function test_zip_snapsot_location_git {
+ diff \
+ <(zip_snapshot_location "git://github.com/openstack/nova.git" "master") \
+ <(echo "http://github.com/openstack/nova/zipball/master")
}
function test_create_directory_for_kernels {
@@ -179,7 +192,7 @@
local IGNORE
IGNORE=$(. mocks && extract_remote_zipball "failurl")
- assert_previous_command_failed
+ assert_died_with "Failed to download [failurl]"
}
function test_find_nova_plugins {