diff options
author | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2017-02-02 15:03:01 +0000 |
---|---|---|
committer | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2017-02-02 16:22:03 +0000 |
commit | 1d5c5fae6b040a19404a1cfd9afd28237d93f6a7 (patch) | |
tree | 48375398109dc1d5b62cb954958048f4e31a6c67 /tests/lib/installers/local | |
parent | 06406611160b83a2ec90400db3b9e6b08d60ff95 (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/installers/local')
-rw-r--r-- | tests/lib/installers/local | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/lib/installers/local b/tests/lib/installers/local index e7aed14f..50c3686f 100644 --- a/tests/lib/installers/local +++ b/tests/lib/installers/local @@ -1,9 +1,7 @@ #!/bin/bash -function get_installer_ip { - # Noop - return -} +COMPUTE_USER=${COMPUTE_USER:-$(whoami)} +ssh_opts_cpu="$ssh_opts" function installer_get_ssh_keys { echo "INSTALLER_TYPE set to 'local'. Assuming SSH keys already exchanged with $COMPUTE_HOST" @@ -15,7 +13,24 @@ function installer_apply_patches { return } -function cleanup_installer_local { +function setup_installer { + installer_get_ssh_keys + installer_apply_patches +} + +function get_compute_ip_from_hostname { + local compute_host=$1 + + if is_set COMPUTE_IP; then + echo "Using pre-configured COMPUTE_IP=$COMPUTE_IP ..." + return + fi + COMPUTE_IP=$(getent hosts "$compute_host" | awk '{ print $1 }') + die_if_not_set $LINENO COMPUTE_IP \ + "Could not resolve $compute_host. Either manually set COMPUTE_IP or enable DNS resolution." +} + +function cleanup_installer { # Noop return } |