[Bug Fix] Support nova create instance operation 27/53027/4
authorDimitrios Markou <mardim@intracom-telecom.com>
Sat, 3 Mar 2018 01:26:41 +0000 (03:26 +0200)
committerDimitrios Markou <mardim@intracom-telecom.com>
Fri, 9 Mar 2018 09:36:28 +0000 (11:36 +0200)
Add the ability to create a nova instance through the
operation perspective

JIRA: YARDSTICK-1038

Change-Id: Idac141958d65cc6c53b6bd27df83ac74ae8804ec
Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
yardstick/benchmark/scenarios/availability/ha_tools/nova/create_instance_from_image.bash [new file with mode: 0644]
yardstick/benchmark/scenarios/availability/ha_tools/nova/delete_instance.bash [new file with mode: 0644]

diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/nova/create_instance_from_image.bash b/yardstick/benchmark/scenarios/availability/ha_tools/nova/create_instance_from_image.bash
new file mode 100644 (file)
index 0000000..5e0b1cc
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom 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
+##############################################################################
+
+# create nova server
+# parameters: $1 - server name, $2 - image name, $3 - flavor name, $4 - network name
+
+set -e
+
+if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
+    SECURE="--insecure"
+else
+    SECURE=""
+fi
+
+NETNAME="$(openstack ${SECURE} network list -f value -c Name | grep $4)"
+
+openstack ${SECURE} server create $1 --image $2 --flavor $3 --network ${NETNAME}
+
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/nova/delete_instance.bash b/yardstick/benchmark/scenarios/availability/ha_tools/nova/delete_instance.bash
new file mode 100644 (file)
index 0000000..008e7f5
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom 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
+##############################################################################
+
+# delete nova server
+# parameters: $1 - server name
+
+set -e
+
+if [ $OS_INSECURE ] && [ "$(echo $OS_INSECURE | tr '[:upper:]' '[:lower:]')" = "true" ]; then
+    SECURE="--insecure"
+else
+    SECURE=""
+fi
+
+openstack ${SECURE} server delete $1
+