summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2018-08-01 11:10:37 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2018-08-01 14:34:31 +0800
commitc109c271018e9a85d94be1b9b468338d64589684 (patch)
tree255fbf8eac87e95f91275c60db2b98cd9478ea0f /jjb
parent57cbefc7160958eae1d49e4753779180a25864af (diff)
prepare installer info for doctor test
Change-Id: I6344a31b28d3e5c9a998693fd64ec255410c62b6 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'jjb')
-rwxr-xr-xjjb/doctor/doctor-env-presetup.sh21
-rw-r--r--jjb/doctor/doctor.yaml3
2 files changed, 24 insertions, 0 deletions
diff --git a/jjb/doctor/doctor-env-presetup.sh b/jjb/doctor/doctor-env-presetup.sh
index 2dda71f3c..8c7c12e25 100755
--- a/jjb/doctor/doctor-env-presetup.sh
+++ b/jjb/doctor/doctor-env-presetup.sh
@@ -2,6 +2,10 @@
set -o errexit
set -o pipefail
+# set vars from env if not provided by user as options
+installer_key_file=${installer_key_file:-$HOME/installer_key_file}
+opnfv_installer=${opnfv_installer:-$HOME/opnfv-installer.sh}
+
# Fetch INSTALLER_IP for APEX deployments
if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
@@ -18,6 +22,9 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
exit 1
fi
+ sudo cp /root/.ssh/id_rsa ${installer_key_file}
+ sudo chown `whoami`:`whoami` ${installer_key_file}
+
elif [[ ${INSTALLER_TYPE} == 'daisy' ]]; then
echo "Gathering IP information for Daisy installer VM"
if sudo virsh list | grep daisy; then
@@ -37,3 +44,17 @@ elif [[ ${INSTALLER_TYPE} == 'daisy' ]]; then
fi
fi
+
+# Checking if destination path is valid
+if [ -d $opnfv_installer ]; then
+ error "Please provide the full destination path for the installer ip file including the filename"
+else
+ # Check if we can create the file (e.g. path is correct)
+ touch $opnfv_installer || error "Cannot create the file specified. Check that the path is correct and run the script again."
+fi
+
+
+# Write the installer info to the file
+echo export INSTALLER_TYPE=${INSTALLER_TYPE} > $opnfv_installer
+echo export INSTALLER_IP=${INSTALLER_IP} >> $opnfv_installer
+echo export SSH_KEY=${installer_key_file} >> $opnfv_installer
diff --git a/jjb/doctor/doctor.yaml b/jjb/doctor/doctor.yaml
index 13cf1a227..858fb5f4e 100644
--- a/jjb/doctor/doctor.yaml
+++ b/jjb/doctor/doctor.yaml
@@ -153,11 +153,14 @@
- ./doctor-env-presetup.sh
- ../../utils/fetch_os_creds.sh
- shell: |
+ # prepare the env for test
source $HOME/opnfv-openrc.sh
if [ -f $HOME/os_cacert ]; then
export OS_CACERT=$HOME/os_cacert
fi
+ source $HOME/opnfv-installer.sh
+ # run tox to trigger the test
tox -e py34
# -------------------------------