# Set test script variables export VIRT_NUM=${VIRT_NUM:-'1'} export VIRT_CPUS=${VIRT_CPUS:-'10'} export VIRT_MEM=${VIRT_MEM:-'8192'} export VIRT_DISK=${VIRT_DISK:-'30G'} export CLEAN_OLD_DATA=${CLEAN_OLD_DATA:-true} export COMPASS_SERVER_URL=${COMPASS_SERVER_URL:-"http://$ipaddr/api"} export COMPASS_USER_EMAIL=${COMPASS_USER_EMAIL:-'admin@huawei.com'} export COMPASS_USER_PASSWORD=${COMPASS_USER_PASSWORD:-'admin'} export CLUSTER_NAME=${CLUSTER_NAME:-'test_cluster'} export SWITCH_IPS=${SWITCH_IPS:-'10.145.81.219'} export SWITCH_VERSION=${SWITCH_VERSION:-'2c'} export SWITCH_COMMUNITY=${SWITCH_COMMUNITY:-'public'} export SWITCH_CREDENTIAL=${SWITCH_CREDENTIAL:-"version=${SWITCH_VERSION},community=${SWITCH_COMMUNITY}"} export USE_POLL_SWITCHES=${USE_POLL_SWITCHES:-false} export LANGUAGE=${LANGUAGE:-'EN'} export TIMEZONE=${TIMEZONE:-'America/Los_Angeles'} export HOSTNAMES=${HOSTNAMES:-'allinone'} export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)centos.*'} export ADAPTER_NAME=${ADAPTER_NAME:=''} export ADAPTER_TARGET_SYSTEM_PATTERN=${ADAPTER_TARGET_SYSTEM_PATTERN:-'openstack.*'} export ADAPTER_FLAVOR_PATTERN=${ADAPTER_FLAVOR_PATTERN:-'allinone'} export HOST_ROLES=${HOST_ROLES:-'allinone=allinone-compute'} export DEFAULT_ROLES=${DEFAULT_ROLES:-'allinone-compute'} export NAMESERVERS=${NAMESERVERS:-$ipaddr} export NTP_SERVER=${NTP_SERVER:-$ipaddr} export GATEWAY=${GATEWAY:-$ipaddr} export PROXY=${PROXY:-http://$ipaddr:3128} export IGNORE_PROXY=${IGNORE_PROXY:-"127.0.0.1,localhost,$ipaddr,$HOSTNAME"} export DOMAIN=${DOMAIN:-'ods.com'} export SEARCH_PATH=${SEARCH_PATH:-${DOMAIN}} export HOME_PERCENTAGE=${HOME_PERCENTAGE:-'5'} export TMP_PERCENTAGE=${TMP_PERCENTAGE:-'5'} export VAR_PERCENTAGE=${VAR_PERCENTAGE:-'10'} export PARTITION=${PARTITION:-"/home=${HOME_PERCENTAGE}%,/tmp=${TMP_PERCENTAGE}%,/var=${VAR_PERCENTAGE}%"} function ip_subnet { ip_addr=$1 ip_base="$(echo $ip_addr | cut -d. -f'1 2 3')" echo "${ip_base}.0/24" } if [ -z "$MANAGEMENT_SUBNET" ]; then export MANAGEMENT_SUBNET=$(ip_subnet $ipaddr) fi export TENANT_SUBNET=${TENANT_SUBNET:-'172.16.2.0/24'} export PUBLIC_SUBNET=${PUBLIC_SUBNET:-'172.16.3.0/24'} export STORAGE_SUBNET=${STORAGE_SUBNET:-'172.16.4.0/24'} export SUBNETS=${SUBNETS:-"${MANAGEMENT_SUBNET},${TENANT_SUBNET},${PUBLIC_SUBNET},${STORAGE_SUBNET}"} export SERVER_USERNAME=${SERVER_USERNAME:-root} export SERVER_PASSWORD=${SERVER_PASSWORD:-root} export SERVER_CREDENTIAL=${SERVER_CREDENTIAL:-"${SERVER_USERNAME}=${SERVER_PASSWORD}"} export SERVICE_USERNAME=${SERVICE_USERNAME:-service} export SERVICE_PASSWORD=${SERVICE_PASSWORD:-service} export SERVICE_IMAGE_CREDENTIAL=${SERVICE_IMAGE_CREDENTIAL:-"image:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_COMPUTE_CREDENTIAL=${SERVICE_COMPUTE_CREDENTIAL:-"compute:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_DASHBOARD_CREDENTIAL=${SERVICE_DASHBOARD_CREDENTIAL:-"dashboard:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_IDENTITY_CREDENTIAL=${SERVICE_IDENTITY_CREDENTIAL:-"identity:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_METERING_CREDENTIAL=${SERVICE_METERING_CREDENTIAL:-"metering:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_RABBITMQ_CREDENTIAL=${SERVICE_RABBITMQ_CREDENTIAL:-"rabbitmq:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_VOLUME_CREDENTIAL=${SERVICE_VOLUME_CREDENTIAL:-"volume:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_MYSQL_CREDENTIAL=${SERVICE_MYSQL_CREDENTIAL:-"mysql:${SERVICE_USERNAME}=${SERVICE_PASSWORD}"} export SERVICE_CREDENTIALS=${SERVICE_CREDENTIALS:-"${SERVICE_IMAGE_CREDENTIAL},${SERVICE_COMPUTE_CREDENTIAL},${SERVICE_DASHBOARD_CREDENTIAL},${SERVICE_IDENTITY_CREDENTIAL},${SERVICE_METERING_CREDENTIAL},${SERVICE_RABBITMQ_CREDENTIAL},${SERVICE_VOLUME_CREDENTIAL},${SERVICE_MYSQL_CREDENTIAL}"} export CONSOLE_USERNAME=${CONSOLE_USERNAME:-console} export CONSOLE_PASSWORD=${CONSOLE_PASSWORD:-console} export CONSOLE_ADMIN_CREDENTIAL=${CONSOLE_ADMIN_CREDENTIAL:-"admin:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_COMPUTE_CREDENTIAL=${CONSOLE_COMPUTE_CREDENTIAL:-"compute:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_DASHBOARD_CREDENTIAL=${CONSOLE_DASHBOARD_CREDENTIAL:-"dashboard:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_IMAGE_CREDENTIAL=${CONSOLE_IMAGE_CREDENTIAL:-"image:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_METERING_CREDENTIAL=${CONSOLE_METERING_CREDENTIAL:-"metering:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_NETWORK_CREDENTIAL=${CONSOLE_NETWORK_CREDENTIAL:-"network:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_OBJECT_STORE_CREDENTIAL=${CONSOLE_OBJECT_STORE_CREDENTIAL:-"object-store:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_VOLUME_CREDENTIAL=${CONSOLE_VOLUME_CREDENTIAL:-"volume:${CONSOLE_USERNAME}=${CONSOLE_PASSWORD}"} export CONSOLE_CREDENTIALS=${CONSOLE_CREDENTIALS:-"${CONSOLE_ADMIN_CREDENTIAL},${CONSOLE_COMPUTE_CREDENTIAL},${CONSOLE_DASHBOARD_CREDENTIAL},${CONSOLE_IMAGE_CREDENTIAL},${CONSOLE_METERING_CREDENTIAL},${CONSOLE_NETWORK_CREDENTIAL},${CONSOLE_OBJECT_STORE_CREDENTIAL},${CONSOLE_VOLUME_CREDENTIAL}"} export MANAGEMENT_IP_START=${MANAGEMENT_IP_START:-`echo $ipaddr |cut -d. -f'1 2 3'`.50} export TENANT_IP_START=${TENANT_IP_START:-'172.16.2.1'} export PUBLIC_IP_START=${PUBLIC_IP_START:-'172.16.3.1'} export STORAGE_IP_START=${STORAGE_IP_START:-'172.16.4.1'} export MANAGEMENT_INTERFACE=${MANAGEMENT_INTERFACE:-eth0} export TENANT_INTERFACE=${TENANT_INTERFACE:-eth1} export STORAGE_INTERFACE=${STORAGE_INTERFACE:-eth3} export PUBLIC_INTERFACE=${PUBLIC_INTERFACE:-eth2} function next_ip { ip_addr=$1 ip_base="$(echo $ip_addr | cut -d. -f'1 2 3')" ip_last="$(echo $ip_addr | cut -d. -f4)" let ip_last_next=$ip_last+1 echo "${ip_base}.${ip_last_next}" } if [ -z "$HOST_NETWORKS" ]; then IFS=, read -a HOSTNAME_LIST <<< "$HOSTNAMES" MANAGE_IP=${MANAGEMENT_IP_START} TENANT_IP=${TENANT_IP_START} PUBLIC_IP=${PUBLIC_IP_START} STORAGE_IP=${STORAGE_IP_START} for HOSTNAME in ${HOSTNAME_LIST[@]}; do if [ -z "$HOST_NETWORKS" ]; then HOST_NETWORKS="${HOSTNAME}:${MANAGEMENT_INTERFACE}=${MANAGE_IP}|is_mgmt,${TENANT_INTERFACE}=${TENANT_IP},${PUBLIC_INTERFACE}=${PUBLIC_IP}|is_promiscuous,${STORAGE_INTERFACE}=${STORAGE_IP}" else HOST_NETWORKS="${HOST_NETWORKS};${HOSTNAME}:${MANAGEMENT_INTERFACE}=${MANAGE_IP},${TENANT_INTERFACE}=${TENANT_IP},${PUBLIC_INTERFACE}=${PUBLIC_IP},${STORAGE_INTERFACE}=${STORAGE_IP}" fi MANAGE_IP=$(next_ip ${MANAGE_IP}) TENANT_IP=$(next_ip ${TENANT_IP}) PUBLIC_IP=$(next_ip ${PUBLIC_IP}) STORAGE_IP=$(next_ip ${STORAGE_IP}) done export HOST_NETWORKS fi export NETWORK_MAPPING=${NETWORK_MAPPING:-"management=${MANAGEMENT_INTERFACE},tenant=${TENANT_INTERFACE},storage=${STORAGE_INTERFACE},public=${PUBLIC_INTERFACE}"} export DEPLOYMENT_TIMEOUT=${DEPLOYMENT_TIMEOUT:-"90"} export DASHBOARD_URL=${DASHBOARD_URL:-"http://${MANAGEMENT_IP_START}"}