summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocker/exec_tests.sh84
-rw-r--r--etc/yardstick/nodes/pod.yaml.ipmi.sample50
-rwxr-xr-xtests/ci/load_images.sh2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc025.yaml9
-rwxr-xr-xyardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash7
-rw-r--r--yardstick/benchmark/scenarios/networking/ping.py5
6 files changed, 134 insertions, 23 deletions
diff --git a/docker/exec_tests.sh b/docker/exec_tests.sh
index db053f7bc..5f6a945c2 100755
--- a/docker/exec_tests.sh
+++ b/docker/exec_tests.sh
@@ -18,37 +18,85 @@ set -e
: ${RELENG_REPO_DIR:='/home/opnfv/repos/releng'}
: ${RELENG_BRANCH:='master'} # branch, tag, sha1 or refspec
+# git update using reference as a branch.
+# git_update_branch ref
+function git_update_branch {
+ local git_branch=$1
+
+ git checkout -f origin/${git_branch}
+ # a local branch might not exist
+ git branch -D ${git_branch} || true
+ git checkout -b ${git_branch}
+}
+
+# git update using reference as a branch.
+# git_update_remote_branch ref
+function git_update_remote_branch {
+ local git_branch=$1
+
+ git checkout -b ${git_branch} -t origin/${git_branch}
+}
+
+# git update using reference as a tag. Be careful editing source at that repo
+# as working copy will be in a detached mode
+# git_update_tag ref
+function git_update_tag {
+ local git_tag=$1
+
+ git tag -d ${git_tag}
+ # fetching given tag only
+ git fetch origin tag ${git_tag}
+ git checkout -f ${git_tag}
+}
+
+
+# OpenStack Functions
+
git_checkout()
{
- if git cat-file -e $1^{commit} 2>/dev/null; then
- # branch, tag or sha1 object
- git checkout $1 && git pull
- else
+ local git_ref=$1
+ if [[ -n "$(git show-ref refs/tags/${git_ref})" ]]; then
+ git_update_tag "${git_ref}"
+ elif [[ -n "$(git show-ref refs/heads/${git_ref})" ]]; then
+ git_update_branch "${git_ref}"
+ elif [[ -n "$(git show-ref refs/remotes/origin/${git_ref})" ]]; then
+ git_update_remote_branch "${git_ref}"
+ # check to see if it is a remote ref
+ elif git fetch --tags origin "${git_ref}"; then
# refspec / changeset
- git fetch --tags --progress $2 $1
git checkout FETCH_HEAD
+ else
+ # if we are a random commit id we have to unshallow
+ # to get all the commits
+ git fetch --unshallow origin
+ git checkout -f "${git_ref}"
fi
}
echo
-echo "INFO: Updating releng -> $RELENG_BRANCH"
-if [ ! -d $RELENG_REPO_DIR ]; then
- git clone $RELENG_REPO $RELENG_REPO_DIR
+echo "INFO: Updating releng -> ${RELENG_BRANCH}"
+if [ ! -d ${RELENG_REPO_DIR} ]; then
+ git clone ${RELENG_REPO} ${RELENG_REPO_DIR}
fi
-cd $RELENG_REPO_DIR
-git checkout master
-git_checkout $RELENG_BRANCH $RELENG_REPO
+cd ${RELENG_REPO_DIR}
+# reset remote so we know origin is valid
+git remote set-url origin ${RELENG_REPO}
+# fetch the exact ref
+git fetch --tags origin ${RELENG_BRANCH} || true
+# purge pyc files
+find . -name '*.pyc' -delete
+git_checkout ${RELENG_BRANCH}
echo
-echo "INFO: Updating yardstick -> $YARDSTICK_BRANCH"
-if [ ! -d $YARDSTICK_REPO_DIR ]; then
- git clone $YARDSTICK_REPO $YARDSTICK_REPO_DIR
+echo "INFO: Updating yardstick -> ${YARDSTICK_BRANCH}"
+if [ ! -d ${YARDSTICK_REPO_DIR} ]; then
+ git clone ${YARDSTICK_REPO} ${YARDSTICK_REPO_DIR}
fi
-cd $YARDSTICK_REPO_DIR
-git_checkout $YARDSTICK_BRANCH $YARDSTICK_REPO
+cd ${YARDSTICK_REPO_DIR}
+git_checkout ${YARDSTICK_BRANCH}
# setup the environment
-source $YARDSTICK_REPO_DIR/tests/ci/prepare_env.sh
+source ${YARDSTICK_REPO_DIR}/tests/ci/prepare_env.sh
# execute tests
-$YARDSTICK_REPO_DIR/tests/ci/yardstick-verify $@
+${YARDSTICK_REPO_DIR}/tests/ci/yardstick-verify $@
diff --git a/etc/yardstick/nodes/pod.yaml.ipmi.sample b/etc/yardstick/nodes/pod.yaml.ipmi.sample
new file mode 100644
index 000000000..6253c790f
--- /dev/null
+++ b/etc/yardstick/nodes/pod.yaml.ipmi.sample
@@ -0,0 +1,50 @@
+##############################################################################
+# Copyright (c) 2017 14_ykl@tongji.edu.cn 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
+##############################################################################
+---
+# sample config file about the POD information, including the
+# name/IP/user/ssh key of Bare Metal Controllers/Computes/Jumperserver
+# and the ipmi information of Controllers/Computes
+#
+# The options of this config file include:
+# name: the name of this node
+# role: node's role, support role: Master/Controller/Comupte/BareMetal
+# ip: the node's IP address
+# user: the username for login
+# password: the password for login
+# ipmi_ip: the node's IPMI IP address
+# ipmi_user: the username for ipmi control
+# ipmi_password: the password for ipmi control
+
+nodes:
+-
+ name: node0
+ role: Jumpserver
+ ip: 10.1.0.2
+ user: root
+ password: root
+
+-
+ name: node1
+ role: Controller
+ ip: 10.1.0.50
+ user: root
+ password: root
+ ipmi_ip: 192.168.10.10
+ ipmi_user: root
+ ipmi_password: root
+
+-
+ name: node2
+ role: Compute
+ ip: 10.1.0.51
+ user: root
+ password: root
+ ipmi_ip: 192.168.10.11
+ ipmi_user: root
+ ipmi_password: root \ No newline at end of file
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index 2e22b83c2..0ebe9b77c 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -225,7 +225,7 @@ create_nova_flavor()
echo
echo "========== Creating yardstick-flavor =========="
# Create the nova flavor used by some sample test cases
- openstack flavor create --id 100 --ram 512 --disk 3 --vcpus 1 yardstick-flavor
+ openstack flavor create --id 100 --ram 1024 --disk 3 --vcpus 1 yardstick-flavor
# DPDK-enabled OVS requires guest memory to be backed by large pages
if [[ $DEPLOY_SCENARIO == *[_-]ovs[_-]* ]]; then
openstack flavor set --property hw:mem_page_size=large yardstick-flavor
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc025.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc025.yaml
index 443395873..c4ee237e5 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc025.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc025.yaml
@@ -11,16 +11,22 @@
schema: "yardstick:task:0.1"
description: >
Sample test case for the HA of OpenStack Controll Node abnormally shutdown.
+ In order to power on the shutdown node after testing, the jumphost is
+ required to install ipmitool. Ipmi jumphost info and each nodes' ipmi ip,
+ username, password are needed in pod file (There is a sample pod file in
+ "etc/yardstick/nodes/pod.yaml.ipmi.sample").
{% set file = file or 'etc/yardstick/nodes/fuel_virtual/pod.yaml' %}
+{% set jumphost = jumphost or 'node0' %}
scenarios:
-
type: ServiceHA
options:
attackers:
- - fault_type: "host-shutdown"
+ - fault_type: "bare-metal-down"
host: node1
+ jump_host: {{jumphost}}
monitors:
- monitor_type: "openstack-cmd"
@@ -42,6 +48,7 @@ scenarios:
nodes:
node1: node1.LF
+ node0: node0.LF
runner:
type: Iteration
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
index e0491b0d5..a6a3e96ca 100755
--- a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash
@@ -16,7 +16,10 @@ set -e
process_name=$1
if [ "$process_name" = "keystone" ]; then
- killall -9 -u $process_name
+ killall -9 -u $process_name
else
- killall -9 $process_name
+ for pid in `ps aux | grep "/usr/.*/${process_name}" | grep -v grep | grep -v /bin/sh | awk '{print $2}'`; \
+ do
+ kill -9 ${pid}
+ done
fi
diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py
index 95367b3bb..a929e5337 100644
--- a/yardstick/benchmark/scenarios/networking/ping.py
+++ b/yardstick/benchmark/scenarios/networking/ping.py
@@ -76,7 +76,10 @@ class Ping(base.Scenario):
raise RuntimeError(stderr)
if stdout:
- target_vm_name = target_vm.split('.')[0]
+ if isinstance(target_vm, dict):
+ target_vm_name = target_vm.get("name")
+ else:
+ target_vm_name = target_vm.split('.')[0]
rtt_result[target_vm_name] = float(stdout)
if "sla" in self.scenario_cfg:
sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"])