summaryrefslogtreecommitdiffstats
path: root/tests/lib/installer
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-02-02 15:03:01 +0000
committerRyota MIBU <r-mibu@cq.jp.nec.com>2017-02-02 16:22:03 +0000
commit1d5c5fae6b040a19404a1cfd9afd28237d93f6a7 (patch)
tree48375398109dc1d5b62cb954958048f4e31a6c67 /tests/lib/installer
parent06406611160b83a2ec90400db3b9e6b08d60ff95 (diff)
refactor lib/installer
- make sure expected parameters and functions are set - remove all installer dependent codes from run.sh except non-used function which will be removed later on Change-Id: I4628173ef0891d893146976c7553ed6a95329957 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'tests/lib/installer')
-rw-r--r--tests/lib/installer32
1 files changed, 18 insertions, 14 deletions
diff --git a/tests/lib/installer b/tests/lib/installer
index bdee9149..13953d28 100644
--- a/tests/lib/installer
+++ b/tests/lib/installer
@@ -1,8 +1,7 @@
#!/bin/bash
INSTALLER_TYPE=${INSTALLER_TYPE:-local}
-INSTALLER_IP=${INSTALLER_IP:-none}
-ssh_opts_cpu="$ssh_opts"
+ssh_opts="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
function is_installer_supported {
local installer="$1"
@@ -14,22 +13,27 @@ function is_installer {
[[ $installer == $INSTALLER_TYPE ]]
}
-function setup_installer {
- if ! is_set INSTALLER_IP; then
- get_installer_ip
- fi
-
- installer_get_ssh_keys
- installer_apply_patches
-}
-
-function cleanup_installer {
- cleanup_installer_$INSTALLER_TYPE
+function validate_installer_lib {
+ local xtrace
+ xtrace=$(set +o | grep xtrace)
+ set +o xtrace
+ for p in COMPUTE_USER ssh_opts_cpu
+ do
+ die_if_not_set $LINENO $p \
+ "Parameter $p for $INSTALLER_TYPE is missing."
+ done
+ for f in setup_installer get_compute_ip_from_hostname cleanup_installer
+ do
+ die_if_not_defined $LINENO $f \
+ "Mandatory function ${f}() for $INSTALLER_TYPE is missing."
+ done
+ $xtrace
}
-
if ! is_installer_supported $INSTALLER_TYPE; then
die $LINENO "INSTALLER_TYPE=$INSTALLER_TYPE is not supported."
fi
source $TOP_DIR/lib/installers/$INSTALLER_TYPE
+
+validate_installer_lib