aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/compute/test_cpuload.py
diff options
context:
space:
mode:
authorJingLu5 <lvjing5@huawei.com>2017-07-24 01:39:57 +0000
committerJing Lu <lvjing5@huawei.com>2017-07-29 04:39:36 +0000
commitf089a528c30b8163f52db9e5ff09f8632bc9078e (patch)
tree4647eefc9de585ad464d37823e1551d0e77d0439 /tests/unit/benchmark/scenarios/compute/test_cpuload.py
parent362f0330b4456414b9b05e4cc0e9e7db0c753722 (diff)
Heat: support create and attach volume in heat type context
JIRA: YARDSTICK-756 Some test scenarios require VM with volume attached. This work is about supporting create and attach volume in heat type context. context: name: demo image: cirros-0.3.5 flavor: yardstick-flavor user: cirros placement_groups: pgrp1: policy: "availability" servers: athena: floating_ip: true # per-vm inline volume definition. if no volume size specified, then this # volume should be an existing volume in the openstack environment volume: yardstick-volume placement: "pgrp1" ares: # per-vm inline volume definition. if volume size is specified, then this # volume will be crated and attach to the vm volume: name: test-volume size: 10 # volume mountpoint is also configurable volume_mountpoint: /dev/vdb placement: "pgrp1" networks: test: cidr: '10.0.1.0/24' Change-Id: Ief87b313980a59eac229eb4780d93ffc929ceb66 Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios/compute/test_cpuload.py')
0 files changed, 0 insertions, 0 deletions
ght .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash -e
##############################################################################
# Copyright (c) 2017 Mirantis Inc. 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
##############################################################################

# This will generate a openstack-style config drive image suitable for
# use with cloud-init.  You may optionally pass in an ssh public key
# (using the -k/--ssh-key option) and a user-data blog (using the
# -u/--user-data option).

CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x

usage () {
	echo "usage: ${0##*/}: [--ssh-key <pubkey>] [--vendor-data <file>] [--user-data <file>] [--hostname <hostname>] <imagename>"
}

ARGS=$(getopt \
	-o k:u:v:h: \
	--long help,hostname:,ssh-key:,user-data:,vendor-data: -n "${0##*/}" \
	-- "$@")

# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
	usage >&2
	exit 2
fi

eval set -- "$ARGS"

while :; do
	case "$1" in
		--help)
			usage
			exit 0
			;;
		-k|--ssh-key)
			ssh_key="$2"
			shift 2
			;;
		-u|--user-data)
			user_data="$2"
			shift 2
			;;
		-v|--vendor-data)
			vendor_data="$2"
			shift 2
			;;
		-h|--hostname)
			hostname="$2"
			shift 2
			;;
		--)	shift
			break
			;;
	esac
done

config_image=$1
shift

if [ "${ssh_key}" ] && [ -f "${ssh_key}" ]; then
	echo "adding pubkey from ${ssh_key}"
	ssh_key_data=$(cat "${ssh_key}")
fi

uuid=$(uuidgen)
if ! [ "${hostname}" ]; then
	hostname="${uuid}"
fi

trap 'rm -rf $config_dir' EXIT
config_dir=$(mktemp -t -d configXXXXXX)

if [ "${user_data}" ] && [ -f "${user_data}" ]; then
	echo "adding user data from ${user_data}"
	cp "${user_data}" "${config_dir}/user-data"
else
	touch "${config_dir}/user-data"
fi

if [ "${vendor_data}" ] && [ -f "${vendor_data}" ]; then
	echo "adding vendor data from ${vendor_data}"
	cp "${vendor_data}" "${config_dir}/vendor-data"
fi

cat > "${config_dir}/meta-data" <<-EOF
instance-id: ${uuid}
hostname: ${hostname}
local-hostname: ${hostname}
EOF

if [ "${ssh_key_data}" ]; then
	cat >> "${config_dir}/meta-data" <<-EOF
	public-keys:
	  - |
	    ${ssh_key_data}
	EOF
fi

#PS1="debug> " bash --norc

echo "generating configuration image at ${config_image}"
if ! mkisofs -o "${config_image}" -V cidata -r -J --quiet "${config_dir}"; then
	echo "ERROR: failed to create ${config_image}" >&2
	exit 1
fi
chmod a+r "${config_image}"