Rename from reddwarf to trove.
Implements Blueprint reddwarf-trove-rename Change-Id: I67d3452c04cbc31306cd5cc8608bda6d0c71e20e
This commit is contained in:
parent
f23c563434
commit
5a48d23bfe
|
@ -6,7 +6,7 @@
|
||||||
"nova":null,
|
"nova":null,
|
||||||
"python_keystoneclient":null,
|
"python_keystoneclient":null,
|
||||||
"python_novaclient":null,
|
"python_novaclient":null,
|
||||||
"reddwarf":null,
|
"trove":null,
|
||||||
"python_reddwarfclient":null,
|
"python_troveclient":null,
|
||||||
"tempest":null
|
"tempest":null
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"dbaas_url":"http://%service_host%:8779/v1.0",
|
"dbaas_url":"http://%service_host%:8779/v1.0",
|
||||||
"version_url":"http://%service_host%:8779",
|
"version_url":"http://%service_host%:8779",
|
||||||
"reddwarf_auth_url":"http://%service_host%:35357/v2.0/tokens",
|
"trove_auth_url":"http://%service_host%:35357/v2.0/tokens",
|
||||||
"reddwarf_client_insecure":false,
|
"trove_client_insecure":false,
|
||||||
"auth_strategy":null,
|
"auth_strategy":null,
|
||||||
"reddwarf_client_region_name": null,
|
"trove_client_region_name": null,
|
||||||
|
|
||||||
"nova_client": {
|
"nova_client": {
|
||||||
"url":"http://%service_host%:8774/v1.1",
|
"url":"http://%service_host%:8774/v1.1",
|
||||||
|
@ -36,41 +36,41 @@
|
||||||
"keystone_code_root":"%keystone_path%",
|
"keystone_code_root":"%keystone_path%",
|
||||||
"keystone_conf":"/etc/keystone/keystone.conf",
|
"keystone_conf":"/etc/keystone/keystone.conf",
|
||||||
"keystone_use_combined":true,
|
"keystone_use_combined":true,
|
||||||
"reddwarf_code_root":"%reddwarf_path%",
|
"trove_code_root":"%trove_path%",
|
||||||
"reddwarf_conf":"/tmp/reddwarf.conf",
|
"trove_conf":"/tmp/trove.conf",
|
||||||
"reddwarf_version":"v1.0",
|
"trove_version":"v1.0",
|
||||||
"reddwarf_api_updated":"2012-08-01T00:00:00Z",
|
"trove_api_updated":"2012-08-01T00:00:00Z",
|
||||||
"reddwarf_volume_support":true,
|
"trove_volume_support":true,
|
||||||
"reddwarf_max_accepted_volume_size": 1000,
|
"trove_max_accepted_volume_size": 1000,
|
||||||
"reddwarf_max_instances_per_user": 55,
|
"trove_max_instances_per_user": 55,
|
||||||
"reddwarf_max_volumes_per_user": 100,
|
"trove_max_volumes_per_user": 100,
|
||||||
"use_reaper":false,
|
"use_reaper":false,
|
||||||
"users": [
|
"users": [
|
||||||
{ "auth_user":"radmin",
|
{ "auth_user":"radmin",
|
||||||
"auth_key":"radmin",
|
"auth_key":"radmin",
|
||||||
"tenant":"reddwarf",
|
"tenant":"trove",
|
||||||
"tenant_id":"%reddwarf_tenant_id%",
|
"tenant_id":"%trove_tenant_id%",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":true,
|
"is_admin":true,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "auth_user":"boss",
|
{ "auth_user":"boss",
|
||||||
"auth_key":"admin",
|
"auth_key":"admin",
|
||||||
"tenant":"reddwarf",
|
"tenant":"trove",
|
||||||
"tenant_id":"%reddwarf_tenant_id%",
|
"tenant_id":"%trove_tenant_id%",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":true,
|
"is_admin":true,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "auth_user":"chunk",
|
{ "auth_user":"chunk",
|
||||||
"auth_key":"chunk",
|
"auth_key":"chunk",
|
||||||
"tenant":"reddwarf",
|
"tenant":"trove",
|
||||||
"tenant_id":"%reddwarf_tenant_id%",
|
"tenant_id":"%trove_tenant_id%",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "auth_user":"daffy",
|
{ "auth_user":"daffy",
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
"tenant_id":"%daffy_tenant_id%",
|
"tenant_id":"%daffy_tenant_id%",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "auth_user":"demo",
|
{ "auth_user":"demo",
|
||||||
|
@ -98,9 +98,9 @@
|
||||||
"management_api_disabled": true,
|
"management_api_disabled": true,
|
||||||
"dbaas_image": 1,
|
"dbaas_image": 1,
|
||||||
"dbaas_image": 1,
|
"dbaas_image": 1,
|
||||||
"dns_driver":"reddwarf.dns.rsdns.driver.RsDnsDriver",
|
"dns_driver":"trove.dns.rsdns.driver.RsDnsDriver",
|
||||||
"dns_instance_entry_factory":"reddwarf.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
"dns_instance_entry_factory":"trove.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
||||||
"reddwarf_dns_support": false,
|
"trove_dns_support": false,
|
||||||
"databases_page_size": 20,
|
"databases_page_size": 20,
|
||||||
"instances_page_size": 20,
|
"instances_page_size": 20,
|
||||||
"users_page_size": 20,
|
"users_page_size": 20,
|
||||||
|
|
|
@ -24,8 +24,8 @@ class Config(object):
|
||||||
'nova': "/opt/stack/nova",
|
'nova': "/opt/stack/nova",
|
||||||
'python_keystoneclient': "/opt/stack/python-keystoneclient",
|
'python_keystoneclient': "/opt/stack/python-keystoneclient",
|
||||||
'python_novaclient': "/opt/stack/python-novaclient",
|
'python_novaclient': "/opt/stack/python-novaclient",
|
||||||
'reddwarf':"/opt/stack/reddwarf",
|
'trove':"/opt/stack/trove",
|
||||||
'python_reddwarfclient':"/opt/stack/python-reddwarfclient",
|
'python_troveclient':"/opt/stack/python-troveclient",
|
||||||
'tempest':"/opt/stack/tempest"
|
'tempest':"/opt/stack/tempest"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
deb http://%network_gateway%:8090/debian squeeze main
|
deb http://10.0.0.1:8090/debian squeeze main
|
|
@ -10,18 +10,18 @@ TEMPFILE=`mktemp`
|
||||||
echo "GUEST_USERNAME ALL=(ALL) NOPASSWD:ALL" > $TEMPFILE
|
echo "GUEST_USERNAME ALL=(ALL) NOPASSWD:ALL" > $TEMPFILE
|
||||||
chmod 0440 $TEMPFILE
|
chmod 0440 $TEMPFILE
|
||||||
sudo chown root:root $TEMPFILE
|
sudo chown root:root $TEMPFILE
|
||||||
sudo mv $TEMPFILE /etc/sudoers.d/60_reddwarf_guest
|
sudo mv $TEMPFILE /etc/sudoers.d/60_trove_guest
|
||||||
|
|
||||||
# Copies all the reddwarf code to the guest image
|
# Copies all the trove code to the guest image
|
||||||
sudo -u GUEST_USERNAME rsync -e'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' -avz --exclude='.*' HOST_USERNAME@NETWORK_GATEWAY:PATH_REDDWARF/ /home/GUEST_USERNAME/reddwarf
|
sudo -u GUEST_USERNAME rsync -e'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' -avz --exclude='.*' HOST_USERNAME@NETWORK_GATEWAY:PATH_TROVE/ /home/GUEST_USERNAME/trove
|
||||||
|
|
||||||
# Do an apt-get update since its SUPER slow first time
|
# Do an apt-get update since its SUPER slow first time
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
# Disable AppArmor so that reddwarf guestagent can change the conf
|
# Disable AppArmor so that trove guestagent can change the conf
|
||||||
# TODO this should probably be done in the guest and then re-enabled install
|
# TODO this should probably be done in the guest and then re-enabled install
|
||||||
ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
|
ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
|
||||||
apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
|
apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
|
||||||
|
|
||||||
# Starts the reddwarf guestagent (using the upstart script)
|
# Starts the trove guestagent (using the upstart script)
|
||||||
service reddwarf-guest start
|
service trove-guest start
|
||||||
|
|
|
@ -14,11 +14,11 @@ source $_LIB/die
|
||||||
[ -n "${GUEST_USERNAME}" ] || die "GUEST_USERNAME needs to be set to the user for the guest image"
|
[ -n "${GUEST_USERNAME}" ] || die "GUEST_USERNAME needs to be set to the user for the guest image"
|
||||||
[ -n "${HOST_USERNAME}" ] || die "HOST_USERNAME needs to be set to the user for the host instance"
|
[ -n "${HOST_USERNAME}" ] || die "HOST_USERNAME needs to be set to the user for the host instance"
|
||||||
[ -n "${NETWORK_GATEWAY}" ] || die "NETWORK_GATEWAY needs to be set to the user for the host instance"
|
[ -n "${NETWORK_GATEWAY}" ] || die "NETWORK_GATEWAY needs to be set to the user for the host instance"
|
||||||
[ -n "${REDSTACK_SCRIPTS}" ] || die "REDSTACK_SCRIPTS needs to be set to the reddwarf-integration scripts dir"
|
[ -n "${REDSTACK_SCRIPTS}" ] || die "REDSTACK_SCRIPTS needs to be set to the trove-integration scripts dir"
|
||||||
[ -n "${SERVICE_TYPE}" ] || die "SERVICE_TYPE must be set to something like mysql to create upstart conf"
|
[ -n "${SERVICE_TYPE}" ] || die "SERVICE_TYPE must be set to something like mysql to create upstart conf"
|
||||||
|
|
||||||
# put this file in first-boot.d directory so that it is executed on startup
|
# put this file in first-boot.d directory so that it is executed on startup
|
||||||
sed "s/GUEST_USERNAME/${GUEST_USERNAME}/g;s/HOST_USERNAME/${HOST_USERNAME}/g;s/NETWORK_GATEWAY/${NETWORK_GATEWAY}/g;s/PATH_REDDWARF/${ESCAPED_PATH_REDDWARF}/g" ${REDSTACK_SCRIPTS}/files/bootstrap_init-mysql.sh > ${TMP_HOOKS_PATH}/first-boot.d/60-bootstrap_init-mysql
|
sed "s/GUEST_USERNAME/${GUEST_USERNAME}/g;s/HOST_USERNAME/${HOST_USERNAME}/g;s/NETWORK_GATEWAY/${NETWORK_GATEWAY}/g;s/PATH_TROVE/${ESCAPED_PATH_TROVE}/g" ${REDSTACK_SCRIPTS}/files/bootstrap_init-mysql.sh > ${TMP_HOOKS_PATH}/first-boot.d/60-bootstrap_init-mysql
|
||||||
chmod 775 ${TMP_HOOKS_PATH}/first-boot.d/60-bootstrap_init-mysql
|
chmod 775 ${TMP_HOOKS_PATH}/first-boot.d/60-bootstrap_init-mysql
|
||||||
|
|
||||||
sed "s/GUEST_USERNAME/${GUEST_USERNAME}/g" ${REDSTACK_SCRIPTS}/files/reddwarf-guest.upstart.conf > ${TMP_HOOKS_PATH}/reddwarf-guest.conf
|
sed "s/GUEST_USERNAME/${GUEST_USERNAME}/g" ${REDSTACK_SCRIPTS}/files/trove-guest.upstart.conf > ${TMP_HOOKS_PATH}/trove-guest.conf
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# CONTEXT: GUEST during CONSTUCTION as ROOT
|
# CONTEXT: GUEST during CONSTUCTION as ROOT
|
||||||
# PURPOSE: adds the reddwarf host as an apt repo to get so that the guest can get the conf file for mysql
|
# PURPOSE: adds the trove host as an apt repo to get so that the guest can get the conf file for mysql
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
@ -10,4 +10,4 @@ source $_LIB/die
|
||||||
|
|
||||||
[ -n "$TMP_HOOKS_PATH." ] || die "Temp hook path not set"
|
[ -n "$TMP_HOOKS_PATH." ] || die "Temp hook path not set"
|
||||||
|
|
||||||
cat ${REDSTACK_SCRIPTS}/files/apt_repo.list > ${TMP_HOOKS_PATH}/reddwarf-source-host.list
|
cat ${REDSTACK_SCRIPTS}/files/apt_repo.list > ${TMP_HOOKS_PATH}/trove-source-host.list
|
|
@ -6,7 +6,7 @@ set -o xtrace
|
||||||
# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
|
# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
|
||||||
# PURPOSE: creates the SSH key on the host if it doesn't exist. Then this copies the keys over to a staging area where
|
# PURPOSE: creates the SSH key on the host if it doesn't exist. Then this copies the keys over to a staging area where
|
||||||
# they will be duplicated in the guest VM.
|
# they will be duplicated in the guest VM.
|
||||||
# This process allows the host to log into the guest but more importantly the guest phones home to get the reddwarf
|
# This process allows the host to log into the guest but more importantly the guest phones home to get the trove
|
||||||
# source
|
# source
|
||||||
|
|
||||||
source $_LIB/die
|
source $_LIB/die
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
||||||
# PURPOSE: Install reddwarf guest python dependencies - see redstack functions_qemu
|
# PURPOSE: Install trove guest python dependencies - see redstack functions_qemu
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -o xtrace
|
set -o xtrace
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
||||||
|
# PURPOSE: take "staged" trove-guest.conf file and put it in the init directory on guest image
|
||||||
|
|
||||||
|
dd if=/tmp/in_target.d/trove-guest.conf of=/etc/init/trove-guest.conf
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
||||||
# PURPOSE: Add the guest image user that will own the reddwarf agent source...if the user does not already exist
|
# PURPOSE: Add the guest image user that will own the trove agent source...if the user does not already exist
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -o xtrace
|
set -o xtrace
|
|
@ -7,4 +7,4 @@ set -e
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
|
|
||||||
sudo dd if=/tmp/in_target.d/reddwarf-source-host.list of=/etc/apt/sources.list.d/reddwarf-source-host.list
|
sudo dd if=/tmp/in_target.d/trove-source-host.list of=/etc/apt/sources.list.d/trove-source-host.list
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
|
||||||
# PURPOSE: take "staged" reddwarf-guest.conf file and put it in the init directory on guest image
|
|
||||||
|
|
||||||
dd if=/tmp/in_target.d/reddwarf-guest.conf of=/etc/init/reddwarf-guest.conf
|
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,4 @@ pre-start script
|
||||||
chown GUEST_USERNAME:root /var/lock/reddwarf/
|
chown GUEST_USERNAME:root /var/lock/reddwarf/
|
||||||
end script
|
end script
|
||||||
|
|
||||||
exec su -c "/home/GUEST_USERNAME/reddwarf/bin/reddwarf-guestagent --config-file=/etc/guest_info --config-file=/home/GUEST_USERNAME/reddwarf/etc/reddwarf/reddwarf-guestagent.conf.sample" GUEST_USERNAME
|
exec su -c "/home/GUEST_USERNAME/trove/bin/trove-guestagent --config-file=/etc/guest_info --config-file=/home/GUEST_USERNAME/trove/etc/trove/trove-guestagent.conf.sample" GUEST_USERNAME
|
|
@ -22,7 +22,7 @@ function build_vm() {
|
||||||
|
|
||||||
readonly SSH_DIR=${HOMEDIR}/.ssh
|
readonly SSH_DIR=${HOMEDIR}/.ssh
|
||||||
manage_ssh_keys
|
manage_ssh_keys
|
||||||
MYSQL_ELEMENT="reddwarf-${SERVICE_TYPE}"
|
MYSQL_ELEMENT="${SERVICE_TYPE}"
|
||||||
|
|
||||||
mkdir -p $VM_PATH
|
mkdir -p $VM_PATH
|
||||||
export RELEASE=precise
|
export RELEASE=precise
|
||||||
|
@ -33,9 +33,10 @@ function build_vm() {
|
||||||
export NETWORK_GATEWAY
|
export NETWORK_GATEWAY
|
||||||
export REDSTACK_SCRIPTS
|
export REDSTACK_SCRIPTS
|
||||||
export SERVICE_TYPE
|
export SERVICE_TYPE
|
||||||
export ESCAPED_PATH_REDDWARF
|
export ESCAPED_PATH_TROVE
|
||||||
export SSH_DIR
|
export SSH_DIR
|
||||||
${PATH_DISKIMAGEBUILDER}/bin/disk-image-create -a amd64 -o "${VM_PATH}/${UBUNTU_DISTRO_NAME}_mysql_image" -x vm reddwarf-guest ${MYSQL_ELEMENT}
|
export ELEMENTS_PATH=$REDSTACK_SCRIPTS/files/elements
|
||||||
|
${PATH_DISKIMAGEBUILDER}/bin/disk-image-create -a amd64 -o "${VM_PATH}/${UBUNTU_DISTRO_NAME}_mysql_image" -x vm guest ${MYSQL_ELEMENT}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_build_image() {
|
function cmd_build_image() {
|
||||||
|
@ -52,7 +53,7 @@ function cmd_build_image() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf.conf DEFAULT service_type $SERVICE_TYPE
|
iniset $TROVE_CONF_DIR/trove.conf DEFAULT service_type $SERVICE_TYPE
|
||||||
|
|
||||||
USERNAME=`whoami`
|
USERNAME=`whoami`
|
||||||
mkdir -p $USERHOME/images
|
mkdir -p $USERHOME/images
|
||||||
|
@ -70,10 +71,10 @@ function cmd_build_image() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
QCOW_IMAGE=`find $VM_PATH -name '*.qcow2'`
|
QCOW_IMAGE=`find $VM_PATH -name '*.qcow2'`
|
||||||
REDDWARF_TOKEN=`retrieve_token reddwarf REDDWARF-PASS reddwarf`
|
TROVE_TOKEN=`retrieve_token trove TROVE-PASS trove`
|
||||||
|
|
||||||
# Now upload it
|
# Now upload it
|
||||||
upload_image_to_glance "${UBUNTU_DISTRO_NAME}_${SERVICE_TYPE}_image" ovf qcow2 $REDDWARF_TOKEN $QCOW_IMAGE $SERVICE_TYPE
|
upload_image_to_glance "${UBUNTU_DISTRO_NAME}_${SERVICE_TYPE}_image" ovf qcow2 $TROVE_TOKEN $QCOW_IMAGE $SERVICE_TYPE
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean_instances() {
|
function clean_instances() {
|
||||||
|
|
294
scripts/local.sh
294
scripts/local.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# local.sh to install reddwarf
|
# local.sh to install trove
|
||||||
# Install and start Reddwarf (DBaaS) service
|
# Install and start Trove (DBaaS) service
|
||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# - functions
|
# - functions
|
||||||
|
@ -16,7 +16,7 @@ DEST=${DEST:-/opt/stack}
|
||||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||||
source $TOP_DIR/stackrc
|
source $TOP_DIR/stackrc
|
||||||
source $TOP_DIR/localrc
|
source $TOP_DIR/localrc
|
||||||
ENABLED_SERVICES+=,reddwarf,rd-api,rd-tmgr
|
ENABLED_SERVICES+=,trove,rd-api,rd-tmgr
|
||||||
source $TOP_DIR/functions
|
source $TOP_DIR/functions
|
||||||
source $TOP_DIR/lib/database
|
source $TOP_DIR/lib/database
|
||||||
|
|
||||||
|
@ -49,35 +49,35 @@ DATABASE_PASSWORD=${DATABASE_PASSWORD:-$MYSQL_PASSWORD}
|
||||||
BASE_SQL_CONN=${BASE_SQL_CONN:-${DATABASE_TYPE}://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST}
|
BASE_SQL_CONN=${BASE_SQL_CONN:-${DATABASE_TYPE}://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST}
|
||||||
|
|
||||||
# Set up default configuration
|
# Set up default configuration
|
||||||
REDDWARF_DIR=$DEST/reddwarf/
|
TROVE_DIR=$DEST/trove/
|
||||||
REDDWARFCLIENT_DIR=$DEST/python-reddwarfclient/
|
TROVECLIENT_DIR=$DEST/python-troveclient/
|
||||||
REDDWARF_PACKAGES_DIR=/var/lib/packages/debian/
|
TROVE_PACKAGES_DIR=/var/lib/packages/debian/
|
||||||
REDDWARF_BUILD_DIR=/tmp/build/
|
TROVE_BUILD_DIR=/tmp/build/
|
||||||
REDDWARF_INTEGRATION_CONF_DIR=/tmp/reddwarf-integration/
|
TROVE_INTEGRATION_CONF_DIR=/tmp/trove-integration/
|
||||||
REDDWARF_ENV_CONF_PATH=$REDDWARF_INTEGRATION_CONF_DIR/env.rc
|
TROVE_ENV_CONF_PATH=$TROVE_INTEGRATION_CONF_DIR/env.rc
|
||||||
REDDWARF_CONF_DIR=/etc/reddwarf/
|
TROVE_CONF_DIR=/etc/trove/
|
||||||
REDDWARF_LOCAL_CONF_DIR=$REDDWARF_DIR/etc/reddwarf/
|
TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove/
|
||||||
REDDWARF_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0
|
TROVE_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0
|
||||||
REDDWARF_LOGDIR=${REDDWARF_LOGDIR:-/var/log/reddwarf}
|
TROVE_LOGDIR=${TROVE_LOGDIR:-/var/log/trove}
|
||||||
REDDWARF_AUTH_CACHE_DIR=${REDDWARF_AUTH_CACHE_DIR:-/var/cache/reddwarf}
|
TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
|
||||||
|
|
||||||
# Set Reddwarf interface related configuration
|
# Set Trove interface related configuration
|
||||||
REDDWARF_SERVICE_HOST=${REDDWARF_SERVICE_HOST:-$SERVICE_HOST}
|
TROVE_SERVICE_HOST=${TROVE_SERVICE_HOST:-$SERVICE_HOST}
|
||||||
REDDWARF_SERVICE_PORT=${REDDWARF_SERVICE_PORT:-8779}
|
TROVE_SERVICE_PORT=${TROVE_SERVICE_PORT:-8779}
|
||||||
REDDWARF_SERVICE_PROTOCOL=${REDDWARF_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
TROVE_SERVICE_PROTOCOL=${TROVE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
||||||
|
|
||||||
# reddwarf service git paths
|
# trove service git paths
|
||||||
GIT_BASE=https://github.com
|
GIT_BASE=https://github.com
|
||||||
REDDWARF_REPO=${GIT_BASE}/openstack/trove.git
|
TROVE_REPO=${GIT_BASE}/openstack/trove.git
|
||||||
REDDWARF_BRANCH=master
|
TROVE_BRANCH=master
|
||||||
REDDWARFCLIENT_REPO=${GIT_BASE}/openstack/python-troveclient.git
|
TROVECLIENT_REPO=${GIT_BASE}/openstack/python-troveclient.git
|
||||||
REDDWARFCLIENT_BRANCH=master
|
TROVECLIENT_BRANCH=master
|
||||||
|
|
||||||
# Support potential entry-points for console scripts
|
# Support potential entry-points for console scripts
|
||||||
if [ -d $REDDWARF_DIR/bin ] ; then
|
if [ -d $TROVE_DIR/bin ] ; then
|
||||||
REDDWARF_BIN_DIR=$REDDWARF_DIR/bin
|
TROVE_BIN_DIR=$TROVE_DIR/bin
|
||||||
else
|
else
|
||||||
REDDWARF_BIN_DIR=/usr/local/bin
|
TROVE_BIN_DIR=/usr/local/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -98,34 +98,34 @@ function msgout() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_mysql_nova() {
|
function trove_mysql_nova() {
|
||||||
echo mysql nova --execute "$@"
|
echo mysql nova --execute "$@"
|
||||||
mysql -u root -p$DATABASE_PASSWORD nova --execute "$@"
|
mysql -u root -p$DATABASE_PASSWORD nova --execute "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_manage() {
|
function trove_manage() {
|
||||||
cd $REDDWARF_DIR
|
cd $TROVE_DIR
|
||||||
bin/reddwarf-manage --config-file=$REDDWARF_CONF_DIR/reddwarf.conf $@
|
bin/trove-manage --config-file=$TROVE_CONF_DIR/trove.conf $@
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Configure Keystone for Reddwarf related helper functions
|
# Configure Keystone for Trove related helper functions
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function reddwarf_get_attribute_id() {
|
function trove_get_attribute_id() {
|
||||||
keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-list | grep $2 | get_field $3
|
keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-list | grep $2 | get_field $3
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_add_keystone_user() {
|
function trove_add_keystone_user() {
|
||||||
# Adds a user. Prints the UUID to standard out.
|
# Adds a user. Prints the UUID to standard out.
|
||||||
USER_NAME=$1
|
USER_NAME=$1
|
||||||
USER_PASS=$2
|
USER_PASS=$2
|
||||||
USER_EMAIL=$3
|
USER_EMAIL=$3
|
||||||
USER_TENANT=$4
|
USER_TENANT=$4
|
||||||
# Create the user "reddwarf"
|
# Create the user "trove"
|
||||||
USER_UUID=`reddwarf_get_attribute_id user $USER_NAME 1`
|
USER_UUID=`trove_get_attribute_id user $USER_NAME 1`
|
||||||
if [ -z "$USER_UUID" ]; then
|
if [ -z "$USER_UUID" ]; then
|
||||||
USER_UUID=$(keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN user-create \
|
USER_UUID=$(keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN user-create \
|
||||||
--name=$USER_NAME \
|
--name=$USER_NAME \
|
||||||
--pass=$USER_PASS \
|
--pass=$USER_PASS \
|
||||||
--email=$USER_EMAIL \
|
--email=$USER_EMAIL \
|
||||||
|
@ -135,103 +135,103 @@ function reddwarf_add_keystone_user() {
|
||||||
echo $USER_UUID
|
echo $USER_UUID
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_create_keystone_user_role() {
|
function trove_create_keystone_user_role() {
|
||||||
TENANT_UUID=$1
|
TENANT_UUID=$1
|
||||||
USER_UUID=$2
|
USER_UUID=$2
|
||||||
ROLE_UUID=$3
|
ROLE_UUID=$3
|
||||||
keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN user-role-add \
|
keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN user-role-add \
|
||||||
--tenant_id $TENANT_UUID \
|
--tenant_id $TENANT_UUID \
|
||||||
--user_id $USER_UUID \
|
--user_id $USER_UUID \
|
||||||
--role_id $ROLE_UUID
|
--role_id $ROLE_UUID
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_create() {
|
function trove_create() {
|
||||||
keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-create \
|
keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-create \
|
||||||
--name $2 \
|
--name $2 \
|
||||||
| grep " id " | get_field 2
|
| grep " id " | get_field 2
|
||||||
}
|
}
|
||||||
|
|
||||||
function reddwarf_configure_keystone() {
|
function trove_configure_keystone() {
|
||||||
msgout "DEBUG" "Configuring keystone..."
|
msgout "DEBUG" "Configuring keystone..."
|
||||||
# Create the "reddwarf" tenant
|
# Create the "trove" tenant
|
||||||
# First we should check if these exist
|
# First we should check if these exist
|
||||||
REDDWARF_TENANT=`reddwarf_get_attribute_id tenant reddwarf 1`
|
TROVE_TENANT=`trove_get_attribute_id tenant trove 1`
|
||||||
if [ -z "$REDDWARF_TENANT" ]; then
|
if [ -z "$TROVE_TENANT" ]; then
|
||||||
REDDWARF_TENANT=$(reddwarf_create tenant reddwarf)
|
TROVE_TENANT=$(trove_create tenant trove)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the reddwarf role if it doesn't exist.
|
# Create the trove role if it doesn't exist.
|
||||||
# Admin role should already exist
|
# Admin role should already exist
|
||||||
ADMIN_ROLE=`reddwarf_get_attribute_id role admin 1`
|
ADMIN_ROLE=`trove_get_attribute_id role admin 1`
|
||||||
REDDWARF_ROLE=`reddwarf_get_attribute_id role reddwarf 1`
|
TROVE_ROLE=`trove_get_attribute_id role trove 1`
|
||||||
if [ -z "$REDDWARF_ROLE" ]; then
|
if [ -z "$TROVE_ROLE" ]; then
|
||||||
REDDWARF_ROLE=$(reddwarf_create role reddwarf)
|
TROVE_ROLE=$(trove_create role trove)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REDDWARF_USER=$(reddwarf_add_keystone_user reddwarf REDDWARF-PASS reddwarf@example.com $REDDWARF_TENANT)
|
TROVE_USER=$(trove_add_keystone_user trove TROVE-PASS trove@example.com $TROVE_TENANT)
|
||||||
reddwarf_create_keystone_user_role $REDDWARF_TENANT $REDDWARF_USER $REDDWARF_ROLE
|
trove_create_keystone_user_role $TROVE_TENANT $TROVE_USER $TROVE_ROLE
|
||||||
|
|
||||||
RADMIN_USER=$(reddwarf_add_keystone_user radmin radmin radmin@example.com $REDDWARF_TENANT)
|
RADMIN_USER=$(trove_add_keystone_user radmin radmin radmin@example.com $TROVE_TENANT)
|
||||||
reddwarf_create_keystone_user_role $REDDWARF_TENANT $RADMIN_USER $REDDWARF_ROLE
|
trove_create_keystone_user_role $TROVE_TENANT $RADMIN_USER $TROVE_ROLE
|
||||||
reddwarf_create_keystone_user_role $REDDWARF_TENANT $RADMIN_USER $ADMIN_ROLE
|
trove_create_keystone_user_role $TROVE_TENANT $RADMIN_USER $ADMIN_ROLE
|
||||||
|
|
||||||
mkdir -p ${REDDWARF_INTEGRATION_CONF_DIR}
|
mkdir -p ${TROVE_INTEGRATION_CONF_DIR}
|
||||||
touch $REDDWARF_ENV_CONF_PATH
|
touch $TROVE_ENV_CONF_PATH
|
||||||
iniset $REDDWARF_ENV_CONF_PATH DEFAULT REDDWARF_TENANT $REDDWARF_TENANT
|
iniset $TROVE_ENV_CONF_PATH DEFAULT TROVE_TENANT $TROVE_TENANT
|
||||||
iniset $REDDWARF_ENV_CONF_PATH DEFAULT REDDWARF_USER $REDDWARF_USER
|
iniset $TROVE_ENV_CONF_PATH DEFAULT TROVE_USER $TROVE_USER
|
||||||
iniset $REDDWARF_ENV_CONF_PATH DEFAULT REDDWARF_ROLE $REDDWARF_ROLE
|
iniset $TROVE_ENV_CONF_PATH DEFAULT TROVE_ROLE $TROVE_ROLE
|
||||||
|
|
||||||
# Now attempt a login to check it's working
|
# Now attempt a login to check it's working
|
||||||
curl -d '{"auth":{"passwordCredentials":{"username": "reddwarf", "password": "REDDWARF-PASS"},"tenantName":"reddwarf"}}' \
|
curl -d '{"auth":{"passwordCredentials":{"username": "trove", "password": "TROVE-PASS"},"tenantName":"trove"}}' \
|
||||||
-H "Content-type: application/json" $REDDWARF_AUTH_ENDPOINT/tokens
|
-H "Content-type: application/json" $TROVE_AUTH_ENDPOINT/tokens
|
||||||
|
|
||||||
# Register reddwarf service.
|
# Register trove service.
|
||||||
REDDWARF_SERVICE_UUID=$(keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN service-list | grep "reddwarf" | get_field 1)
|
TROVE_SERVICE_UUID=$(keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN service-list | grep "trove" | get_field 1)
|
||||||
if [ -z $REDDWARF_SERVICE_UUID ]; then
|
if [ -z $TROVE_SERVICE_UUID ]; then
|
||||||
REDDWARF_SERVICE_UUID=$(keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN service-create \
|
TROVE_SERVICE_UUID=$(keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN service-create \
|
||||||
--name=reddwarf \
|
--name=trove \
|
||||||
--type=database \
|
--type=database \
|
||||||
--description="Reddwarf Database as a Service" \
|
--description="Trove Database as a Service" \
|
||||||
| grep " id " | get_field 2)
|
| grep " id " | get_field 2)
|
||||||
keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN endpoint-create \
|
keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN endpoint-create \
|
||||||
--region RegionOne \
|
--region RegionOne \
|
||||||
--service_id $REDDWARF_SERVICE_UUID \
|
--service_id $TROVE_SERVICE_UUID \
|
||||||
--publicurl "$REDDWARF_SERVICE_PROTOCOL://$REDDWARF_SERVICE_HOST:$REDDWARF_SERVICE_PORT/v1.0/\$(tenant_id)s" \
|
--publicurl "$TROVE_SERVICE_PROTOCOL://$TROVE_SERVICE_HOST:$TROVE_SERVICE_PORT/v1.0/\$(tenant_id)s" \
|
||||||
--adminurl "$REDDWARF_SERVICE_PROTOCOL://$REDDWARF_SERVICE_HOST:$REDDWARF_SERVICE_PORT/v1.0/\$(tenant_id)s" \
|
--adminurl "$TROVE_SERVICE_PROTOCOL://$TROVE_SERVICE_HOST:$TROVE_SERVICE_PORT/v1.0/\$(tenant_id)s" \
|
||||||
--internalurl "$REDDWARF_SERVICE_PROTOCOL://$REDDWARF_SERVICE_HOST:$REDDWARF_SERVICE_PORT/v1.0/\$(tenant_id)s"
|
--internalurl "$TROVE_SERVICE_PROTOCOL://$TROVE_SERVICE_HOST:$TROVE_SERVICE_PORT/v1.0/\$(tenant_id)s"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Setup Reddwarf Config file and related functions
|
# Setup Trove Config file and related functions
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function fix_rd_configfiles() {
|
function fix_rd_configfiles() {
|
||||||
# Create the reddwarf conf dir and cache dirs if they don't exist
|
# Create the trove conf dir and cache dirs if they don't exist
|
||||||
sudo mkdir -p ${REDDWARF_CONF_DIR}
|
sudo mkdir -p ${TROVE_CONF_DIR}
|
||||||
sudo mkdir -p ${REDDWARF_AUTH_CACHE_DIR}
|
sudo mkdir -p ${TROVE_AUTH_CACHE_DIR}
|
||||||
sudo chown -R $USER: ${REDDWARF_CONF_DIR}
|
sudo chown -R $USER: ${TROVE_CONF_DIR}
|
||||||
sudo chown -R $USER: ${REDDWARF_AUTH_CACHE_DIR}
|
sudo chown -R $USER: ${TROVE_AUTH_CACHE_DIR}
|
||||||
|
|
||||||
# Copy conf files over to the reddwarf conf dir
|
# Copy conf files over to the trove conf dir
|
||||||
cd $REDDWARF_DIR
|
cd $TROVE_DIR
|
||||||
cp etc/reddwarf/reddwarf.conf.sample $REDDWARF_CONF_DIR/reddwarf.conf
|
cp etc/trove/trove.conf.sample $TROVE_CONF_DIR/trove.conf
|
||||||
cp etc/reddwarf/api-paste.ini $REDDWARF_CONF_DIR/api-paste.ini
|
cp etc/trove/api-paste.ini $TROVE_CONF_DIR/api-paste.ini
|
||||||
cp etc/reddwarf/reddwarf-taskmanager.conf.sample $REDDWARF_CONF_DIR/reddwarf-taskmanager.conf
|
cp etc/trove/trove-taskmanager.conf.sample $TROVE_CONF_DIR/trove-taskmanager.conf
|
||||||
|
|
||||||
# Fix the tokens in the conf files
|
# Fix the tokens in the conf files
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
iniset $TROVE_CONF_DIR/trove.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf.conf DEFAULT sql_connection `database_connection_url reddwarf`
|
iniset $TROVE_CONF_DIR/trove.conf DEFAULT sql_connection `database_connection_url trove`
|
||||||
iniset $REDDWARF_CONF_DIR/api-paste.ini filter:tokenauth admin_token $SERVICE_TOKEN
|
iniset $TROVE_CONF_DIR/api-paste.ini filter:tokenauth admin_token $SERVICE_TOKEN
|
||||||
iniset $REDDWARF_CONF_DIR/api-paste.ini filter:tokenauth signing_dir $REDDWARF_AUTH_CACHE_DIR
|
iniset $TROVE_CONF_DIR/api-paste.ini filter:tokenauth signing_dir $TROVE_AUTH_CACHE_DIR
|
||||||
|
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf-taskmanager.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf-taskmanager.conf DEFAULT sql_connection `database_connection_url reddwarf`
|
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT sql_connection `database_connection_url trove`
|
||||||
iniset $REDDWARF_CONF_DIR/reddwarf-taskmanager.conf filter:tokenauth admin_token $SERVICE_TOKEN
|
iniset $TROVE_CONF_DIR/trove-taskmanager.conf filter:tokenauth admin_token $SERVICE_TOKEN
|
||||||
|
|
||||||
iniset $REDDWARF_LOCAL_CONF_DIR/reddwarf-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
|
iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||||
iniset $REDDWARF_LOCAL_CONF_DIR/reddwarf-guestagent.conf.sample DEFAULT sql_connection `database_connection_url reddwarf`
|
iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT sql_connection `database_connection_url trove`
|
||||||
sed -i "s/localhost/$NETWORK_GATEWAY/g" $REDDWARF_LOCAL_CONF_DIR/reddwarf-guestagent.conf.sample
|
sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -248,8 +248,8 @@ function add_flavor() {
|
||||||
FLAVOR_VCPUS=$5
|
FLAVOR_VCPUS=$5
|
||||||
FLAVOR_EPHEMERAL=$6
|
FLAVOR_EPHEMERAL=$6
|
||||||
|
|
||||||
if [[ -z $(nova --os-username=$OS_USER --os-password=$ADMIN_PASSWORD --os-tenant-name=$OS_TENANT --os-auth-url=$REDDWARF_AUTH_ENDPOINT flavor-list | grep $FLAVOR_NAME) ]]; then
|
if [[ -z $(nova --os-username=$OS_USER --os-password=$ADMIN_PASSWORD --os-tenant-name=$OS_TENANT --os-auth-url=$TROVE_AUTH_ENDPOINT flavor-list | grep $FLAVOR_NAME) ]]; then
|
||||||
nova --os-username=$OS_USER --os-password=$ADMIN_PASSWORD --os-tenant-name=$OS_TENANT --os-auth-url=$REDDWARF_AUTH_ENDPOINT flavor-create $FLAVOR_NAME $FLAVOR_ID $FLAVOR_MEMORY_MB $FLAVOR_ROOT_GB $FLAVOR_VCPUS --ephemeral $FLAVOR_EPHEMERAL
|
nova --os-username=$OS_USER --os-password=$ADMIN_PASSWORD --os-tenant-name=$OS_TENANT --os-auth-url=$TROVE_AUTH_ENDPOINT flavor-create $FLAVOR_NAME $FLAVOR_ID $FLAVOR_MEMORY_MB $FLAVOR_ROOT_GB $FLAVOR_VCPUS --ephemeral $FLAVOR_EPHEMERAL
|
||||||
fi
|
fi
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
@ -275,107 +275,107 @@ function add_flavors() {
|
||||||
# stack.sh entry points
|
# stack.sh entry points
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# cleanup_reddwarfclient() - Remove residual data files, anything left over from previous
|
# cleanup_troveclient() - Remove residual data files, anything left over from previous
|
||||||
# runs that a clean run would need to clean up
|
# runs that a clean run would need to clean up
|
||||||
function cleanup_reddwarfclient() {
|
function cleanup_troveclient() {
|
||||||
local mod="cleanup_reddwarfclient"
|
local mod="cleanup_troveclient"
|
||||||
# This function intentionally left blank
|
# This function intentionally left blank
|
||||||
msgout "DEBUG" "$mod:<-- "
|
msgout "DEBUG" "$mod:<-- "
|
||||||
msgout "DEBUG" "$mod:--> "
|
msgout "DEBUG" "$mod:--> "
|
||||||
}
|
}
|
||||||
|
|
||||||
# cleanup_reddwarf() - Remove residual data files, anything left over from previous
|
# cleanup_trove() - Remove residual data files, anything left over from previous
|
||||||
# runs that a clean run would need to clean up
|
# runs that a clean run would need to clean up
|
||||||
function cleanup_reddwarf() {
|
function cleanup_trove() {
|
||||||
local mod="cleanup_reddwarf"
|
local mod="cleanup_trove"
|
||||||
# This function intentionally left blank
|
# This function intentionally left blank
|
||||||
msgout "DEBUG" "$mod:<-- "
|
msgout "DEBUG" "$mod:<-- "
|
||||||
msgout "DEBUG" "$mod:--> "
|
msgout "DEBUG" "$mod:--> "
|
||||||
}
|
}
|
||||||
|
|
||||||
# configure_reddwarfclient() - Set config files, create data dirs, etc
|
# configure_troveclient() - Set config files, create data dirs, etc
|
||||||
function configure_reddwarfclient() {
|
function configure_troveclient() {
|
||||||
local mod="configure_reddwarfclient"
|
local mod="configure_troveclient"
|
||||||
msgout "DEBUG" "$mod<-- "
|
msgout "DEBUG" "$mod<-- "
|
||||||
setup_develop $REDDWARFCLIENT_DIR
|
setup_develop $TROVECLIENT_DIR
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
# configure_reddwarf() - Set config files, create data dirs, etc
|
# configure_trove() - Set config files, create data dirs, etc
|
||||||
function configure_reddwarf() {
|
function configure_trove() {
|
||||||
local mod="configure_reddwarf"
|
local mod="configure_trove"
|
||||||
msgout "DEBUG" "$mod<-- ($REDDWARF_DIR)"
|
msgout "DEBUG" "$mod<-- ($TROVE_DIR)"
|
||||||
|
|
||||||
install_package libxslt1-dev python-pexpect
|
install_package libxslt1-dev python-pexpect
|
||||||
setup_develop $REDDWARF_DIR
|
setup_develop $TROVE_DIR
|
||||||
|
|
||||||
# Create the reddwarf build dir if it doesn't exist
|
# Create the trove build dir if it doesn't exist
|
||||||
sudo mkdir -p ${REDDWARF_BUILD_DIR}
|
sudo mkdir -p ${TROVE_BUILD_DIR}
|
||||||
sudo chown -R $USER: ${REDDWARF_BUILD_DIR}
|
sudo chown -R $USER: ${TROVE_BUILD_DIR}
|
||||||
|
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
# install_reddwarfclient() - Collect source and prepare
|
# install_troveclient() - Collect source and prepare
|
||||||
function install_reddwarfclient() {
|
function install_troveclient() {
|
||||||
local mod="install_reddwarfclient"
|
local mod="install_troveclient"
|
||||||
msgout "DEBUG" "$mod<-- "
|
msgout "DEBUG" "$mod<-- "
|
||||||
git_clone $REDDWARFCLIENT_REPO $REDDWARFCLIENT_DIR $REDDWARFCLIENT_BRANCH
|
git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
# install_reddwarf() - Collect source and prepare
|
# install_trove() - Collect source and prepare
|
||||||
function install_reddwarf() {
|
function install_trove() {
|
||||||
local mod="install_reddwarf"
|
local mod="install_trove"
|
||||||
msgout "DEBUG" "$mod<-- "
|
msgout "DEBUG" "$mod<-- "
|
||||||
git_clone $REDDWARF_REPO $REDDWARF_DIR $REDDWARF_BRANCH
|
git_clone $TROVE_REPO $TROVE_DIR $TROVE_BRANCH
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
# init_reddwarf() - Initializes Reddwarf Database as a Service
|
# init_trove() - Initializes Trove Database as a Service
|
||||||
function init_reddwarf() {
|
function init_trove() {
|
||||||
local mod="init_reddwarf"
|
local mod="init_trove"
|
||||||
msgout "DEBUG" "$mod<-- "
|
msgout "DEBUG" "$mod<-- "
|
||||||
|
|
||||||
msgout "DEBUG" "(Re)Creating reddwarf db..."
|
msgout "DEBUG" "(Re)Creating trove db..."
|
||||||
recreate_database reddwarf utf8
|
recreate_database trove utf8
|
||||||
|
|
||||||
mkdir -p $REDDWARF_INTEGRATION_CONF_DIR
|
mkdir -p $TROVE_INTEGRATION_CONF_DIR
|
||||||
|
|
||||||
msgout "DEBUG" "Creating Keystone users..."
|
msgout "DEBUG" "Creating Keystone users..."
|
||||||
reddwarf_configure_keystone
|
trove_configure_keystone
|
||||||
|
|
||||||
msgout "DEBUG" "Making a temporary reddwarf config file..."
|
msgout "DEBUG" "Making a temporary trove config file..."
|
||||||
fix_rd_configfiles
|
fix_rd_configfiles
|
||||||
|
|
||||||
msgout "DEBUG" "Initializing the Reddwarf Database..."
|
msgout "DEBUG" "Initializing the Trove Database..."
|
||||||
reddwarf_manage db_sync
|
trove_manage db_sync
|
||||||
|
|
||||||
msgout "DEBUG" "Adding reddwarf specific flavours..."
|
msgout "DEBUG" "Adding trove specific flavours..."
|
||||||
add_flavors
|
add_flavors
|
||||||
|
|
||||||
msgout "DEBUG" "Removing old certs from reddwarf cache dir.."
|
msgout "DEBUG" "Removing old certs from trove cache dir.."
|
||||||
rm -fr $REDDWARF_AUTH_CACHE_DIR/*
|
rm -fr $TROVE_AUTH_CACHE_DIR/*
|
||||||
|
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
# start_reddwarf() - Start running processes, including screen
|
# start_trove() - Start running processes, including screen
|
||||||
function start_reddwarf() {
|
function start_trove() {
|
||||||
local mod="start_reddwarf"
|
local mod="start_trove"
|
||||||
msgout "DEBUG" "$mod<-- "
|
msgout "DEBUG" "$mod<-- "
|
||||||
screen_it rd-api "cd $REDDWARF_DIR; bin/reddwarf-api --config-file=$REDDWARF_CONF_DIR/reddwarf.conf 2>&1 | tee $REDDWARF_LOGDIR/reddwarf-api.log"
|
screen_it rd-api "cd $TROVE_DIR; bin/trove-api --config-file=$TROVE_CONF_DIR/trove.conf 2>&1 | tee $TROVE_LOGDIR/trove-api.log"
|
||||||
screen_it rd-tmgr "cd $REDDWARF_DIR; bin/reddwarf-taskmanager --config-file=$REDDWARF_CONF_DIR/reddwarf-taskmanager.conf 2>&1 | tee $REDDWARF_LOGDIR/reddwarf-taskmanager.log"
|
screen_it rd-tmgr "cd $TROVE_DIR; bin/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf 2>&1 | tee $TROVE_LOGDIR/trove-taskmanager.log"
|
||||||
msgout "DEBUG" "$mod:-->"
|
msgout "DEBUG" "$mod:-->"
|
||||||
}
|
}
|
||||||
|
|
||||||
function devstack_post_install_hook() {
|
function devstack_post_install_hook() {
|
||||||
install_reddwarf
|
install_trove
|
||||||
install_reddwarfclient
|
install_troveclient
|
||||||
configure_reddwarf
|
configure_trove
|
||||||
configure_reddwarfclient
|
configure_troveclient
|
||||||
init_reddwarf
|
init_trove
|
||||||
start_reddwarf
|
start_trove
|
||||||
}
|
}
|
||||||
|
|
||||||
devstack_post_install_hook
|
devstack_post_install_hook
|
||||||
|
|
|
@ -7,4 +7,4 @@ python-keystoneclient
|
||||||
python-novaclient
|
python-novaclient
|
||||||
python-proboscis
|
python-proboscis
|
||||||
python-quantumclient
|
python-quantumclient
|
||||||
python-reddwarfclient
|
python-troveclient
|
||||||
|
|
246
scripts/redstack
246
scripts/redstack
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# RedStack, the Reddwarf Dev Machine Controller #
|
# RedStack, the Trove Dev Machine Controller #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# This script provides all the functionality to run all the steps from #
|
# This script provides all the functionality to run all the steps from #
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
REDSTACK_SCRIPTS=${REDSTACK_SCRIPTS:-`pwd`}
|
REDSTACK_SCRIPTS=${REDSTACK_SCRIPTS:-`pwd`}
|
||||||
REDSTACK_TESTS=$REDSTACK_SCRIPTS/../tests/
|
REDSTACK_TESTS=$REDSTACK_SCRIPTS/../tests/
|
||||||
REDDWARF_CONF_DIR=/etc/reddwarf
|
TROVE_CONF_DIR=/etc/trove
|
||||||
|
|
||||||
USERHOME=$HOME
|
USERHOME=$HOME
|
||||||
# Load options not checked into VCS.
|
# Load options not checked into VCS.
|
||||||
|
@ -36,14 +36,14 @@ NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
|
||||||
KEYSTONE_AUTH_HOST=${KEYSTONE_AUTH_HOST:-$SERVICE_HOST}
|
KEYSTONE_AUTH_HOST=${KEYSTONE_AUTH_HOST:-$SERVICE_HOST}
|
||||||
KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
|
KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
|
||||||
KEYSTONE_AUTH_PORT=${KEYSTONE_AUTH_PORT:-35357}
|
KEYSTONE_AUTH_PORT=${KEYSTONE_AUTH_PORT:-35357}
|
||||||
REDDWARF_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0
|
TROVE_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0
|
||||||
|
|
||||||
# PATH_REDDWARF more than likely has file separators, which sed does not like
|
# PATH_TROVE more than likely has file separators, which sed does not like
|
||||||
# This will escape them
|
# This will escape them
|
||||||
ESCAPED_PATH_REDDWARF=`echo $PATH_REDDWARF | sed 's/\//\\\\\//g'`
|
ESCAPED_PATH_TROVE=`echo $PATH_TROVE | sed 's/\//\\\\\//g'`
|
||||||
ESCAPED_REDSTACK_SCRIPTS=`echo $REDSTACK_SCRIPTS | sed 's/\//\\\\\//g'`
|
ESCAPED_REDSTACK_SCRIPTS=`echo $REDSTACK_SCRIPTS | sed 's/\//\\\\\//g'`
|
||||||
REDDWARF_AUTH_CACHE_DIR=${REDDWARF_AUTH_CACHE_DIR:-/var/cache/reddwarf}
|
TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
|
||||||
REDDWARF_LOGDIR=${REDDWARF_LOGDIR:-$REDSTACK_SCRIPTS/../report/logs}
|
TROVE_LOGDIR=${TROVE_LOGDIR:-$REDSTACK_SCRIPTS/../report/logs}
|
||||||
|
|
||||||
# Load functions devstack style
|
# Load functions devstack style
|
||||||
. $REDSTACK_SCRIPTS/functions
|
. $REDSTACK_SCRIPTS/functions
|
||||||
|
@ -114,7 +114,7 @@ function keystone_add_user() {
|
||||||
USER_NAME=$1
|
USER_NAME=$1
|
||||||
USER_PASS=$2
|
USER_PASS=$2
|
||||||
USER_EMAIL=$3
|
USER_EMAIL=$3
|
||||||
# Create the user "reddwarf"
|
# Create the user "trove"
|
||||||
USER_UUID=`keystone --endpoint http://localhost:35357/v2.0 --token $SERVICE_TOKEN user-list | grep $USER_NAME | awk '{print $2}'`
|
USER_UUID=`keystone --endpoint http://localhost:35357/v2.0 --token $SERVICE_TOKEN user-list | grep $USER_NAME | awk '{print $2}'`
|
||||||
if [ -z $USER_UUID ]; then
|
if [ -z $USER_UUID ]; then
|
||||||
USER_UUID=`echo_id_from_table keystone \
|
USER_UUID=`echo_id_from_table keystone \
|
||||||
|
@ -147,16 +147,16 @@ function keystone_manage () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_attribute_id() {
|
function get_attribute_id() {
|
||||||
keystone --endpoint $REDDWARF_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-list | grep " $2 " | get_field $3
|
keystone --endpoint $TROVE_AUTH_ENDPOINT --token $SERVICE_TOKEN $1-list | grep " $2 " | get_field $3
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_keystone_for_test_users() {
|
function configure_keystone_for_test_users() {
|
||||||
exclaim "Configuring keystone..."
|
exclaim "Configuring keystone..."
|
||||||
|
|
||||||
REDDWARF_TENANT=`get_attribute_id tenant reddwarf 1`
|
TROVE_TENANT=`get_attribute_id tenant trove 1`
|
||||||
ADMIN_ROLE=`get_attribute_id role admin 1`
|
ADMIN_ROLE=`get_attribute_id role admin 1`
|
||||||
REDDWARF_ROLE=`get_attribute_id role reddwarf 1`
|
TROVE_ROLE=`get_attribute_id role trove 1`
|
||||||
MEMBER_ROLE=`get_attribute_id role Member 1`
|
MEMBER_ROLE=`get_attribute_id role Member 1`
|
||||||
DAFFY_TENANT=`get_attribute_id tenant daffy 1`
|
DAFFY_TENANT=`get_attribute_id tenant daffy 1`
|
||||||
if [ -z $DAFFY_TENANT ]; then
|
if [ -z $DAFFY_TENANT ]; then
|
||||||
|
@ -173,27 +173,27 @@ function configure_keystone_for_test_users() {
|
||||||
# That way we will still catch errors if our calls to
|
# That way we will still catch errors if our calls to
|
||||||
# keystone fail, but can run kickstart twice w/o install.
|
# keystone fail, but can run kickstart twice w/o install.
|
||||||
set +e
|
set +e
|
||||||
REDDWARF_USER=`keystone_add_user Boss admin boss@example.com`
|
TROVE_USER=`keystone_add_user Boss admin boss@example.com`
|
||||||
keystone_add_user_role $REDDWARF_TENANT $REDDWARF_USER $REDDWARF_ROLE
|
keystone_add_user_role $TROVE_TENANT $TROVE_USER $TROVE_ROLE
|
||||||
keystone_add_user_role $REDDWARF_TENANT $REDDWARF_USER $ADMIN_ROLE
|
keystone_add_user_role $TROVE_TENANT $TROVE_USER $ADMIN_ROLE
|
||||||
|
|
||||||
REDDWARF_USER=`keystone_add_user chunk chunk chunk@example.com`
|
TROVE_USER=`keystone_add_user chunk chunk chunk@example.com`
|
||||||
keystone_add_user_role $REDDWARF_TENANT $REDDWARF_USER $REDDWARF_ROLE
|
keystone_add_user_role $TROVE_TENANT $TROVE_USER $TROVE_ROLE
|
||||||
keystone_add_user_role $REDDWARF_TENANT $REDDWARF_USER $MEMBER_ROLE
|
keystone_add_user_role $TROVE_TENANT $TROVE_USER $MEMBER_ROLE
|
||||||
|
|
||||||
REDDWARF_USER=`keystone_add_user daffy daffy daffy@example.com`
|
TROVE_USER=`keystone_add_user daffy daffy daffy@example.com`
|
||||||
keystone_add_user_role $DAFFY_TENANT $REDDWARF_USER $DAFFY_ROLE
|
keystone_add_user_role $DAFFY_TENANT $TROVE_USER $DAFFY_ROLE
|
||||||
|
|
||||||
REDDWARF_USER=`keystone_add_user examples examples examples@example.com`
|
TROVE_USER=`keystone_add_user examples examples examples@example.com`
|
||||||
keystone_add_user_role $REDDWARF_TENANT $REDDWARF_USER $REDDWARF_ROLE
|
keystone_add_user_role $TROVE_TENANT $TROVE_USER $TROVE_ROLE
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Add the tenant id's into test.conf
|
# Add the tenant id's into test.conf
|
||||||
DEMO_TENANT=`get_attribute_id tenant demo 1`
|
DEMO_TENANT=`get_attribute_id tenant demo 1`
|
||||||
sed -i "s/%reddwarf_tenant_id%/$REDDWARF_TENANT/g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s/%trove_tenant_id%/$TROVE_TENANT/g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s/%daffy_tenant_id%/$DAFFY_TENANT/g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s/%daffy_tenant_id%/$DAFFY_TENANT/g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s/%demo_tenant_id%/$DEMO_TENANT/g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s/%demo_tenant_id%/$DEMO_TENANT/g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s/%demo_key%/$ADMIN_PASSWORD/g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s/%demo_key%/$ADMIN_PASSWORD/g" $TROVE_CONF_DIR/test.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -203,7 +203,7 @@ function configure_keystone_for_test_users() {
|
||||||
# Install all the required dependencies
|
# Install all the required dependencies
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function install_reddwarf_packages() {
|
function install_trove_packages() {
|
||||||
# Called after devstack.
|
# Called after devstack.
|
||||||
exclaim "Installing dependencies (part 2)..."
|
exclaim "Installing dependencies (part 2)..."
|
||||||
# The default version of pip Ubuntu installs is old.
|
# The default version of pip Ubuntu installs is old.
|
||||||
|
@ -216,8 +216,8 @@ function install_reddwarf_packages() {
|
||||||
# Needed to install client on fresh VM
|
# Needed to install client on fresh VM
|
||||||
pkg_install libxslt1-dev
|
pkg_install libxslt1-dev
|
||||||
|
|
||||||
exclaim "Installing Reddwarf Client..."
|
exclaim "Installing Trove Client..."
|
||||||
pushd $PATH_PYTHON_REDDWARFCLIENT
|
pushd $PATH_PYTHON_TROVECLIENT
|
||||||
sudo python setup.py develop
|
sudo python setup.py develop
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -252,11 +252,11 @@ function install_diskimagebuilder() {
|
||||||
COMMIT_DISKIMAGEBUILDER=${COMMIT_DISKIMAGEBUILDER:-HEAD}
|
COMMIT_DISKIMAGEBUILDER=${COMMIT_DISKIMAGEBUILDER:-HEAD}
|
||||||
cd $PATH_DISKIMAGEBUILDER
|
cd $PATH_DISKIMAGEBUILDER
|
||||||
git reset $COMMIT_DISKIMAGEBUILDER --hard
|
git reset $COMMIT_DISKIMAGEBUILDER --hard
|
||||||
# link files so that reddwarf and disk image builder can be updated independently
|
# link files so that trove and disk image builder can be updated independently
|
||||||
echo "Linking Reddwarf Elements to Disk Image Builder"
|
echo "Linking Trove Elements to Disk Image Builder"
|
||||||
ln -s $REDSTACK_SCRIPTS/files/elements/reddwarf-guest $PATH_DISKIMAGEBUILDER/elements/reddwarf-guest
|
ln -s $REDSTACK_SCRIPTS/files/elements/trove-guest $PATH_DISKIMAGEBUILDER/elements/trove-guest
|
||||||
ln -s $REDSTACK_SCRIPTS/files/elements/reddwarf-mysql $PATH_DISKIMAGEBUILDER/elements/reddwarf-mysql
|
ln -s $REDSTACK_SCRIPTS/files/elements/trove-mysql $PATH_DISKIMAGEBUILDER/elements/trove-mysql
|
||||||
ln -s $REDSTACK_SCRIPTS/files/elements/reddwarf-percona $PATH_DISKIMAGEBUILDER/elements/reddwarf-percona
|
ln -s $REDSTACK_SCRIPTS/files/elements/trove-percona $PATH_DISKIMAGEBUILDER/elements/trove-percona
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,8 +323,8 @@ SERVICE_TOKEN=$SERVICE_TOKEN
|
||||||
ADMIN_PASSWORD=$ADMIN_PASSWORD
|
ADMIN_PASSWORD=$ADMIN_PASSWORD
|
||||||
SERVICE_PASSWORD=$SERVICE_PASSWORD
|
SERVICE_PASSWORD=$SERVICE_PASSWORD
|
||||||
FLAT_INTERFACE=br100
|
FLAT_INTERFACE=br100
|
||||||
REDDWARF_LOGDIR=$REDDWARF_LOGDIR
|
TROVE_LOGDIR=$TROVE_LOGDIR
|
||||||
REDDWARF_AUTH_CACHE_DIR=$REDDWARF_AUTH_CACHE_DIR
|
TROVE_AUTH_CACHE_DIR=$TROVE_AUTH_CACHE_DIR
|
||||||
# Enable Swift
|
# Enable Swift
|
||||||
ENABLED_SERVICES+=,swift
|
ENABLED_SERVICES+=,swift
|
||||||
SWIFT_HASH=$SWIFT_HASH
|
SWIFT_HASH=$SWIFT_HASH
|
||||||
|
@ -337,7 +337,7 @@ VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE}
|
||||||
# The lock_path is by default /opt/stack/nova; if this path is a shared
|
# The lock_path is by default /opt/stack/nova; if this path is a shared
|
||||||
# folder in VirtualBox things seem to break. We fix it by setting EXTRA_OPS
|
# folder in VirtualBox things seem to break. We fix it by setting EXTRA_OPS
|
||||||
# to force lock_path to /tmp.
|
# to force lock_path to /tmp.
|
||||||
EXTRA_OPTS=(lock_path=$USERHOME/nova_locks logdir=$REDDWARF_LOGDIR logfile_mode=660 rescan_timeout=180 resizefs_timeout=240 force_dhcp_release=False host=`hostname`.`hostname --domain`)
|
EXTRA_OPTS=(lock_path=$USERHOME/nova_locks logdir=$TROVE_LOGDIR logfile_mode=660 rescan_timeout=180 resizefs_timeout=240 force_dhcp_release=False host=`hostname`.`hostname --domain`)
|
||||||
" > localrc
|
" > localrc
|
||||||
if [ -n "$USING_VAGRANT" ]
|
if [ -n "$USING_VAGRANT" ]
|
||||||
then
|
then
|
||||||
|
@ -358,8 +358,8 @@ function ensure_local_sources() {
|
||||||
exclaim "Making sure local sources are up to date..."
|
exclaim "Making sure local sources are up to date..."
|
||||||
# this method will only clone if the sources dont exist,
|
# this method will only clone if the sources dont exist,
|
||||||
# or if RECLONE=yes is set
|
# or if RECLONE=yes is set
|
||||||
git_clone $REPO_REDDWARF $PATH_REDDWARF $BRANCH_REDDWARF
|
git_clone $REPO_TROVE $PATH_TROVE $BRANCH_TROVE
|
||||||
git_clone $REPO_REDDWARFCLIENT $PATH_PYTHON_REDDWARFCLIENT $BRANCH_REDDWARFCLIENT
|
git_clone $REPO_TROVECLIENT $PATH_PYTHON_TROVECLIENT $BRANCH_TROVECLIENT
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_install() {
|
function cmd_install() {
|
||||||
|
@ -369,7 +369,7 @@ function cmd_install() {
|
||||||
install_reviews_on_top_of_devstack
|
install_reviews_on_top_of_devstack
|
||||||
run_devstack
|
run_devstack
|
||||||
ensure_local_sources
|
ensure_local_sources
|
||||||
install_reddwarf_packages
|
install_trove_packages
|
||||||
install_diskimagebuilder
|
install_diskimagebuilder
|
||||||
exclaim "FINISHED INSTALL"
|
exclaim "FINISHED INSTALL"
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ function add_dbass_mycnf_to_package_repo() {
|
||||||
exclaim "Building and uploading dbaasmycnf package..."
|
exclaim "Building and uploading dbaasmycnf package..."
|
||||||
mkdir -p $PACKAGES_DIR
|
mkdir -p $PACKAGES_DIR
|
||||||
mkdir -p $BUILD_DIR
|
mkdir -p $BUILD_DIR
|
||||||
cp -R $PATH_REDDWARF/contrib/dbaas-mycnf $BUILD_DIR
|
cp -R $PATH_TROVE/contrib/dbaas-mycnf $BUILD_DIR
|
||||||
cd $BUILD_DIR/dbaas-mycnf
|
cd $BUILD_DIR/dbaas-mycnf
|
||||||
sudo -E ./builddeb.sh
|
sudo -E ./builddeb.sh
|
||||||
sudo -E reprepro -Vb $PACKAGES_DIR remove squeeze dbaas-mycnf
|
sudo -E reprepro -Vb $PACKAGES_DIR remove squeeze dbaas-mycnf
|
||||||
|
@ -445,8 +445,8 @@ function cmd_build() {
|
||||||
exclaim "Calling setup for all dependencies..."
|
exclaim "Calling setup for all dependencies..."
|
||||||
setup_py $PATH_NOVA
|
setup_py $PATH_NOVA
|
||||||
setup_py $PATH_PYTHON_NOVACLIENT
|
setup_py $PATH_PYTHON_NOVACLIENT
|
||||||
setup_py $PATH_PYTHON_REDDWARFCLIENT
|
setup_py $PATH_PYTHON_TROVECLIENT
|
||||||
setup_py $PATH_REDDWARF
|
setup_py $PATH_TROVE
|
||||||
create_package_repo
|
create_package_repo
|
||||||
munge_apache2
|
munge_apache2
|
||||||
add_dbass_mycnf_to_package_repo
|
add_dbass_mycnf_to_package_repo
|
||||||
|
@ -484,8 +484,8 @@ function cmd_set_image() {
|
||||||
GLANCE_IMAGEID=$1
|
GLANCE_IMAGEID=$1
|
||||||
SERVICE_TYPE=$2
|
SERVICE_TYPE=$2
|
||||||
#TODO(hub-cap): Upload this sucker to our database.
|
#TODO(hub-cap): Upload this sucker to our database.
|
||||||
# This should be a reddwarf-manage function
|
# This should be a trove-manage function
|
||||||
exclaim "Registering Glance image $GLANCE_IMAGEID with Reddwarf..."
|
exclaim "Registering Glance image $GLANCE_IMAGEID with Trove..."
|
||||||
|
|
||||||
rd_manage image_update $SERVICE_TYPE $GLANCE_IMAGEID
|
rd_manage image_update $SERVICE_TYPE $GLANCE_IMAGEID
|
||||||
}
|
}
|
||||||
|
@ -496,14 +496,14 @@ function upload_image_to_glance() {
|
||||||
IMAGE_NAME=$1
|
IMAGE_NAME=$1
|
||||||
CONTAINER_FORMAT=$2
|
CONTAINER_FORMAT=$2
|
||||||
DISK_FORMAT=$3
|
DISK_FORMAT=$3
|
||||||
REDDWARF_TENANT=$4
|
TROVE_TENANT=$4
|
||||||
IMAGE_LOC=$5
|
IMAGE_LOC=$5
|
||||||
SERVICE_TYPE=$6
|
SERVICE_TYPE=$6
|
||||||
|
|
||||||
GLANCE_IMAGEID=`get_glance_id cmd_glance_client image-create \
|
GLANCE_IMAGEID=`get_glance_id cmd_glance_client image-create \
|
||||||
--name="$IMAGE_NAME" --public \
|
--name="$IMAGE_NAME" --public \
|
||||||
--container-format=$CONTAINER_FORMAT --disk-format=$DISK_FORMAT \
|
--container-format=$CONTAINER_FORMAT --disk-format=$DISK_FORMAT \
|
||||||
--owner=$REDDWARF_TENANT < $IMAGE_LOC`
|
--owner=$TROVE_TENANT < $IMAGE_LOC`
|
||||||
|
|
||||||
echo "IMAGE ID: $GLANCE_IMAGEID"
|
echo "IMAGE ID: $GLANCE_IMAGEID"
|
||||||
if [ -z "$GLANCE_IMAGEID" ];
|
if [ -z "$GLANCE_IMAGEID" ];
|
||||||
|
@ -521,8 +521,8 @@ function upload_image_to_glance() {
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function cmd_unit_tests() {
|
function cmd_unit_tests() {
|
||||||
exclaim "Running Reddwarf Unit Tests..."
|
exclaim "Running Trove Unit Tests..."
|
||||||
$PATH_REDDWARF/run_tests.sh -N
|
$PATH_TROVE/run_tests.sh -N
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -546,30 +546,30 @@ function cmd_stop_deps() {
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Initialize Reddwarf
|
# Initialize Trove
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function rd_manage() {
|
function rd_manage() {
|
||||||
cd $PATH_REDDWARF
|
cd $PATH_TROVE
|
||||||
bin/reddwarf-manage --config-file=$REDDWARF_CONF_DIR/reddwarf.conf $@
|
bin/trove-manage --config-file=$TROVE_CONF_DIR/trove.conf $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function mod_test_conf() {
|
function mod_test_conf() {
|
||||||
cp $REDSTACK_SCRIPTS/conf/test_begin.conf $REDDWARF_CONF_DIR/test.conf
|
cp $REDSTACK_SCRIPTS/conf/test_begin.conf $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s/\/integration\/report/$ESCAPED_REDSTACK_SCRIPTS\/\.\.\/report/" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s/\/integration\/report/$ESCAPED_REDSTACK_SCRIPTS\/\.\.\/report/" $TROVE_CONF_DIR/test.conf
|
||||||
EXTRA_CONF=$REDSTACK_SCRIPTS/conf/test.extra.conf
|
EXTRA_CONF=$REDSTACK_SCRIPTS/conf/test.extra.conf
|
||||||
if [ -e $EXTRA_CONF ]; then
|
if [ -e $EXTRA_CONF ]; then
|
||||||
cat $EXTRA_CONF >> $REDDWARF_CONF_DIR/test.conf
|
cat $EXTRA_CONF >> $TROVE_CONF_DIR/test.conf
|
||||||
fi
|
fi
|
||||||
cat $REDSTACK_SCRIPTS/conf/test_end.conf >> $REDDWARF_CONF_DIR/test.conf
|
cat $REDSTACK_SCRIPTS/conf/test_end.conf >> $TROVE_CONF_DIR/test.conf
|
||||||
|
|
||||||
#Add the paths to the test conf
|
#Add the paths to the test conf
|
||||||
sed -i "s,%keystone_path%,$PATH_KEYSTONE,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%keystone_path%,$PATH_KEYSTONE,g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s,%nova_path%,$PATH_NOVA,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%nova_path%,$PATH_NOVA,g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s,%glance_path%,$PATH_GLANCE,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%glance_path%,$PATH_GLANCE,g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s,%reddwarf_path%,$PATH_REDDWARF,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%trove_path%,$PATH_TROVE,g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s,%service_host%,$SERVICE_HOST,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%service_host%,$SERVICE_HOST,g" $TROVE_CONF_DIR/test.conf
|
||||||
sed -i "s,%swifth_path%,$PATH_SWIFT,g" $REDDWARF_CONF_DIR/test.conf
|
sed -i "s,%swifth_path%,$PATH_SWIFT,g" $TROVE_CONF_DIR/test.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_test_init() {
|
function cmd_test_init() {
|
||||||
|
@ -583,9 +583,9 @@ function cmd_test_init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_initialize() {
|
function cmd_initialize() {
|
||||||
exclaim '(Re)Initializing Reddwarf'
|
exclaim '(Re)Initializing Trove'
|
||||||
|
|
||||||
echo "Stopping Reddwarf Services"
|
echo "Stopping Trove Services"
|
||||||
cmd_stop
|
cmd_stop
|
||||||
|
|
||||||
exclaim "Reinitilizing via devstack local.sh"
|
exclaim "Reinitilizing via devstack local.sh"
|
||||||
|
@ -598,7 +598,7 @@ function cmd_initialize() {
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Start Reddwarf specific daemons interactively in a screen session
|
# Start Trove specific daemons interactively in a screen session
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function screen_it {
|
function screen_it {
|
||||||
|
@ -612,47 +612,47 @@ function init_fake_mode() {
|
||||||
# takes advantage of the running keystone service we have in our VM.
|
# takes advantage of the running keystone service we have in our VM.
|
||||||
# You could think of this fake mode, which runs in the VM as being
|
# You could think of this fake mode, which runs in the VM as being
|
||||||
# slightly less fake than the default one which runs outside of it.
|
# slightly less fake than the default one which runs outside of it.
|
||||||
CONF_FILE=/tmp/reddwarf.conf.test
|
CONF_FILE=/tmp/trove.conf.test
|
||||||
cp $PATH_REDDWARF/etc/reddwarf/reddwarf.conf.test $CONF_FILE
|
cp $PATH_TROVE/etc/trove/trove.conf.test $CONF_FILE
|
||||||
# Switch keystone from the fake class to the real one.
|
# Switch keystone from the fake class to the real one.
|
||||||
sed -i \
|
sed -i \
|
||||||
"s/reddwarf.tests.fakes.keystone/keystone.middleware.auth_token/g" \
|
"s/trove.tests.fakes.keystone/keystone.middleware.auth_token/g" \
|
||||||
$CONF_FILE
|
$CONF_FILE
|
||||||
sed -i "s/log_file = rdtest.log//g" $CONF_FILE
|
sed -i "s/log_file = rdtest.log//g" $CONF_FILE
|
||||||
cd $PATH_REDDWARF
|
cd $PATH_TROVE
|
||||||
set -e
|
set -e
|
||||||
rm -f reddwarf_test.sqlite
|
rm -f trove_test.sqlite
|
||||||
set +e
|
set +e
|
||||||
bin/reddwarf-manage --config-file=$CONF_FILE db_sync
|
bin/trove-manage --config-file=$CONF_FILE db_sync
|
||||||
sqlite3 reddwarf_test.sqlite \
|
sqlite3 trove_test.sqlite \
|
||||||
"INSERT INTO service_images VALUES('1','mysql','fake');"
|
"INSERT INTO service_images VALUES('1','mysql','fake');"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_start() {
|
function cmd_start() {
|
||||||
screen_it rd-api "cd $PATH_REDDWARF; bin/reddwarf-api --config-file=$REDDWARF_CONF_DIR/reddwarf.conf 2>&1 | tee $REDDWARF_LOGDIR/reddwarf-api.log"
|
screen_it rd-api "cd $PATH_TROVE; bin/trove-api --config-file=$TROVE_CONF_DIR/trove.conf 2>&1 | tee $TROVE_LOGDIR/trove-api.log"
|
||||||
screen_it rd-tmgr "cd $PATH_REDDWARF; bin/reddwarf-taskmanager --config-file=$REDDWARF_CONF_DIR/reddwarf-taskmanager.conf 2>&1 | tee $REDDWARF_LOGDIR/reddwarf-taskmanager.log"
|
screen_it rd-tmgr "cd $PATH_TROVE; bin/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf 2>&1 | tee $TROVE_LOGDIR/trove-taskmanager.log"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_start_fake() {
|
function cmd_start_fake() {
|
||||||
init_fake_mode
|
init_fake_mode
|
||||||
CONF_FILE=/tmp/reddwarf.conf.test
|
CONF_FILE=/tmp/trove.conf.test
|
||||||
screen_it rd-fake "cd $PATH_REDDWARF; bin/reddwarf-api --config-file=$CONF_FILE $@"
|
screen_it rd-fake "cd $PATH_TROVE; bin/trove-api --config-file=$CONF_FILE $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_run() {
|
function cmd_run() {
|
||||||
cd $PATH_REDDWARF; bin/reddwarf-api \
|
cd $PATH_TROVE; bin/trove-api \
|
||||||
--config-file=$REDDWARF_CONF_DIR/reddwarf.conf $@
|
--config-file=$TROVE_CONF_DIR/trove.conf $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_run_fake() {
|
function cmd_run_fake() {
|
||||||
init_fake_mode
|
init_fake_mode
|
||||||
CONF_FILE=/tmp/reddwarf.conf.test
|
CONF_FILE=/tmp/trove.conf.test
|
||||||
bin/reddwarf-api --config-file=$CONF_FILE $@ \
|
bin/trove-api --config-file=$CONF_FILE $@ \
|
||||||
repo_path=reddwarf_test.sqlite
|
repo_path=trove_test.sqlite
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Stop any active Reddwarf screen session
|
# Stop any active Trove screen session
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
@ -668,12 +668,12 @@ function cmd_stop() {
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function cmd_int_tests() {
|
function cmd_int_tests() {
|
||||||
exclaim "Running Reddwarf Integration Tests..."
|
exclaim "Running Trove Integration Tests..."
|
||||||
if [ ! $USAGE_ENDPOINT ]; then
|
if [ ! $USAGE_ENDPOINT ]; then
|
||||||
export USAGE_ENDPOINT=reddwarf.tests.util.usage.FakeVerifier
|
export USAGE_ENDPOINT=trove.tests.util.usage.FakeVerifier
|
||||||
fi
|
fi
|
||||||
cd $REDSTACK_SCRIPTS
|
cd $REDSTACK_SCRIPTS
|
||||||
export TEST_CONF=$REDDWARF_CONF_DIR/test.conf
|
export TEST_CONF=$TROVE_CONF_DIR/test.conf
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
args="--group=blackbox"
|
args="--group=blackbox"
|
||||||
else
|
else
|
||||||
|
@ -689,9 +689,9 @@ function cmd_int_tests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_int_tests_simple() {
|
function cmd_int_tests_simple() {
|
||||||
exclaim "Running Reddwarf Simple Integration Tests..."
|
exclaim "Running Trove Simple Integration Tests..."
|
||||||
cd $REDSTACK_SCRIPTS
|
cd $REDSTACK_SCRIPTS
|
||||||
export TEST_CONF=$REDDWARF_CONF_DIR/test.conf
|
export TEST_CONF=$TROVE_CONF_DIR/test.conf
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
args="--group=simple_blackbox"
|
args="--group=simple_blackbox"
|
||||||
else
|
else
|
||||||
|
@ -707,10 +707,10 @@ function cmd_int_tests_simple() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_int_tests_white_box() {
|
function cmd_int_tests_white_box() {
|
||||||
export PYTHONPATH=$PYTHONPATH:$REDDWARF_SOURCE
|
export PYTHONPATH=$PYTHONPATH:$TROVE_SOURCE
|
||||||
export PYTHONPATH=$PYTHONPATH:$PATH_NOVA
|
export PYTHONPATH=$PYTHONPATH:$PATH_NOVA
|
||||||
cmd_int_tests --test-config white_box=True \
|
cmd_int_tests --test-config white_box=True \
|
||||||
--config-file=$REDDWARF_CONF_DIR/reddwarf.conf \
|
--config-file=$TROVE_CONF_DIR/trove.conf \
|
||||||
--nova-flags=/etc/nova/nova.conf $@
|
--nova-flags=/etc/nova/nova.conf $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,7 +729,7 @@ function cmd_example_tests() {
|
||||||
\"replace_dns_hostname\": \"e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com\",
|
\"replace_dns_hostname\": \"e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com\",
|
||||||
\"username\":\"examples\",
|
\"username\":\"examples\",
|
||||||
\"password\":\"examples\",
|
\"password\":\"examples\",
|
||||||
\"tenant\":\"reddwarf\"
|
\"tenant\":\"trove\"
|
||||||
}" > /tmp/example-tests.conf
|
}" > /tmp/example-tests.conf
|
||||||
python $REDSTACK_TESTS/examples/examples/example_generation.py /tmp/example-tests.conf
|
python $REDSTACK_TESTS/examples/examples/example_generation.py /tmp/example-tests.conf
|
||||||
pushd $REDSTACK_TESTS/../apidocs
|
pushd $REDSTACK_TESTS/../apidocs
|
||||||
|
@ -748,9 +748,9 @@ function mysql_nova() {
|
||||||
mysql -u root -p$MYSQL_PASSWORD nova --execute "$@"
|
mysql -u root -p$MYSQL_PASSWORD nova --execute "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function mysql_reddwarf() {
|
function mysql_trove() {
|
||||||
echo mysql reddwarf --execute "$@"
|
echo mysql trove --execute "$@"
|
||||||
mysql -u root -p$MYSQL_PASSWORD reddwarf --execute "$@"
|
mysql -u root -p$MYSQL_PASSWORD trove --execute "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_nova_client() {
|
function cmd_nova_client() {
|
||||||
|
@ -758,12 +758,12 @@ function cmd_nova_client() {
|
||||||
TESTVOLUME=`echo "$@" | awk '/volume/{print $1}'`
|
TESTVOLUME=`echo "$@" | awk '/volume/{print $1}'`
|
||||||
if [ -z "$TESTVOLUME" -o "$TESTVOLUME" = "volume-attach" -o "$TESTVOLUME" = "volume-detach" ]; then
|
if [ -z "$TESTVOLUME" -o "$TESTVOLUME" = "volume-attach" -o "$TESTVOLUME" = "volume-detach" ]; then
|
||||||
nova --os_auth_url=http://localhost:35357/v2.0 \
|
nova --os_auth_url=http://localhost:35357/v2.0 \
|
||||||
--os_tenant_name=reddwarf --os_username=radmin --os_password=radmin \
|
--os_tenant_name=trove --os_username=radmin --os_password=radmin \
|
||||||
--service_type=compute --region_name=RegionOne \
|
--service_type=compute --region_name=RegionOne \
|
||||||
--service_name='nova' $@
|
--service_name='nova' $@
|
||||||
else
|
else
|
||||||
nova --os_auth_url=http://localhost:35357/v2.0 \
|
nova --os_auth_url=http://localhost:35357/v2.0 \
|
||||||
--os_tenant_name=reddwarf --os_username=radmin --os_password=radmin \
|
--os_tenant_name=trove --os_username=radmin --os_password=radmin \
|
||||||
--service_type=volume --region_name=RegionOne \
|
--service_type=volume --region_name=RegionOne \
|
||||||
--service_name='cinder' $@
|
--service_name='cinder' $@
|
||||||
fi
|
fi
|
||||||
|
@ -771,28 +771,28 @@ function cmd_nova_client() {
|
||||||
|
|
||||||
function cmd_swift_client() {
|
function cmd_swift_client() {
|
||||||
swift --os_auth_url=http://localhost:35357/v2.0 \
|
swift --os_auth_url=http://localhost:35357/v2.0 \
|
||||||
--os_tenant_name=reddwarf --os_username=radmin --os_password=radmin $@
|
--os_tenant_name=trove --os_username=radmin --os_password=radmin $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_glance_client() {
|
function cmd_glance_client() {
|
||||||
REDDWARF_TENANT=`get_attribute_id tenant reddwarf 1`
|
TROVE_TENANT=`get_attribute_id tenant trove 1`
|
||||||
glance --os-auth-url=http://localhost:35357/v2.0 \
|
glance --os-auth-url=http://localhost:35357/v2.0 \
|
||||||
--os-username=radmin --os-password=radmin \
|
--os-username=radmin --os-password=radmin \
|
||||||
--os-tenant-id $REDDWARF_TENANT $@
|
--os-tenant-id $TROVE_TENANT $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_rd_client() {
|
function cmd_rd_client() {
|
||||||
# This serves as an example of how to call the Reddwarf client script.
|
# This serves as an example of how to call the Trove client script.
|
||||||
reddwarf-cli --username=radmin --apikey=radmin --tenant=reddwarf \
|
trove-cli --username=radmin --apikey=radmin --tenant=trove \
|
||||||
--auth_url=http://localhost:35357/v2.0/tokens auth login
|
--auth_url=http://localhost:35357/v2.0/tokens auth login
|
||||||
reddwarf-cli $@
|
trove-cli $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_rd_mgmt_client() {
|
function cmd_rd_mgmt_client() {
|
||||||
# This serves as an example of how to call the Reddwarf managment client script.
|
# This serves as an example of how to call the Trove managment client script.
|
||||||
reddwarf-cli --username=radmin --apikey=radmin --tenant=reddwarf \
|
trove-cli --username=radmin --apikey=radmin --tenant=trove \
|
||||||
--auth_url=http://localhost:35357/v2.0/tokens auth login
|
--auth_url=http://localhost:35357/v2.0/tokens auth login
|
||||||
reddwarf-mgmt-cli $@
|
trove-mgmt-cli $@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_delete_nova_instance() {
|
function cmd_delete_nova_instance() {
|
||||||
|
@ -804,7 +804,7 @@ function cmd_delete_nova_instance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_wipe_logs() {
|
function cmd_wipe_logs() {
|
||||||
for file in `ls $REDDWARF_LOGDIR/*.log`
|
for file in `ls $TROVE_LOGDIR/*.log`
|
||||||
do
|
do
|
||||||
echo "Reseting log file $file..."
|
echo "Reseting log file $file..."
|
||||||
echo "Reset at `date`" > $file
|
echo "Reset at `date`" > $file
|
||||||
|
@ -812,12 +812,12 @@ function cmd_wipe_logs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_rd_sql() {
|
function cmd_rd_sql() {
|
||||||
mysql -u root -p$MYSQL_PASSWORD reddwarf
|
mysql -u root -p$MYSQL_PASSWORD trove
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_fake_sql() {
|
function cmd_fake_sql() {
|
||||||
pushd $PATH_REDDWARF
|
pushd $PATH_TROVE
|
||||||
sqlite3 reddwarf_test.sqlite $@
|
sqlite3 trove_test.sqlite $@
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,8 +867,8 @@ function cmd_clear() {
|
||||||
clean_instances
|
clean_instances
|
||||||
mysql_nova "DELETE FROM instance_info_caches;"
|
mysql_nova "DELETE FROM instance_info_caches;"
|
||||||
mysql_nova "DELETE FROM instances;"
|
mysql_nova "DELETE FROM instances;"
|
||||||
mysql_reddwarf "DELETE FROM instances;"
|
mysql_trove "DELETE FROM instances;"
|
||||||
mysql_reddwarf "DELETE FROM service_statuses;"
|
mysql_trove "DELETE FROM service_statuses;"
|
||||||
cmd_wipe_queues
|
cmd_wipe_queues
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,7 +879,7 @@ function cmd_kick_start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_post_devstack() {
|
function cmd_post_devstack() {
|
||||||
install_reddwarf_packages
|
install_trove_packages
|
||||||
install_diskimagebuilder
|
install_diskimagebuilder
|
||||||
cmd_build
|
cmd_build
|
||||||
cmd_test_init
|
cmd_test_init
|
||||||
|
@ -887,7 +887,7 @@ function cmd_post_devstack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_reset_task() {
|
function cmd_reset_task() {
|
||||||
mysql_reddwarf "UPDATE instances SET task_id=1 WHERE id='$1'"
|
mysql_trove "UPDATE instances SET task_id=1 WHERE id='$1'"
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmd_update_projects() {
|
function cmd_update_projects() {
|
||||||
|
@ -932,21 +932,21 @@ function print_usage() {
|
||||||
build - Build the packages (including the agent) and set up the apt repo
|
build - Build the packages (including the agent) and set up the apt repo
|
||||||
test-init - Configure the test configuration files and add keystone test users
|
test-init - Configure the test configuration files and add keystone test users
|
||||||
build-image - Builds the vm image and adds it to glance
|
build-image - Builds the vm image and adds it to glance
|
||||||
initialize - Reinitialize the reddwarf database, users, services, and test config
|
initialize - Reinitialize the trove database, users, services, and test config
|
||||||
post-devstack - Configures testing environment, builds image and uploads to glance
|
post-devstack - Configures testing environment, builds image and uploads to glance
|
||||||
|
|
||||||
--helper for environment--
|
--helper for environment--
|
||||||
kick-start - kick start the setup of reddwarf.
|
kick-start - kick start the setup of trove.
|
||||||
(redstack build/test-init/build-image in one step)
|
(redstack build/test-init/build-image in one step)
|
||||||
[mysql no-clean] no clean avoids rebuilding pacakges from scratch
|
[mysql no-clean] no clean avoids rebuilding pacakges from scratch
|
||||||
|
|
||||||
--reddwarf dependency services--
|
--trove dependency services--
|
||||||
start-deps - Start or resume daemons Reddwarf depends on.
|
start-deps - Start or resume daemons Trove depends on.
|
||||||
stop-deps - Kill daemons Reddwarf depends on.
|
stop-deps - Kill daemons Trove depends on.
|
||||||
|
|
||||||
--reddwarf services--
|
--trove services--
|
||||||
start - Start or resume daemons Reddwarf depends on.
|
start - Start or resume daemons Trove depends on.
|
||||||
stop - Kill daemons Reddwarf depends on.
|
stop - Kill daemons Trove depends on.
|
||||||
|
|
||||||
--tests--
|
--tests--
|
||||||
unit-tests - Run the unit tests.dependencies
|
unit-tests - Run the unit tests.dependencies
|
||||||
|
@ -958,18 +958,18 @@ function print_usage() {
|
||||||
glance-client - Runs glance client with admin user.
|
glance-client - Runs glance client with admin user.
|
||||||
nova-client - Runs Nova client with admin user.
|
nova-client - Runs Nova client with admin user.
|
||||||
swift-client - Runs Swift client with admin user.
|
swift-client - Runs Swift client with admin user.
|
||||||
rd-client - Runs Reddwarf client with admin user.
|
rd-client - Runs Trove client with admin user.
|
||||||
rd-mgmt-client - Runs Reddwarf management client with admin user.
|
rd-mgmt-client - Runs Trove management client with admin user.
|
||||||
* Shows a valid token.
|
* Shows a valid token.
|
||||||
wipe-logs - Resets all log files.
|
wipe-logs - Resets all log files.
|
||||||
nova-delete - Deletes a nova instance.
|
nova-delete - Deletes a nova instance.
|
||||||
rd-sql - Opens the Reddwarf MySQL database.
|
rd-sql - Opens the Trove MySQL database.
|
||||||
vagrant-ssh - Runs a command from the host on the server.
|
vagrant-ssh - Runs a command from the host on the server.
|
||||||
set-image - Sets the image without building it.
|
set-image - Sets the image without building it.
|
||||||
clear - Destroy instances and rabbit queues.
|
clear - Destroy instances and rabbit queues.
|
||||||
run - Starts RD but not in a screen.
|
run - Starts RD but not in a screen.
|
||||||
run-fake - Runs the server in fake mode.
|
run-fake - Runs the server in fake mode.
|
||||||
update-projects - Git pull on all the daemons reddwarf dependencies.
|
update-projects - Git pull on all the daemons trove dependencies.
|
||||||
reset-task - Sets an instance task to NONE.
|
reset-task - Sets an instance task to NONE.
|
||||||
wipe-queues - Resets RabbitMQ queues.
|
wipe-queues - Resets RabbitMQ queues.
|
||||||
"
|
"
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
[ -z $SERVICE_HOST ] && SERVICE_HOST=localhost
|
[ -z $SERVICE_HOST ] && SERVICE_HOST=localhost
|
||||||
[ -z $DEST ] && DEST=/opt/stack
|
[ -z $DEST ] && DEST=/opt/stack
|
||||||
[ -z $NETWORK_GATEWAY ] && NETWORK_GATEWAY=10.0.0.1
|
[ -z $NETWORK_GATEWAY ] && NETWORK_GATEWAY=10.0.0.1
|
||||||
REDDWARF_SOURCE=$DEST/reddwarf
|
TROVE_SOURCE=$DEST/trove
|
||||||
PATH_INTEGRATION_CONF="/tmp/integration"
|
PATH_INTEGRATION_CONF="/tmp/integration"
|
||||||
|
|
||||||
# devstack is either a shared folder or is downloaded by reddwarf-ci install.
|
# devstack is either a shared folder or is downloaded by trove-ci install.
|
||||||
[ -z $PATH_DEVSTACK_SRC ] && PATH_DEVSTACK_SRC=~/devstack
|
[ -z $PATH_DEVSTACK_SRC ] && PATH_DEVSTACK_SRC=~/devstack
|
||||||
PATH_DEVSTACK_OUTPUT=$DEST
|
PATH_DEVSTACK_OUTPUT=$DEST
|
||||||
REPO_DEVSTACK=git://github.com/openstack-dev/devstack.git
|
REPO_DEVSTACK=git://github.com/openstack-dev/devstack.git
|
||||||
|
@ -23,15 +23,15 @@ PATH_PYTHON_NOVACLIENT=$DEST/python-novaclient
|
||||||
PATH_SWIFT=$DEST/swift
|
PATH_SWIFT=$DEST/swift
|
||||||
PATH_PYTHON_SWIFTCLIENT=$DEST/python-swiftclient
|
PATH_PYTHON_SWIFTCLIENT=$DEST/python-swiftclient
|
||||||
|
|
||||||
# reddwarf information
|
# trove information
|
||||||
REPO_REDDWARF=https://github.com/openstack/trove.git
|
REPO_TROVE=https://github.com/openstack/trove.git
|
||||||
BRANCH_REDDWARF=master
|
BRANCH_TROVE=master
|
||||||
PATH_REDDWARF=$DEST/reddwarf
|
PATH_TROVE=$DEST/trove
|
||||||
|
|
||||||
# reddwarfclient information
|
# troveclient information
|
||||||
REPO_REDDWARFCLIENT=https://github.com/openstack/python-troveclient.git
|
REPO_TROVECLIENT=https://github.com/openstack/python-troveclient.git
|
||||||
BRANCH_REDDWARFCLIENT=master
|
BRANCH_TROVECLIENT=master
|
||||||
PATH_PYTHON_REDDWARFCLIENT=$DEST/python-reddwarfclient
|
PATH_PYTHON_TROVECLIENT=$DEST/python-troveclient
|
||||||
|
|
||||||
# diskimage-builder information
|
# diskimage-builder information
|
||||||
REPO_DISKIMAGEBUILDER=https://github.com/stackforge/diskimage-builder.git
|
REPO_DISKIMAGEBUILDER=https://github.com/stackforge/diskimage-builder.git
|
||||||
|
|
|
@ -6,7 +6,7 @@ After customizing examples/local.conf, run:
|
||||||
./example_gen.sh
|
./example_gen.sh
|
||||||
|
|
||||||
2012-06-12
|
2012-06-12
|
||||||
- Updated to work with reddwarf_lite
|
- Updated to work with trove
|
||||||
- All XML calls are commented out
|
- All XML calls are commented out
|
||||||
- Management calls are also commented out
|
- Management calls are also commented out
|
||||||
2012-06-14
|
2012-06-14
|
||||||
|
|
|
@ -8,8 +8,8 @@ from urlparse import urlparse
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
|
||||||
from proboscis.asserts import *
|
from proboscis.asserts import *
|
||||||
from reddwarfclient.client import ReddwarfHTTPClient
|
from troveclient.client import TroveHTTPClient
|
||||||
from reddwarfclient.xml import ReddwarfXmlClient
|
from troveclient.xml import TroveXmlClient
|
||||||
|
|
||||||
|
|
||||||
print_req = True
|
print_req = True
|
||||||
|
@ -219,7 +219,7 @@ def write_to_snippet(self, args, kwargs, resp, body):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class JsonClient(ReddwarfHTTPClient):
|
class JsonClient(TroveHTTPClient):
|
||||||
|
|
||||||
content_type = 'json'
|
content_type = 'json'
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ class JsonClient(ReddwarfHTTPClient):
|
||||||
return write_to_snippet(self, *args, **kwargs)
|
return write_to_snippet(self, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class XmlClient(ReddwarfXmlClient):
|
class XmlClient(TroveXmlClient):
|
||||||
|
|
||||||
content_type = 'xml'
|
content_type = 'xml'
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@ from proboscis import TestProgram
|
||||||
from proboscis.asserts import *
|
from proboscis.asserts import *
|
||||||
from proboscis.asserts import Check
|
from proboscis.asserts import Check
|
||||||
|
|
||||||
from reddwarfclient import Dbaas
|
from troveclient import Dbaas
|
||||||
from reddwarfclient import ReddwarfHTTPClient
|
from troveclient import TroveHTTPClient
|
||||||
|
|
||||||
|
|
||||||
from client import ConfigFile
|
from client import ConfigFile
|
||||||
|
@ -273,10 +273,10 @@ def load_config_file():
|
||||||
if not conf:
|
if not conf:
|
||||||
fail("Missing conf file.")
|
fail("Missing conf file.")
|
||||||
|
|
||||||
def create_client(cls=ReddwarfHTTPClient):
|
def create_client(cls=TroveHTTPClient):
|
||||||
client = Dbaas(conf.username, conf.password, tenant=conf.tenant,
|
client = Dbaas(conf.username, conf.password, tenant=conf.tenant,
|
||||||
auth_url="blah/", auth_strategy='fake',
|
auth_url="blah/", auth_strategy='fake',
|
||||||
insecure=True, service_type='reddwarf',
|
insecure=True, service_type='trove',
|
||||||
service_url=conf.dbaas_url, client_cls=cls)
|
service_url=conf.dbaas_url, client_cls=cls)
|
||||||
return client
|
return client
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,5 @@
|
||||||
"replace_dns_hostname": "e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com",
|
"replace_dns_hostname": "e09ad9a3f73309469cf1f43d11e79549caf9acf2.rackspaceclouddb.com",
|
||||||
"username":"examples",
|
"username":"examples",
|
||||||
"password":"examples",
|
"password":"examples",
|
||||||
"tenant":"reddwarf"
|
"tenant":"trove"
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,16 @@
|
||||||
"keystone_code_root":"/opt/stack/keystone",
|
"keystone_code_root":"/opt/stack/keystone",
|
||||||
"keystone_conf":"/etc/keystone/keystone.conf",
|
"keystone_conf":"/etc/keystone/keystone.conf",
|
||||||
"keystone_use_combined":true,
|
"keystone_use_combined":true,
|
||||||
"reddwarf_code_root":"/opt/stack/reddwarf",
|
"trove_code_root":"/opt/stack/trove",
|
||||||
"reddwarf_conf":"/tmp/reddwarf.conf",
|
"trove_conf":"/tmp/trove.conf",
|
||||||
"reddwarf_version":"v1.0",
|
"trove_version":"v1.0",
|
||||||
"reddwarf_api_updated":"2012-08-01T00:00:00Z",
|
"trove_api_updated":"2012-08-01T00:00:00Z",
|
||||||
"reddwarf_must_have_volume":false,
|
"trove_must_have_volume":false,
|
||||||
"reddwarf_can_have_volume":true,
|
"trove_can_have_volume":true,
|
||||||
"reddwarf_main_instance_has_volume": true,
|
"trove_main_instance_has_volume": true,
|
||||||
"reddwarf_max_accepted_volume_size": 1000,
|
"trove_max_accepted_volume_size": 1000,
|
||||||
"reddwarf_max_instances_per_user": 55,
|
"trove_max_instances_per_user": 55,
|
||||||
"reddwarf_max_volumes_per_user": 100,
|
"trove_max_volumes_per_user": 100,
|
||||||
"use_nova_volume": false,
|
"use_nova_volume": false,
|
||||||
"use_reaper":false,
|
"use_reaper":false,
|
||||||
"root_removed_from_instance_api": true,
|
"root_removed_from_instance_api": true,
|
||||||
|
@ -37,13 +37,13 @@
|
||||||
"management_api_disabled": true,
|
"management_api_disabled": true,
|
||||||
"dbaas_image": 1,
|
"dbaas_image": 1,
|
||||||
"dbaas_image": 1,
|
"dbaas_image": 1,
|
||||||
"dns_driver":"reddwarf.dns.rsdns.driver.RsDnsDriver",
|
"dns_driver":"trove.dns.rsdns.driver.RsDnsDriver",
|
||||||
"dns_instance_entry_factory":"reddwarf.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
"dns_instance_entry_factory":"trove.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
||||||
"databases_page_size": 20,
|
"databases_page_size": 20,
|
||||||
"instances_page_size": 20,
|
"instances_page_size": 20,
|
||||||
"users_page_size": 20,
|
"users_page_size": 20,
|
||||||
"rabbit_runs_locally":false,
|
"rabbit_runs_locally":false,
|
||||||
|
|
||||||
"dns_instance_entry_factory":"reddwarf.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
"dns_instance_entry_factory":"trove.dns.rsdns.driver.RsDnsInstanceEntryFactory",
|
||||||
"sentinel": null
|
"sentinel": null
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,13 +76,13 @@ MAIN_RUNNER = None
|
||||||
|
|
||||||
def initialize_rdl_config(config_file):
|
def initialize_rdl_config(config_file):
|
||||||
import optparse
|
import optparse
|
||||||
from reddwarf.common import config
|
from trove.common import config
|
||||||
from reddwarf import version
|
from trove import version
|
||||||
|
|
||||||
def create_options(parser):
|
def create_options(parser):
|
||||||
parser.add_option('-p', '--port', dest="port", metavar="PORT",
|
parser.add_option('-p', '--port', dest="port", metavar="PORT",
|
||||||
type=int, default=9898,
|
type=int, default=9898,
|
||||||
help="Port the Reddwarf API host listens on. "
|
help="Port the Trove API host listens on. "
|
||||||
"Default: %default")
|
"Default: %default")
|
||||||
config.add_common_options(parser)
|
config.add_common_options(parser)
|
||||||
config.add_log_options(parser)
|
config.add_log_options(parser)
|
||||||
|
@ -94,7 +94,7 @@ def initialize_rdl_config(config_file):
|
||||||
usage=usage())
|
usage=usage())
|
||||||
create_options(oparser)
|
create_options(oparser)
|
||||||
(options, args) = config.parse_options(oparser, cli_args=[config_file])
|
(options, args) = config.parse_options(oparser, cli_args=[config_file])
|
||||||
conf = config.Config.load_paste_config('reddwarf', options, args)
|
conf = config.Config.load_paste_config('trove', options, args)
|
||||||
config.setup_logging(options, conf)
|
config.setup_logging(options, conf)
|
||||||
|
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ if __name__ == '__main__':
|
||||||
# Many of the test decorators depend on configuration values, so before
|
# Many of the test decorators depend on configuration values, so before
|
||||||
# start importing modules we have to load the test config followed by the
|
# start importing modules we have to load the test config followed by the
|
||||||
# flag files.
|
# flag files.
|
||||||
from reddwarf.tests.config import CONFIG
|
from trove.tests.config import CONFIG
|
||||||
|
|
||||||
# Find config file.
|
# Find config file.
|
||||||
if not "TEST_CONF" in os.environ:
|
if not "TEST_CONF" in os.environ:
|
||||||
|
@ -201,7 +201,7 @@ if __name__ == '__main__':
|
||||||
# Set up the report, and print out how we're running the tests.
|
# Set up the report, and print out how we're running the tests.
|
||||||
from tests.util import report
|
from tests.util import report
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
report.log("Reddwarf Integration Tests, %s" % datetime.now())
|
report.log("Trove Integration Tests, %s" % datetime.now())
|
||||||
report.log("Invoked via command: " + str(sys.argv))
|
report.log("Invoked via command: " + str(sys.argv))
|
||||||
report.log("Groups = " + str(groups))
|
report.log("Groups = " + str(groups))
|
||||||
report.log("Test conf file = %s" % os.environ["TEST_CONF"])
|
report.log("Test conf file = %s" % os.environ["TEST_CONF"])
|
||||||
|
@ -228,28 +228,28 @@ if __name__ == '__main__':
|
||||||
if not ADD_DOMAINS:
|
if not ADD_DOMAINS:
|
||||||
from tests import initialize
|
from tests import initialize
|
||||||
from tests.api import delete_all
|
from tests.api import delete_all
|
||||||
from reddwarf.tests.api import flavors
|
from trove.tests.api import flavors
|
||||||
from reddwarf.tests.api import versions
|
from trove.tests.api import versions
|
||||||
from reddwarf.tests.api import instances
|
from trove.tests.api import instances
|
||||||
from reddwarf.tests.api.instances import GROUP_START_SIMPLE
|
from trove.tests.api.instances import GROUP_START_SIMPLE
|
||||||
from tests.api import instances_direct
|
from tests.api import instances_direct
|
||||||
from reddwarf.tests.api import instances_actions
|
from trove.tests.api import instances_actions
|
||||||
from reddwarf.tests.api import instances_mysql_down
|
from trove.tests.api import instances_mysql_down
|
||||||
from tests.api import instances_pagination
|
from tests.api import instances_pagination
|
||||||
from reddwarf.tests.api import instances_delete
|
from trove.tests.api import instances_delete
|
||||||
from tests.api import instances_quotas
|
from tests.api import instances_quotas
|
||||||
from tests.api import instances_states
|
from tests.api import instances_states
|
||||||
from reddwarf.tests.api import databases
|
from trove.tests.api import databases
|
||||||
from reddwarf.tests.api import root
|
from trove.tests.api import root
|
||||||
from reddwarf.tests.api import users
|
from trove.tests.api import users
|
||||||
from reddwarf.tests.api import user_access
|
from trove.tests.api import user_access
|
||||||
from reddwarf.tests.api import backups
|
from trove.tests.api import backups
|
||||||
from reddwarf.tests.api.mgmt import accounts
|
from trove.tests.api.mgmt import accounts
|
||||||
from reddwarf.tests.api.mgmt import admin_required
|
from trove.tests.api.mgmt import admin_required
|
||||||
from tests.api.mgmt import hosts
|
from tests.api.mgmt import hosts
|
||||||
from tests.api.mgmt import update_hosts
|
from tests.api.mgmt import update_hosts
|
||||||
from reddwarf.tests.api.mgmt import instances
|
from trove.tests.api.mgmt import instances
|
||||||
from reddwarf.tests.api.mgmt import storage
|
from trove.tests.api.mgmt import storage
|
||||||
from tests.dns import dns
|
from tests.dns import dns
|
||||||
from tests.guest import amqp_restarts
|
from tests.guest import amqp_restarts
|
||||||
from tests.reaper import volume_reaping
|
from tests.reaper import volume_reaping
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
"dbaas_url":"http://localhost:8779/v1.0",
|
"dbaas_url":"http://localhost:8779/v1.0",
|
||||||
"version_url":"http://localhost:8779",
|
"version_url":"http://localhost:8779",
|
||||||
"nova_auth_url":"http://localhost:8779/v1.0/auth",
|
"nova_auth_url":"http://localhost:8779/v1.0/auth",
|
||||||
"reddwarf_auth_url":"http://localhost:8779/v1.0/auth",
|
"trove_auth_url":"http://localhost:8779/v1.0/auth",
|
||||||
"reddwarf_client_insecure":false,
|
"trove_client_insecure":false,
|
||||||
"auth_strategy":"fake",
|
"auth_strategy":"fake",
|
||||||
|
|
||||||
"reddwarf_version":"v1.0",
|
"trove_version":"v1.0",
|
||||||
"reddwarf_api_updated":"2012-08-01T00:00:00Z",
|
"trove_api_updated":"2012-08-01T00:00:00Z",
|
||||||
|
|
||||||
"reddwarf_dns_support":false,
|
"trove_dns_support":false,
|
||||||
"reddwarf_ip_support":false,
|
"trove_ip_support":false,
|
||||||
|
|
||||||
"nova_client": null,
|
"nova_client": null,
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"tenant":"admin-1000",
|
"tenant":"admin-1000",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":true,
|
"is_admin":true,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
"tenant":"2500",
|
"tenant":"2500",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
"tenant":"3000",
|
"tenant":"3000",
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"services": ["reddwarf"]
|
"services": ["trove"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -35,8 +35,8 @@ from proboscis import after_class
|
||||||
from proboscis import before_class
|
from proboscis import before_class
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
# True if we can "see" the internals, such as the database, or can import
|
# True if we can "see" the internals, such as the database, or can import
|
||||||
# nova and reddwarf code.
|
# nova and trove code.
|
||||||
from reddwarf.tests.config import CONFIG
|
from trove.tests.config import CONFIG
|
||||||
|
|
||||||
#TODO(tim.simpson): Stop using these globals and instead just use CONFIG.
|
#TODO(tim.simpson): Stop using these globals and instead just use CONFIG.
|
||||||
def initialize_globals():
|
def initialize_globals():
|
||||||
|
|
|
@ -17,7 +17,7 @@ from proboscis import test
|
||||||
|
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
|
|
||||||
GROUP = "dbaas.api.instances.actions"
|
GROUP = "dbaas.api.instances.actions"
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
from proboscis.asserts import *
|
from proboscis.asserts import *
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from proboscis import SkipTest
|
from proboscis import SkipTest
|
||||||
from reddwarf.tests.config import CONFIG
|
from trove.tests.config import CONFIG
|
||||||
from reddwarf.tests.api.instances import GROUP
|
from trove.tests.api.instances import GROUP
|
||||||
from reddwarf.tests.api.instances import GROUP_STOP
|
from trove.tests.api.instances import GROUP_STOP
|
||||||
from reddwarf.tests.api.instances import DeleteInstance
|
from trove.tests.api.instances import DeleteInstance
|
||||||
from reddwarf.tests.api.instances import instance_info
|
from trove.tests.api.instances import instance_info
|
||||||
from tests.util import rpc
|
from tests.util import rpc
|
||||||
|
|
||||||
# (cp16net) turn this test off because rpc code has no delete_queue method
|
# (cp16net) turn this test off because rpc code has no delete_queue method
|
||||||
|
|
|
@ -13,11 +13,11 @@ from proboscis.asserts import assert_true
|
||||||
from proboscis.asserts import Check
|
from proboscis.asserts import Check
|
||||||
from proboscis.asserts import fail
|
from proboscis.asserts import fail
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
from tests import util
|
from tests import util
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
|
|
||||||
class TestBase(object):
|
class TestBase(object):
|
||||||
|
|
|
@ -2,7 +2,7 @@ from proboscis import before_class
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from proboscis.asserts import assert_raises
|
from proboscis.asserts import assert_raises
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from tests.util import create_client
|
from tests.util import create_client
|
||||||
from tests.util import poll_until
|
from tests.util import poll_until
|
||||||
|
@ -20,8 +20,8 @@ class InstanceQuotas(object):
|
||||||
@test
|
@test
|
||||||
def test_too_many_instances(self):
|
def test_too_many_instances(self):
|
||||||
self.created_instances = []
|
self.created_instances = []
|
||||||
if 'reddwarf_max_instances_per_user' in test_config.values:
|
if 'trove_max_instances_per_user' in test_config.values:
|
||||||
too_many = test_config.values['reddwarf_max_instances_per_user']
|
too_many = test_config.values['trove_max_instances_per_user']
|
||||||
already_there = len(self.client.instances.list())
|
already_there = len(self.client.instances.list())
|
||||||
flavor = 1
|
flavor = 1
|
||||||
for i in range(too_many - already_there):
|
for i in range(too_many - already_there):
|
||||||
|
|
|
@ -23,7 +23,7 @@ from proboscis.asserts import assert_equal
|
||||||
import tests
|
import tests
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
from tests.util import poll_until
|
from tests.util import poll_until
|
||||||
from tests import FAKE_MODE
|
from tests import FAKE_MODE
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
|
|
||||||
from proboscis import before_class
|
from proboscis import before_class
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
|
@ -25,11 +25,11 @@ from proboscis.asserts import fail
|
||||||
from proboscis.check import Check
|
from proboscis.check import Check
|
||||||
|
|
||||||
import tests
|
import tests
|
||||||
from reddwarf.tests.api.instances import create_new_instance
|
from trove.tests.api.instances import create_new_instance
|
||||||
from reddwarf.tests.api.instances import instance_info
|
from trove.tests.api.instances import instance_info
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
GROUP = "dbaas.api.mgmt.hosts"
|
GROUP = "dbaas.api.mgmt.hosts"
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ from proboscis import test
|
||||||
from proboscis.asserts import assert_not_equal
|
from proboscis.asserts import assert_not_equal
|
||||||
from proboscis.decorators import time_out
|
from proboscis.decorators import time_out
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
from tests import util
|
from tests import util
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
|
|
||||||
class TestBase(object):
|
class TestBase(object):
|
||||||
|
|
|
@ -339,7 +339,7 @@ if __name__ == '__main__':
|
||||||
# front of it, automatically add that so we don't have to type as much
|
# front of it, automatically add that so we don't have to type as much
|
||||||
show_elapsed = True
|
show_elapsed = True
|
||||||
argv = []
|
argv = []
|
||||||
test_fixture = os.getenv("UNITTEST_FIXTURE", "reddwarf")
|
test_fixture = os.getenv("UNITTEST_FIXTURE", "trove")
|
||||||
for x in sys.argv:
|
for x in sys.argv:
|
||||||
if x.startswith('test_'):
|
if x.startswith('test_'):
|
||||||
argv.append('%s.tests.%s' % (test_fixture, x))
|
argv.append('%s.tests.%s' % (test_fixture, x))
|
||||||
|
|
|
@ -39,7 +39,7 @@ from tests.util import process
|
||||||
from tests.util import restart_compute_service
|
from tests.util import restart_compute_service
|
||||||
from tests.util import string_in_list
|
from tests.util import string_in_list
|
||||||
from tests.util import TestClient
|
from tests.util import TestClient
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
from tests.util.instance import InstanceTest
|
from tests.util.instance import InstanceTest
|
||||||
from tests import WHITE_BOX
|
from tests import WHITE_BOX
|
||||||
|
@ -56,12 +56,12 @@ if WHITE_BOX:
|
||||||
# from nova.compute import power_state
|
# from nova.compute import power_state
|
||||||
# from nova.compute import vm_states
|
# from nova.compute import vm_states
|
||||||
# from nova.notifier import api as notifier
|
# from nova.notifier import api as notifier
|
||||||
# from reddwarf.api.common import dbaas_mapping
|
# from trove.api.common import dbaas_mapping
|
||||||
# from reddwarf.db import api as dbapi
|
# from trove.db import api as dbapi
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
# from reddwarf.scheduler import simple # import used for FLAG values
|
# from trove.scheduler import simple # import used for FLAG values
|
||||||
# from nova import flags
|
# from nova import flags
|
||||||
# from reddwarf.compute.manager import ReddwarfInstanceMetaData
|
# from trove.compute.manager import TroveInstanceMetaData
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
VOLUME_TIME_OUT = 30
|
VOLUME_TIME_OUT = 30
|
||||||
|
@ -120,7 +120,7 @@ class VerifyManagerAbortsInstanceWhenVolumeFails(InstanceTest):
|
||||||
wait_until_scheduler_is_ready()
|
wait_until_scheduler_is_ready()
|
||||||
test_config.volume_service.stop()
|
test_config.volume_service.stop()
|
||||||
assert_false(test_config.volume_service.is_running)
|
assert_false(test_config.volume_service.is_running)
|
||||||
restart_compute_service(['--reddwarf_volume_time_out=%d'
|
restart_compute_service(['--trove_volume_time_out=%d'
|
||||||
% VOLUME_TIME_OUT])
|
% VOLUME_TIME_OUT])
|
||||||
self.init("TEST_FAIL_VOLUME_")
|
self.init("TEST_FAIL_VOLUME_")
|
||||||
self.instance_exists = False
|
self.instance_exists = False
|
||||||
|
@ -139,22 +139,22 @@ class VerifyManagerAbortsInstanceWhenVolumeFails(InstanceTest):
|
||||||
def create_instance(self):
|
def create_instance(self):
|
||||||
"""Create a new instance."""
|
"""Create a new instance."""
|
||||||
self.abort_count = count_notifications(notifier.ERROR,
|
self.abort_count = count_notifications(notifier.ERROR,
|
||||||
"reddwarf.instance.abort.volume")
|
"trove.instance.abort.volume")
|
||||||
self._create_instance()
|
self._create_instance()
|
||||||
# Use an admin context to avoid the possibility that in between the
|
# Use an admin context to avoid the possibility that in between the
|
||||||
# previous line and this one the request goes through and the instance
|
# previous line and this one the request goes through and the instance
|
||||||
# is deleted.
|
# is deleted.
|
||||||
metadata = ReddwarfInstanceMetaData(self.db,
|
metadata = TroveInstanceMetaData(self.db,
|
||||||
context.get_admin_context(), self.local_id)
|
context.get_admin_context(), self.local_id)
|
||||||
self.volume_id = metadata.volume_id
|
self.volume_id = metadata.volume_id
|
||||||
|
|
||||||
@test(depends_on=[create_instance])
|
@test(depends_on=[create_instance])
|
||||||
def wait_for_failure(self):
|
def wait_for_failure(self):
|
||||||
"""Make sure the Reddwarf Compute Manager FAILS a timed-out volume."""
|
"""Make sure the Trove Compute Manager FAILS a timed-out volume."""
|
||||||
self.instance_exists = True
|
self.instance_exists = True
|
||||||
self.wait_for_rest_api_to_show_status_as_failed(VOLUME_TIME_OUT + 30)
|
self.wait_for_rest_api_to_show_status_as_failed(VOLUME_TIME_OUT + 30)
|
||||||
abort_count2 = count_notifications(notifier.ERROR,
|
abort_count2 = count_notifications(notifier.ERROR,
|
||||||
"reddwarf.instance.abort.volume")
|
"trove.instance.abort.volume")
|
||||||
assert_true(self.abort_count < abort_count2)
|
assert_true(self.abort_count < abort_count2)
|
||||||
|
|
||||||
@test(depends_on=[wait_for_failure])
|
@test(depends_on=[wait_for_failure])
|
||||||
|
@ -190,7 +190,7 @@ class VerifyManagerAbortsInstanceWhenGuestInstallFails(InstanceTest):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Sets up the client."""
|
"""Sets up the client."""
|
||||||
wait_until_scheduler_is_ready()
|
wait_until_scheduler_is_ready()
|
||||||
restart_compute_service(['--reddwarf_guest_initialize_time_out=%d'
|
restart_compute_service(['--trove_guest_initialize_time_out=%d'
|
||||||
% GUEST_INSTALL_TIMEOUT])
|
% GUEST_INSTALL_TIMEOUT])
|
||||||
self.init("TEST_FAIL_GUEST_")
|
self.init("TEST_FAIL_GUEST_")
|
||||||
|
|
||||||
|
@ -221,9 +221,9 @@ class VerifyManagerAbortsInstanceWhenGuestInstallFails(InstanceTest):
|
||||||
@test(depends_on=[wait_for_compute_host_up])
|
@test(depends_on=[wait_for_compute_host_up])
|
||||||
def create_instance(self):
|
def create_instance(self):
|
||||||
self.abort_count = count_notifications(notifier.ERROR,
|
self.abort_count = count_notifications(notifier.ERROR,
|
||||||
"reddwarf.instance.abort.guest")
|
"trove.instance.abort.guest")
|
||||||
self._create_instance()
|
self._create_instance()
|
||||||
metadata = ReddwarfInstanceMetaData(self.db,
|
metadata = TroveInstanceMetaData(self.db,
|
||||||
context.get_admin_context(), self.local_id)
|
context.get_admin_context(), self.local_id)
|
||||||
self.volume_id = metadata.volume_id
|
self.volume_id = metadata.volume_id
|
||||||
assert_is_not_none(metadata.volume)
|
assert_is_not_none(metadata.volume)
|
||||||
|
@ -270,7 +270,7 @@ class VerifyManagerAbortsInstanceWhenGuestInstallFails(InstanceTest):
|
||||||
|
|
||||||
@test(depends_on=[should_have_created_volume])
|
@test(depends_on=[should_have_created_volume])
|
||||||
def destroy_guest_and_wait_for_failure(self):
|
def destroy_guest_and_wait_for_failure(self):
|
||||||
"""Make sure the Reddwarf Compute Manager FAILS a timed-out guest."""
|
"""Make sure the Trove Compute Manager FAILS a timed-out guest."""
|
||||||
|
|
||||||
# Utterly kill the guest install.
|
# Utterly kill the guest install.
|
||||||
process("sudo rm -rf /vz/private/%s/bin" % str(self.local_id))
|
process("sudo rm -rf /vz/private/%s/bin" % str(self.local_id))
|
||||||
|
@ -297,7 +297,7 @@ class VerifyManagerAbortsInstanceWhenGuestInstallFails(InstanceTest):
|
||||||
# to such. Although maybe that's overkill.
|
# to such. Although maybe that's overkill.
|
||||||
self._assert_status_failure(self._get_status_tuple())
|
self._assert_status_failure(self._get_status_tuple())
|
||||||
abort_count2 = count_notifications(notifier.ERROR,
|
abort_count2 = count_notifications(notifier.ERROR,
|
||||||
"reddwarf.instance.abort.guest")
|
"trove.instance.abort.guest")
|
||||||
assert_true(self.abort_count < abort_count2)
|
assert_true(self.abort_count < abort_count2)
|
||||||
|
|
||||||
@test(depends_on=[destroy_guest_and_wait_for_failure])
|
@test(depends_on=[destroy_guest_and_wait_for_failure])
|
||||||
|
|
|
@ -35,12 +35,12 @@ if WHITE_BOX:
|
||||||
from nova import utils
|
from nova import utils
|
||||||
from nova import flags
|
from nova import flags
|
||||||
import rsdns
|
import rsdns
|
||||||
from reddwarf.dns.rsdns.driver import create_client_with_flag_values
|
from trove.dns.rsdns.driver import create_client_with_flag_values
|
||||||
from reddwarf.dns.driver import DnsEntry
|
from trove.dns.driver import DnsEntry
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
from trove.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsDriver
|
from trove.dns.rsdns.driver import RsDnsDriver
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsZone
|
from trove.dns.rsdns.driver import RsDnsZone
|
||||||
from reddwarf.utils import poll_until
|
from trove.utils import poll_until
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
TEST_CONTENT = "126.1.1.1"
|
TEST_CONTENT = "126.1.1.1"
|
||||||
TEST_NAME = "hiwassup.%s" % FLAGS.dns_domain_name
|
TEST_NAME = "hiwassup.%s" % FLAGS.dns_domain_name
|
||||||
|
|
|
@ -47,7 +47,7 @@ from tests import WHITE_BOX
|
||||||
|
|
||||||
|
|
||||||
if WHITE_BOX:
|
if WHITE_BOX:
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
from trove.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
||||||
from nova import flags
|
from nova import flags
|
||||||
from nova import utils
|
from nova import utils
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
|
@ -26,9 +26,9 @@ from tests import WHITE_BOX
|
||||||
if WHITE_BOX:
|
if WHITE_BOX:
|
||||||
from nova import flags
|
from nova import flags
|
||||||
from rsdns.client.records import Record
|
from rsdns.client.records import Record
|
||||||
from reddwarf.dns.rsdns.driver import EntryToRecordConverter
|
from trove.dns.rsdns.driver import EntryToRecordConverter
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
from trove.dns.rsdns.driver import RsDnsInstanceEntryFactory
|
||||||
from reddwarf.dns.rsdns.driver import RsDnsZone
|
from trove.dns.rsdns.driver import RsDnsZone
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
driver = None
|
driver = None
|
||||||
DEFAULT_ZONE = RsDnsZone(1, "dbaas.rackspace.org")
|
DEFAULT_ZONE = RsDnsZone(1, "dbaas.rackspace.org")
|
||||||
|
|
|
@ -4,12 +4,12 @@ import unittest
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from proboscis.decorators import time_out
|
from proboscis.decorators import time_out
|
||||||
|
|
||||||
from reddwarfclient import Dbaas
|
from troveclient import Dbaas
|
||||||
|
|
||||||
from reddwarf.tests.api.instances import instance_info
|
from trove.tests.api.instances import instance_info
|
||||||
from reddwarf.tests.api.instances import GROUP_START as INSTANCE_START
|
from trove.tests.api.instances import GROUP_START as INSTANCE_START
|
||||||
from reddwarf.tests.api.instances import GROUP_TEST
|
from trove.tests.api.instances import GROUP_TEST
|
||||||
from reddwarf.tests.api.instances import GROUP_STOP as INSTANCE_STOP
|
from trove.tests.api.instances import GROUP_STOP as INSTANCE_STOP
|
||||||
from tests import WHITE_BOX
|
from tests import WHITE_BOX
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ if WHITE_BOX:
|
||||||
# from nova import flags
|
# from nova import flags
|
||||||
# from nova import utils
|
# from nova import utils
|
||||||
|
|
||||||
# from reddwarf import exception
|
# from trove import exception
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
|
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ from tests.util.rpc import Rabbit
|
||||||
|
|
||||||
|
|
||||||
if WHITE_BOX:
|
if WHITE_BOX:
|
||||||
from reddwarf.common.context import ReddwarfContext
|
from trove.common.context import TroveContext
|
||||||
from reddwarf.openstack.common import rpc
|
from trove.openstack.common import rpc
|
||||||
|
|
||||||
|
|
||||||
def topic_name():
|
def topic_name():
|
||||||
|
@ -82,7 +82,7 @@ class WhenAgentRunsAsRabbitGoesUpAndDown(object):
|
||||||
@time_out(25)
|
@time_out(25)
|
||||||
def _send_msg_with_timeout(self):
|
def _send_msg_with_timeout(self):
|
||||||
self.rabbit.declare_queue(topic_name())
|
self.rabbit.declare_queue(topic_name())
|
||||||
context = ReddwarfContext(is_admin=True, limit=5, marker=None)
|
context = TroveContext(is_admin=True, limit=5, marker=None)
|
||||||
version = rpc.call(context,
|
version = rpc.call(context,
|
||||||
topic_name(),
|
topic_name(),
|
||||||
{"method": "version",
|
{"method": "version",
|
||||||
|
|
|
@ -164,9 +164,9 @@ def start_nova_api():
|
||||||
@test(groups=["services.initialize"],
|
@test(groups=["services.initialize"],
|
||||||
depends_on_classes=[start_nova_api],
|
depends_on_classes=[start_nova_api],
|
||||||
enabled=START_SERVICES)
|
enabled=START_SERVICES)
|
||||||
def start_reddwarf_api():
|
def start_trove_api():
|
||||||
"""Starts the Reddwarf Service."""
|
"""Starts the Trove Service."""
|
||||||
Daemon(service_path_root="reddwarf_code_root",
|
Daemon(service_path_root="trove_code_root",
|
||||||
service_path="%s/bin/reddwarf-api",
|
service_path="%s/bin/trove-api",
|
||||||
extra_cmds=['--config-file='],
|
extra_cmds=['--config-file='],
|
||||||
conf_file_name="reddwarf_conf").run()
|
conf_file_name="trove_conf").run()
|
||||||
|
|
|
@ -29,9 +29,9 @@ from proboscis.asserts import fail
|
||||||
from proboscis.decorators import expect_exception
|
from proboscis.decorators import expect_exception
|
||||||
from proboscis.decorators import time_out
|
from proboscis.decorators import time_out
|
||||||
|
|
||||||
from reddwarf.tests.api.instances import GROUP_START
|
from trove.tests.api.instances import GROUP_START
|
||||||
from reddwarf.tests.api.instances import GROUP_TEST
|
from trove.tests.api.instances import GROUP_TEST
|
||||||
from reddwarf.tests.api.instances import instance_info
|
from trove.tests.api.instances import instance_info
|
||||||
|
|
||||||
from tests.util import TestClient
|
from tests.util import TestClient
|
||||||
from tests.util import check_database
|
from tests.util import check_database
|
||||||
|
@ -42,7 +42,7 @@ from tests.util import restart_compute_service
|
||||||
from tests.util import string_in_list
|
from tests.util import string_in_list
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from tests.util.instance import InstanceTest
|
from tests.util.instance import InstanceTest
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
from tests import WHITE_BOX
|
from tests import WHITE_BOX
|
||||||
|
|
||||||
|
@ -60,11 +60,11 @@ if WHITE_BOX:
|
||||||
# from nova.scheduler.driver import Scheduler
|
# from nova.scheduler.driver import Scheduler
|
||||||
# from nova.virt import openvz_conn
|
# from nova.virt import openvz_conn
|
||||||
|
|
||||||
# from reddwarf.api.common import dbaas_mapping
|
# from trove.api.common import dbaas_mapping
|
||||||
# from reddwarf.db import api as dbapi
|
# from trove.db import api as dbapi
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
# from reddwarf.scheduler import simple # import used for FLAG values
|
# from trove.scheduler import simple # import used for FLAG values
|
||||||
# from reddwarf.compute.manager import ReddwarfInstanceMetaData
|
# from trove.compute.manager import TroveInstanceMetaData
|
||||||
|
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ from datetime import timedelta
|
||||||
|
|
||||||
from nose.tools import assert_raises
|
from nose.tools import assert_raises
|
||||||
|
|
||||||
from reddwarfclient.exceptions import NotFound
|
from troveclient.exceptions import NotFound
|
||||||
|
|
||||||
from proboscis import after_class
|
from proboscis import after_class
|
||||||
from proboscis import before_class
|
from proboscis import before_class
|
||||||
|
@ -45,12 +45,12 @@ if WHITE_BOX:
|
||||||
# from nova import utils
|
# from nova import utils
|
||||||
# from nova.db import api as db_api
|
# from nova.db import api as db_api
|
||||||
|
|
||||||
# from reddwarf.compute.manager import ReddwarfInstanceInitializer
|
# from trove.compute.manager import TroveInstanceInitializer
|
||||||
# from reddwarf.reaper import driver # Do this to get the FLAG values.
|
# from trove.reaper import driver # Do this to get the FLAG values.
|
||||||
|
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
GROUP = 'reddwarf.reaper'
|
GROUP = 'trove.reaper'
|
||||||
|
|
||||||
|
|
||||||
@test(groups=[GROUP, GROUP + ".volume"],
|
@test(groups=[GROUP, GROUP + ".volume"],
|
||||||
|
@ -81,15 +81,15 @@ class ReaperShouldKillOlderUnattachedVolumes(InstanceTest):
|
||||||
@test(depends_on=[create_instance])
|
@test(depends_on=[create_instance])
|
||||||
def wait_for_volume(self):
|
def wait_for_volume(self):
|
||||||
"""Wait for the volume to become ready."""
|
"""Wait for the volume to become ready."""
|
||||||
initializer = ReddwarfInstanceInitializer(None, db_api,
|
initializer = TroveInstanceInitializer(None, db_api,
|
||||||
context.get_admin_context(),
|
context.get_admin_context(),
|
||||||
None, self.volume_id)
|
None, self.volume_id)
|
||||||
initializer.wait_until_volume_is_ready(FLAGS.reddwarf_volume_time_out)
|
initializer.wait_until_volume_is_ready(FLAGS.trove_volume_time_out)
|
||||||
|
|
||||||
@test(depends_on=[wait_for_volume])
|
@test(depends_on=[wait_for_volume])
|
||||||
def make_volume_look_old(self):
|
def make_volume_look_old(self):
|
||||||
"""Set the volume's updated_at time to long ago."""
|
"""Set the volume's updated_at time to long ago."""
|
||||||
expiration_time = FLAGS.reddwarf_reaper_orphan_volume_expiration_time
|
expiration_time = FLAGS.trove_reaper_orphan_volume_expiration_time
|
||||||
updated_at = utils.utcnow() - timedelta(seconds=expiration_time * 2)
|
updated_at = utils.utcnow() - timedelta(seconds=expiration_time * 2)
|
||||||
db_api.volume_update(context.get_admin_context(), self.volume_id,
|
db_api.volume_update(context.get_admin_context(), self.volume_id,
|
||||||
{"updated_at": updated_at})
|
{"updated_at": updated_at})
|
||||||
|
@ -104,6 +104,6 @@ class ReaperShouldKillOlderUnattachedVolumes(InstanceTest):
|
||||||
wait_for_compute_service()
|
wait_for_compute_service()
|
||||||
# When the compute service comes back online, periodic tasks will
|
# When the compute service comes back online, periodic tasks will
|
||||||
# see the instance and delete it.
|
# see the instance and delete it.
|
||||||
time_out = FLAGS.reddwarf_volume_time_out + 30
|
time_out = FLAGS.trove_volume_time_out + 30
|
||||||
assert_raises(NotFound, self.dbaas.instances.get, self.id)
|
assert_raises(NotFound, self.dbaas.instances.get, self.id)
|
||||||
#TODO: Make sure quotas aren't affected.
|
#TODO: Make sure quotas aren't affected.
|
||||||
|
|
|
@ -13,11 +13,11 @@ from proboscis.asserts import assert_true
|
||||||
from proboscis.asserts import Check
|
from proboscis.asserts import Check
|
||||||
from proboscis.asserts import fail
|
from proboscis.asserts import fail
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
from tests import util
|
from tests import util
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
from tests.util import report
|
from tests.util import report
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ from proboscis import test
|
||||||
|
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
|
|
||||||
@test(groups=["recreates.login"])
|
@test(groups=["recreates.login"])
|
||||||
|
|
|
@ -21,7 +21,7 @@ from nose.tools import assert_almost_equal
|
||||||
from nose.tools import assert_equal
|
from nose.tools import assert_equal
|
||||||
from nose.tools import assert_not_almost_equal
|
from nose.tools import assert_not_almost_equal
|
||||||
from nose.tools import assert_true
|
from nose.tools import assert_true
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from proboscis.decorators import expect_exception
|
from proboscis.decorators import expect_exception
|
||||||
from proboscis.decorators import time_out
|
from proboscis.decorators import time_out
|
||||||
|
@ -33,7 +33,7 @@ from tests.util import TestClient
|
||||||
from tests.util import count_notifications
|
from tests.util import count_notifications
|
||||||
from tests.util import create_dbaas_client
|
from tests.util import create_dbaas_client
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
from tests.volumes import VOLUMES_DRIVER
|
from tests.volumes import VOLUMES_DRIVER
|
||||||
|
|
||||||
if WHITE_BOX:
|
if WHITE_BOX:
|
||||||
|
@ -46,7 +46,7 @@ if WHITE_BOX:
|
||||||
# from nova.notifier import api as notifier
|
# from nova.notifier import api as notifier
|
||||||
# from nova.utils import LoopingCall
|
# from nova.utils import LoopingCall
|
||||||
|
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
GROUP = SCHEDULER_DRIVER_GROUP
|
GROUP = SCHEDULER_DRIVER_GROUP
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from reddwarfclient.instances import InstanceStatus
|
from troveclient.instances import InstanceStatus
|
||||||
from proboscis.asserts import assert_equal
|
from proboscis.asserts import assert_equal
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from tests.util.generation import InstanceGenerator
|
from tests.util.generation import InstanceGenerator
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
# This emulates the old way we did things, which was to load the config
|
# This emulates the old way we did things, which was to load the config
|
||||||
# as a module.
|
# as a module.
|
||||||
# TODO(tim.simpson): Change all references from "test_config" to CONFIG.
|
# TODO(tim.simpson): Change all references from "test_config" to CONFIG.
|
||||||
from reddwarf.tests.config import CONFIG as test_config
|
from trove.tests.config import CONFIG as test_config
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -45,7 +45,7 @@ except ImportError:
|
||||||
|
|
||||||
from sqlalchemy import create_engine
|
from sqlalchemy import create_engine
|
||||||
|
|
||||||
from reddwarfclient import exceptions
|
from troveclient import exceptions
|
||||||
|
|
||||||
from proboscis import test
|
from proboscis import test
|
||||||
from proboscis.asserts import assert_false
|
from proboscis.asserts import assert_false
|
||||||
|
@ -55,26 +55,26 @@ from proboscis.asserts import Check
|
||||||
from proboscis.asserts import fail
|
from proboscis.asserts import fail
|
||||||
from proboscis.asserts import ASSERTION_ERROR
|
from proboscis.asserts import ASSERTION_ERROR
|
||||||
from proboscis import SkipTest
|
from proboscis import SkipTest
|
||||||
from reddwarfclient import Dbaas
|
from troveclient import Dbaas
|
||||||
from reddwarfclient.client import ReddwarfHTTPClient
|
from troveclient.client import TroveHTTPClient
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.client import TestClient as TestClient
|
from trove.tests.util.client import TestClient as TestClient
|
||||||
from tests.util.topics import hosts_up
|
from tests.util.topics import hosts_up
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
|
|
||||||
|
|
||||||
# Import these older methods from their new home.
|
# Import these older methods from their new home.
|
||||||
# TODO(tim.simpson): Change tests to import these functions from their new home.
|
# TODO(tim.simpson): Change tests to import these functions from their new home.
|
||||||
from reddwarf.tests.util import assert_http_code
|
from trove.tests.util import assert_http_code
|
||||||
from reddwarf.tests.util import create_client
|
from trove.tests.util import create_client
|
||||||
from reddwarf.tests.util import create_dbaas_client
|
from trove.tests.util import create_dbaas_client
|
||||||
from reddwarf.tests.util import create_nova_client
|
from trove.tests.util import create_nova_client
|
||||||
from reddwarf.tests.util import process
|
from trove.tests.util import process
|
||||||
from reddwarf.tests.util import string_in_list
|
from trove.tests.util import string_in_list
|
||||||
from reddwarf.tests.util import PollTimeOut
|
from trove.tests.util import PollTimeOut
|
||||||
from reddwarf.tests.util import poll_until
|
from trove.tests.util import poll_until
|
||||||
from reddwarf.tests.util import LocalSqlClient
|
from trove.tests.util import LocalSqlClient
|
||||||
from reddwarf.tests.util import check
|
from trove.tests.util import check
|
||||||
|
|
||||||
|
|
||||||
WHITE_BOX = test_config.white_box
|
WHITE_BOX = test_config.white_box
|
||||||
|
@ -211,7 +211,7 @@ def wait_for_compute_service():
|
||||||
|
|
||||||
def should_run_rsdns_tests():
|
def should_run_rsdns_tests():
|
||||||
"""If true, then the RS DNS tests should also be run."""
|
"""If true, then the RS DNS tests should also be run."""
|
||||||
return test_config.values.get("reddwarf_dns_support", False)
|
return test_config.values.get("trove_dns_support", False)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,10 @@ from proboscis.asserts import assert_true
|
||||||
from proboscis.asserts import assert_is_not_none
|
from proboscis.asserts import assert_is_not_none
|
||||||
from proboscis.asserts import fail
|
from proboscis.asserts import fail
|
||||||
|
|
||||||
from reddwarfclient.exceptions import NotFound as NotFound404
|
from troveclient.exceptions import NotFound as NotFound404
|
||||||
from tests.util import report
|
from tests.util import report
|
||||||
from tests.util import test_config
|
from tests.util import test_config
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
from tests import WHITE_BOX
|
from tests import WHITE_BOX
|
||||||
|
|
||||||
if WHITE_BOX:
|
if WHITE_BOX:
|
||||||
|
@ -36,11 +36,11 @@ if WHITE_BOX:
|
||||||
# from nova import utils
|
# from nova import utils
|
||||||
# from nova.compute import power_state
|
# from nova.compute import power_state
|
||||||
# from nova import exception
|
# from nova import exception
|
||||||
# from reddwarf.api.common import dbaas_mapping
|
# from trove.api.common import dbaas_mapping
|
||||||
# from reddwarf.compute.manager import ReddwarfInstanceMetaData
|
# from trove.compute.manager import TroveInstanceMetaData
|
||||||
# from reddwarf.compute.manager import VALID_ABORT_STATES
|
# from trove.compute.manager import VALID_ABORT_STATES
|
||||||
# from reddwarf.db import api as dbapi
|
# from trove.db import api as dbapi
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
|
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class InstanceTest(object):
|
||||||
|
|
||||||
def _get_instance_volume(self):
|
def _get_instance_volume(self):
|
||||||
"""After _create_instance is called, this will return the volume ID."""
|
"""After _create_instance is called, this will return the volume ID."""
|
||||||
metadata = ReddwarfInstanceMetaData(self.db,
|
metadata = TroveInstanceMetaData(self.db,
|
||||||
context.get_admin_context(), self.local_id)
|
context.get_admin_context(), self.local_id)
|
||||||
assert_is_not_none(metadata.volume)
|
assert_is_not_none(metadata.volume)
|
||||||
self.volume_id = metadata.volume_id
|
self.volume_id = metadata.volume_id
|
||||||
|
@ -205,7 +205,7 @@ class InstanceTest(object):
|
||||||
poll_until(self._get_compute_instance_state,
|
poll_until(self._get_compute_instance_state,
|
||||||
lambda state: state in VALID_ABORT_STATES,
|
lambda state: state in VALID_ABORT_STATES,
|
||||||
sleep_time=1,
|
sleep_time=1,
|
||||||
time_out=FLAGS.reddwarf_instance_suspend_time_out)
|
time_out=FLAGS.trove_instance_suspend_time_out)
|
||||||
|
|
||||||
def _check_volume_detached(self):
|
def _check_volume_detached(self):
|
||||||
result = self.db.volume_get(context.get_admin_context(),
|
result = self.db.volume_get(context.get_admin_context(),
|
||||||
|
|
|
@ -35,8 +35,8 @@ if test_config.values.get('rabbit_runs_locally', False) == True:
|
||||||
|
|
||||||
def declare_queue(self, topic):
|
def declare_queue(self, topic):
|
||||||
"""Call this to declare a queue from Python."""
|
"""Call this to declare a queue from Python."""
|
||||||
#from reddwarf.rpc.impl_kombu import Connection
|
#from trove.rpc.impl_kombu import Connection
|
||||||
from reddwarf.openstack.common.rpc import create_connection
|
from trove.openstack.common.rpc import create_connection
|
||||||
with create_connection() as conn:
|
with create_connection() as conn:
|
||||||
consumer = conn.declare_topic_consumer(topic=topic)
|
consumer = conn.declare_topic_consumer(topic=topic)
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from reddwarf.tests.util.users import Requirements
|
from trove.tests.util.users import Requirements
|
||||||
from reddwarf.tests.util.users import ServiceUser
|
from trove.tests.util.users import ServiceUser
|
||||||
from reddwarf.tests.util.users import Users
|
from trove.tests.util.users import Users
|
||||||
|
|
||||||
USER_LIST = [
|
USER_LIST = [
|
||||||
{"auth_user":"admin",
|
{"auth_user":"admin",
|
||||||
|
|
|
@ -22,4 +22,4 @@
|
||||||
|
|
||||||
# Is a set of tests written directly against the VolumeManager and VolumeClient
|
# Is a set of tests written directly against the VolumeManager and VolumeClient
|
||||||
# classes which doesn't require standing up Nova daemons or anything.
|
# classes which doesn't require standing up Nova daemons or anything.
|
||||||
VOLUMES_DRIVER = "reddwarf.volumes.driver"
|
VOLUMES_DRIVER = "trove.volumes.driver"
|
||||||
|
|
|
@ -43,10 +43,10 @@ if WHITE_BOX:
|
||||||
# from nova import exception
|
# from nova import exception
|
||||||
# from nova import flags
|
# from nova import flags
|
||||||
# from nova import utils
|
# from nova import utils
|
||||||
# from reddwarf import exception as reddwarf_exception
|
# from trove import exception as trove_exception
|
||||||
# from reddwarf.utils import poll_until
|
# from trove.utils import poll_until
|
||||||
# from reddwarf import volume
|
# from trove import volume
|
||||||
# from reddwarf.tests.volume import driver as test_driver
|
# from trove.tests.volume import driver as test_driver
|
||||||
|
|
||||||
# FLAGS = flags.FLAGS
|
# FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ class ResizeVolume(VolumeTest):
|
||||||
def test_resizefs_rescan(self):
|
def test_resizefs_rescan(self):
|
||||||
self.story.client.resize_fs(self.story.context,
|
self.story.client.resize_fs(self.story.context,
|
||||||
self.story.volume_id)
|
self.story.volume_id)
|
||||||
expected = "reddwarf.tests.volume.driver.ISCSITestDriver"
|
expected = "trove.tests.volume.driver.ISCSITestDriver"
|
||||||
if FLAGS.volume_driver is expected:
|
if FLAGS.volume_driver is expected:
|
||||||
size = self.story.resize_volume_size * \
|
size = self.story.resize_volume_size * \
|
||||||
test_driver.TESTS_VOLUME_SIZE_MULTIPLIER * 1024 * 1024
|
test_driver.TESTS_VOLUME_SIZE_MULTIPLIER * 1024 * 1024
|
||||||
|
@ -451,7 +451,7 @@ class GrabUuid(VolumeTest):
|
||||||
"""DevicePathInvalidForUuid is raised if device_path is wrong."""
|
"""DevicePathInvalidForUuid is raised if device_path is wrong."""
|
||||||
client = self.story.client
|
client = self.story.client
|
||||||
device_path = "gdfjghsfjkhggrsyiyerreygghdsghsdfjhf"
|
device_path = "gdfjghsfjkhggrsyiyerreygghdsghsdfjhf"
|
||||||
self.assertRaises(reddwarf_exception.DevicePathInvalidForUuid,
|
self.assertRaises(trove_exception.DevicePathInvalidForUuid,
|
||||||
client.get_uuid, device_path)
|
client.get_uuid, device_path)
|
||||||
|
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ class ConfirmMissing(VolumeTest):
|
||||||
self.fail("Expecting an error but did not get one.")
|
self.fail("Expecting an error but did not get one.")
|
||||||
except exception.Error:
|
except exception.Error:
|
||||||
pass
|
pass
|
||||||
except reddwarf_exception.ISCSITargetNotDiscoverable:
|
except trove_exception.ISCSITargetNotDiscoverable:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@time_out(60)
|
@time_out(60)
|
||||||
|
|
Loading…
Reference in New Issue