If install_os_domU.sh fails to download the Xapi plugins zipball
correctly it ignores the error and continues the installation.
This could damage the hypervisor's filesystem, as it may delete
files or overwrite them with garbage.
Change-Id: I9f6dc31b977592e2818e37b2d310c2a5dc477364
Fixes: bug #1195640
| ... | ... |
@@ -40,11 +40,11 @@ function extract_remote_zipball {
|
| 40 | 40 |
local LOCAL_ZIPBALL=$(mktemp) |
| 41 | 41 |
local EXTRACTED_FILES=$(mktemp -d) |
| 42 | 42 |
|
| 43 |
- ( |
|
| 43 |
+ {
|
|
| 44 | 44 |
wget -nv $ZIPBALL_URL -O $LOCAL_ZIPBALL --no-check-certificate |
| 45 | 45 |
unzip -q -o $LOCAL_ZIPBALL -d $EXTRACTED_FILES |
| 46 | 46 |
rm -f $LOCAL_ZIPBALL |
| 47 |
- ) >&2 |
|
| 47 |
+ } >&2 |
|
| 48 | 48 |
|
| 49 | 49 |
echo "$EXTRACTED_FILES" |
| 50 | 50 |
} |
| ... | ... |
@@ -173,6 +173,15 @@ EOF |
| 173 | 173 |
[ "$RESULT" = "tempdir" ] |
| 174 | 174 |
} |
| 175 | 175 |
|
| 176 |
+function test_extract_remote_zipball_wget_fail {
|
|
| 177 |
+ set +e |
|
| 178 |
+ |
|
| 179 |
+ local IGNORE |
|
| 180 |
+ IGNORE=$(. mocks && extract_remote_zipball "failurl") |
|
| 181 |
+ |
|
| 182 |
+ assert_previous_command_failed |
|
| 183 |
+} |
|
| 184 |
+ |
|
| 176 | 185 |
function test_find_nova_plugins {
|
| 177 | 186 |
local tmpdir=$(mktemp -d) |
| 178 | 187 |
|