StorPerf integration into Yardstick as a pulgin. 09/16909/3
authorYaoguang Wang <sunshine.wang@huawei.com>
Thu, 14 Jul 2016 11:59:12 +0000 (19:59 +0800)
committerYaoguang Wang <sunshine.wang@huawei.com>
Fri, 22 Jul 2016 07:05:17 +0000 (15:05 +0800)
This task will install *StorPerf* on the Jump Host.
StorPerf will run in docker container on the Jump Host.

JIRA: YARDSTICK-303

Change-Id: Ia592522a169f021adecc7d89d70079980be69665
Signed-off-by: Yaoguang Wang <sunshine.wang@huawei.com>
plugin/storperf.yaml [new file with mode: 0644]
tests/ci/prepare_env.sh
tests/ci/prepare_storperf_admin-rc.sh [new file with mode: 0755]
yardstick/resources/script/install/storperf.bash [new file with mode: 0644]
yardstick/resources/script/remove/storperf.bash [new file with mode: 0644]

diff --git a/plugin/storperf.yaml b/plugin/storperf.yaml
new file mode 100644 (file)
index 0000000..d08e26e
--- /dev/null
@@ -0,0 +1,13 @@
+---
+# StorPerf plugin configration file
+# Used for integration StorPerf into Yardstick as a plugin
+
+schema: "yardstick:plugin:0.1"
+
+plugins:
+  name: storperf
+
+deployment:
+  ip: 192.168.23.2
+  user: root
+  password: root
index ed832bc..723a04a 100755 (executable)
@@ -52,3 +52,6 @@ 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
diff --git a/tests/ci/prepare_storperf_admin-rc.sh b/tests/ci/prepare_storperf_admin-rc.sh
new file mode 100755 (executable)
index 0000000..0401719
--- /dev/null
@@ -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/yardstick/resources/script/install/storperf.bash b/yardstick/resources/script/install/storperf.bash
new file mode 100644 (file)
index 0000000..9bbec72
--- /dev/null
@@ -0,0 +1,27 @@
+#!/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
+##############################################################################
+
+# StorPerf plugin installation script
+# After installation, it will run StorPerf container on Jump Host
+# Requirements:
+#     1. docker has been installed on the Jump Host
+#     2. Openstack environment file for storperf, '~/storperf_admin-rc', is ready.
+
+set -e
+
+mkdir -p /tmp/storperf-yardstick
+
+docker pull opnfv/storperf
+docker run -t \
+--env-file ~/storperf_admin-rc \
+-p 5000:5000 -p 8000:8000 \
+-v /tmp/storperf-yardstick/carbon:/opt/graphite/storage/whisper \
+--name storperf-yardstick opnfv/storperf &
diff --git a/yardstick/resources/script/remove/storperf.bash b/yardstick/resources/script/remove/storperf.bash
new file mode 100644 (file)
index 0000000..a8eb51c
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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
+##############################################################################
+
+# StorPerf plugin un-installation script
+
+set -e
+
+docker stop storperf-yardstick
+docker rm -f storperf-yardstick
+docker rmi opnfv/storperf
+
+rm -rf /tmp/storperf-yardstick