From 02a0f99d02a6834a5206d2587e5377794c072349 Mon Sep 17 00:00:00 2001 From: Andrey Pavlov Date: Thu, 18 Jun 2015 15:26:17 +0300 Subject: [PATCH] Adding Grenade support for Sahara Grenade is an OpenStack test harness to exercise the upgrade process between releases. This patch adds ability of Sahara upgrade testing. Change-Id: Iacc1225d92aad3aee4e6cda6be4d9691be49d927 --- devstack/upgrade/cluster-create.json | 8 + devstack/upgrade/cluster-template.json | 17 ++ devstack/upgrade/ng-master.json | 10 ++ devstack/upgrade/ng-worker.json | 10 ++ devstack/upgrade/resources.sh | 231 +++++++++++++++++++++++++ devstack/upgrade/settings | 13 ++ devstack/upgrade/shutdown.sh | 21 +++ devstack/upgrade/upgrade.sh | 71 ++++++++ 8 files changed, 381 insertions(+) create mode 100644 devstack/upgrade/cluster-create.json create mode 100644 devstack/upgrade/cluster-template.json create mode 100644 devstack/upgrade/ng-master.json create mode 100644 devstack/upgrade/ng-worker.json create mode 100755 devstack/upgrade/resources.sh create mode 100644 devstack/upgrade/settings create mode 100755 devstack/upgrade/shutdown.sh create mode 100755 devstack/upgrade/upgrade.sh diff --git a/devstack/upgrade/cluster-create.json b/devstack/upgrade/cluster-create.json new file mode 100644 index 00000000..042f7493 --- /dev/null +++ b/devstack/upgrade/cluster-create.json @@ -0,0 +1,8 @@ +{ + "name": "cluster-grenade", + "plugin_name": "fake", + "hadoop_version": "0.1", + "cluster_template_id" : "CLUSTER_TEMPLATE_ID", + "user_keypair_id": "KEYPAIR", + "default_image_id": "IMAGE_ID" +} diff --git a/devstack/upgrade/cluster-template.json b/devstack/upgrade/cluster-template.json new file mode 100644 index 00000000..5d452b72 --- /dev/null +++ b/devstack/upgrade/cluster-template.json @@ -0,0 +1,17 @@ +{ + "name": "cluster-template-grenade", + "plugin_name": "fake", + "hadoop_version": "0.1", + "node_groups": [ + { + "name": "master", + "node_group_template_id": "NG_MASTER_ID", + "count": 1 + }, + { + "name": "worker", + "node_group_template_id": "NG_WORKER_ID", + "count": 1 + } + ] +} diff --git a/devstack/upgrade/ng-master.json b/devstack/upgrade/ng-master.json new file mode 100644 index 00000000..d69c6157 --- /dev/null +++ b/devstack/upgrade/ng-master.json @@ -0,0 +1,10 @@ +{ + "name": "ng-master-grenade", + "flavor_id": "FLAVOR_ID", + "plugin_name": "fake", + "hadoop_version": "0.1", + "node_processes": ["jobtracker", "namenode"], + "auto_security_group": false, + "security_groups": ["SEC_GROUP"], + "floating_ip_pool": "FLOATING_IP_POOL" +} diff --git a/devstack/upgrade/ng-worker.json b/devstack/upgrade/ng-worker.json new file mode 100644 index 00000000..eda79f67 --- /dev/null +++ b/devstack/upgrade/ng-worker.json @@ -0,0 +1,10 @@ +{ + "name": "ng-worker-grenade", + "flavor_id": "FLAVOR_ID", + "plugin_name": "fake", + "hadoop_version": "0.1", + "node_processes": ["tasktracker", "datanode"], + "auto_security_group": false, + "security_groups": ["SEC_GROUP"], + "floating_ip_pool": "FLOATING_IP_POOL" +} diff --git a/devstack/upgrade/resources.sh b/devstack/upgrade/resources.sh new file mode 100755 index 00000000..4c2ac498 --- /dev/null +++ b/devstack/upgrade/resources.sh @@ -0,0 +1,231 @@ +#!/bin/bash + +set -o errexit + +source $GRENADE_DIR/grenaderc +source $GRENADE_DIR/functions + +source $TOP_DIR/openrc admin admin + +set -o xtrace + +SAHARA_USER=sahara_grenade +SAHARA_PROJECT=sahara_grenade +SAHARA_PASS=pass +SAHARA_SERVER=sahara_server1 +SAHARA_KEY=sahara_key +SAHARA_KEY_FILE=$SAVE_DIR/sahara_key.pem + +JSON_PATH=`dirname $BASH_SOURCE` +DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.small} +PUBLIC_NETWORK_NAME=${PUBLIC_NETWORK_NAME:-public} +PRIVATE_NETWORK_NAME=${PRIVATE_NETWORK_NAME:-private} +# cirros image is not appropriate for cluster creation +SAHARA_IMAGE_NAME=${SAHARA_IMAGE_NAME:-fedora-20.x86_64} +SAHARA_IMAGE_USER=${SAHARA_IMAGE_USER:-fedora} + +function _sahara_set_user { + OS_TENANT_NAME=$SAHARA_PROJECT + OS_USERNAME=$SAHARA_USER + OS_PASSWORD=$SAHARA_PASS +} + +function register_image { + eval $(openstack image show -f shell -c id $SAHARA_IMAGE_NAME) + resource_save sahara image_id $id + sahara image-register --id $id --username $SAHARA_IMAGE_USER + sahara image-add-tag --id $id --tag fake + sahara image-add-tag --id $id --tag 0.1 + echo $id +} + +# args: