summaryrefslogtreecommitdiffstats
path: root/tests/ci
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ci')
-rw-r--r--tests/ci/docker/yardstick-ci/Dockerfile2
-rwxr-xr-xtests/ci/prepare_env.sh28
-rwxr-xr-xtests/ci/prepare_storperf_admin-rc.sh30
-rwxr-xr-xtests/ci/yardstick-verify64
4 files changed, 121 insertions, 3 deletions
diff --git a/tests/ci/docker/yardstick-ci/Dockerfile b/tests/ci/docker/yardstick-ci/Dockerfile
index cc23073d2..684f47122 100644
--- a/tests/ci/docker/yardstick-ci/Dockerfile
+++ b/tests/ci/docker/yardstick-ci/Dockerfile
@@ -20,6 +20,7 @@ ENV RELENG_REPO_DIR ${REPOS_DIR}/releng
RUN apt-get update && apt-get install -y \
wget \
+ curl \
git \
sshpass \
qemu-utils \
@@ -48,5 +49,6 @@ RUN cd ${YARDSTICK_REPO_DIR} && pip install -r tests/ci/requirements.txt
RUN cd ${YARDSTICK_REPO_DIR} && pip install .
ADD http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img /home/opnfv/images/
+ADD http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img /home/opnfv/images/
COPY ./exec_tests.sh /usr/local/bin/
diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh
index ed832bc47..35118b12c 100755
--- a/tests/ci/prepare_env.sh
+++ b/tests/ci/prepare_env.sh
@@ -52,3 +52,31 @@ fi
source $OPENRC
export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME
+
+# Prepare a admin-rc file for StorPerf integration
+$YARDSTICK_REPO_DIR/tests/ci/prepare_storperf_admin-rc.sh
+
+# Fetching id_rsa file from jump_server..."
+verify_connectivity() {
+ local ip=$1
+ echo "Verifying connectivity to $ip..."
+ for i in $(seq 0 10); do
+ if ping -c 1 -W 1 $ip > /dev/null; then
+ echo "$ip is reachable!"
+ return 0
+ fi
+ sleep 1
+ done
+ error "Can not talk to $ip."
+}
+
+ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+
+if [ "$INSTALLER_TYPE" == "fuel" ]; then
+ #ip_fuel="10.20.0.2"
+ verify_connectivity $INSTALLER_IP
+ echo "Fetching id_rsa file from jump_server $INSTALLER_IP..."
+ sshpass -p r00tme scp 2>/dev/null $ssh_options \
+ root@${INSTALLER_IP}:~/.ssh/id_rsa /root/.ssh/id_rsa &> /dev/null
+fi
+
diff --git a/tests/ci/prepare_storperf_admin-rc.sh b/tests/ci/prepare_storperf_admin-rc.sh
new file mode 100755
index 000000000..0401719ff
--- /dev/null
+++ b/tests/ci/prepare_storperf_admin-rc.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+AUTH_URL=${OS_AUTH_URL}
+USERNAME=${OS_USERNAME:-admin}
+PASSWORD=${OS_PASSWORD:-console}
+TENANT_NAME=${OS_TENANT_NAME:-admin}
+VOLUME_API_VERSION=${OS_VOLUME_API_VERSION:-2}
+PROJECT_NAME=${OS_PROJECT_NAME:-$TENANT_NAME}
+TENANT_ID=`keystone tenant-get admin|grep 'id'|awk -F '|' '{print $3}'|sed -e 's/^[[:space:]]*//'`
+
+
+rm -f ~/storperf_admin-rc
+touch ~/storperf_admin-rc
+
+echo "OS_AUTH_URL="$AUTH_URL >> ~/storperf_admin-rc
+echo "OS_USERNAME="$USERNAME >> ~/storperf_admin-rc
+echo "OS_PASSWORD="$PASSWORD >> ~/storperf_admin-rc
+echo "OS_TENANT_NAME="$TENANT_NAME >> ~/storperf_admin-rc
+echo "OS_VOLUME_API_VERSION="$VOLUME_API_VERSION >> ~/storperf_admin-rc
+echo "OS_PROJECT_NAME="$PROJECT_NAME >> ~/storperf_admin-rc
+echo "OS_TENANT_ID="$TENANT_ID >> ~/storperf_admin-rc
diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify
index c83193574..bdb91003d 100755
--- a/tests/ci/yardstick-verify
+++ b/tests/ci/yardstick-verify
@@ -42,7 +42,7 @@ EOF
DISPATCHER_TYPE=file
DISPATCHER_FILE_NAME="/tmp/yardstick.out"
-DISPATCHER_HTTP_TARGET=
+DISPATCHER_HTTP_TARGET="http://testresults.opnfv.org/test/api/v1/results"
DISPATCHER_INFLUXDB_TARGET=
while getopts "r:i:h" OPTION; do
@@ -80,7 +80,7 @@ cleanup()
return
fi
- for image in $(glance image-list | grep -e cirros-0.3.3 -e yardstick-trusty-server | awk '{print $2}'); do
+ for image in $(glance image-list | grep -e cirros-0.3.3 -e yardstick-trusty-server -e Ubuntu-14.04 | awk '{print $2}'); do
echo "Deleting image $image..."
glance image-delete $image || true
done
@@ -121,6 +121,23 @@ install_yardstick()
pip install .
}
+install_storperf()
+{
+ # Install Storper on huawei-pod1
+ if [ "$NODE_NAME" == "huawei-pod1" ]; then
+ echo
+ echo "========== Installing storperf =========="
+
+ if ! yardstick -d plugin install plugin/CI/storperf.yaml; then
+ echo "Install storperf plugin FAILED";
+ exit 1
+ fi
+
+ echo
+ echo "========== Installed storperf container =========="
+ fi
+}
+
build_yardstick_image()
{
echo
@@ -174,6 +191,30 @@ load_cirros_image()
echo "Cirros image id: $CIRROS_IMAGE_ID"
}
+load_ubuntu_image()
+{
+ echo
+ echo "========== Loading ubuntu cloud image =========="
+
+ local ubuntu_image_file=/home/opnfv/images/trusty-server-cloudimg-amd64-disk1.img
+
+ output=$(glance image-create \
+ --name Ubuntu-14.04 \
+ --disk-format qcow2 \
+ --container-format bare \
+ --file $ubuntu_image_file)
+ echo "$output"
+
+ UBUNTU_IMAGE_ID=$(echo "$output" | grep " id " | awk '{print $(NF-1)}')
+
+ if [ -z "$UBUNTU_IMAGE_ID" ]; then
+ echo 'Failed uploading UBUNTU image to cloud'.
+ exit 1
+ fi
+
+ echo "Ubuntu image id: $UBUNTU_IMAGE_ID"
+}
+
load_yardstick_image()
{
echo
@@ -255,13 +296,28 @@ EOF
done
+ local sceanrio_status="SUCCESS"
+
if [ $failed -gt 0 ]; then
+ scenario_status="FAILED"
+ fi
+ curl -i -H 'content-type: application/json' -X POST -d \
+ "{\"project_name\": \"yardstick\",
+ \"pod_name\":\"${NODE_NAME}\",
+ \"installer\":\"${INSTALLER_TYPE}\",
+ \"description\": \"yardstick ci scenario status\",
+ \"case_name\": \"scenario_status\",
+ \"version\":\"${YARDSTICK_BRANCH}\",
+ \"scenario\":\"${DEPLOY_SCENARIO}\",
+ \"details\":\"${sceanrio_status}\"}" \
+ ${DISPATCHER_HTTP_TARGET}
+ if [ $failed -gt 0 ]; then
echo "---------------------------"
echo "$failed out of ${SUITE_FILES[*]} test suites FAILED"
echo "---------------------------"
exit 1
- fi
+ fi
else
@@ -361,8 +417,10 @@ main()
build_yardstick_image
load_yardstick_image
load_cirros_image
+ load_ubuntu_image
create_nova_flavor
+ install_storperf
run_test
}