summaryrefslogtreecommitdiffstats
path: root/tests/lib/installer
diff options
context:
space:
mode:
authorRyota Mibu <r-mibu@cq.jp.nec.com>2016-12-14 02:51:31 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-12-14 02:51:31 +0000
commit40cba233d16e355b078e368772ad4aadbb5f91b1 (patch)
tree79b448f6b4b00553302aec928fd772835858e12c /tests/lib/installer
parent6d0620d15a3391d4a0a9f2bec9de143ef68734d2 (diff)
parent83076cf49ebd8ded4d5d5e9667fcd8e9e9be4172 (diff)
Merge "Refactor installers support code"
Diffstat (limited to 'tests/lib/installer')
-rw-r--r--tests/lib/installer34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/lib/installer b/tests/lib/installer
new file mode 100644
index 00000000..cdde6eff
--- /dev/null
+++ b/tests/lib/installer
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+INSTALLER_TYPE=${INSTALLER_TYPE:-local}
+INSTALLER_IP=${INSTALLER_IP:-none}
+ssh_opts_cpu="$ssh_opts"
+
+function is_installer_supported {
+ local installer="$1"
+ [[ -f $TOP_DIR/lib/installers/$installer ]]
+}
+
+function is_installer {
+ local installer="$1"
+ [[ $installer == $INSTALLER_TYPE ]]
+}
+
+function setup_installer {
+ if ! is_installer_supported $INSTALLER_TYPE; then
+ die $LINENO"INSTALLER_TYPE=$INSTALLER_TYPE is not supported."
+ fi
+
+ source $TOP_DIR/lib/installers/$INSTALLER_TYPE
+
+ if ! is_set INSTALLER_IP; then
+ get_installer_ip
+ fi
+
+ installer_get_ssh_keys
+ installer_apply_patches
+}
+
+function cleanup_installer {
+ cleanup_installer_$INSTALLER_TYPE
+}