Change remaining 'savanna' references in sahara/tests
These changes remove the remaining 'savanna' references under the 'tests' dir to 'sahara' and modify necessary files outside of 'tests' to make unit and integration tests pass. * Change member savanna_config to sahara_config for alembic * Change description strings in sahara/resources * Change exception strings in plugin validation * Change tests/README * Change param names, defaults, and help in integration tests config.py * Change alembic migration test lock prefix * Change SAVANNA_MYSQL_PRESENT and SAVANNA_TEST_POSTGRESQL_PRESENT in alembic tests * Change 'Generated by' message in crypto.py Partial-Implements: blueprint savanna-renaming-service Change-Id: I11e1bab1fce76a411a8659b947e7bae90ea521a9
This commit is contained in:
parent
b28c7703a3
commit
e6d97384d3
|
@ -31,7 +31,7 @@ importutils.import_module('sahara.db.sqlalchemy.models')
|
|||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
savanna_config = config.savanna_config
|
||||
sahara_config = config.sahara_config
|
||||
|
||||
# Interpret the config file for Python logging.
|
||||
# This line sets up loggers basically.
|
||||
|
@ -61,7 +61,7 @@ def run_migrations_offline():
|
|||
script output.
|
||||
|
||||
"""
|
||||
context.configure(url=savanna_config.database.connection)
|
||||
context.configure(url=sahara_config.database.connection)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
@ -75,7 +75,7 @@ def run_migrations_online():
|
|||
|
||||
"""
|
||||
engine = create_engine(
|
||||
savanna_config.database.connection,
|
||||
sahara_config.database.connection,
|
||||
poolclass=pool.NullPool)
|
||||
|
||||
connection = engine.connect()
|
||||
|
|
|
@ -105,7 +105,7 @@ def main():
|
|||
config.set_main_option('script_location',
|
||||
'sahara.db.migration:alembic_migrations')
|
||||
# attach the Sahara conf to the Alembic conf
|
||||
config.savanna_config = CONF
|
||||
config.sahara_config = CONF
|
||||
|
||||
CONF(project='sahara')
|
||||
CONF.command.func(config, CONF.command.name)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Hadoop Cluster by Savanna",
|
||||
"Description" : "Hadoop Cluster by Sahara",
|
||||
|
||||
"Resources" : {
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ def _get_plugin_configs(plugin_name, hadoop_version, scope=None):
|
|||
|
||||
def check_plugin_name_exists(name):
|
||||
if name not in [p.name for p in api.get_plugins()]:
|
||||
raise ex.InvalidException("Savanna doesn't contain plugin with name "
|
||||
raise ex.InvalidException("Sahara doesn't contain plugin with name "
|
||||
"'%s'" % name)
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
=====================
|
||||
Savanna Testing Infra
|
||||
Sahara Testing Infra
|
||||
=====================
|
||||
|
||||
This README file attempts to provide current and prospective contributors with
|
||||
everything they need to know in order to start creating unit tests for Savanna.
|
||||
everything they need to know in order to start creating unit tests for Sahara.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Integration tests for Savanna project
|
||||
Integration tests for Sahara project
|
||||
=====================================
|
||||
|
||||
How to run
|
||||
|
@ -25,7 +25,7 @@ For example: `tox -e integration -- vanilla` or `tox -e integration vanilla hdp`
|
|||
Contents
|
||||
--------
|
||||
|
||||
These integration tests check capacity for work of two plugins for Savanna:
|
||||
These integration tests check capacity for work of two plugins for Sahara:
|
||||
Vanilla and HDP.
|
||||
|
||||
Vanilla plugin has the following checks:
|
||||
|
|
|
@ -52,15 +52,15 @@ COMMON_CONFIG_OPTS = [
|
|||
cfg.StrOpt('SWIFT_AUTH_VERSION',
|
||||
default=2,
|
||||
help='OpenStack auth version for Swift.'),
|
||||
cfg.StrOpt('SAVANNA_HOST',
|
||||
cfg.StrOpt('SAHARA_HOST',
|
||||
default='127.0.0.1',
|
||||
help='Host for Savanna.'),
|
||||
cfg.IntOpt('SAVANNA_PORT',
|
||||
help='Host for Sahara.'),
|
||||
cfg.IntOpt('SAHARA_PORT',
|
||||
default=8386,
|
||||
help='Port for Savanna.'),
|
||||
cfg.StrOpt('SAVANNA_API_VERSION',
|
||||
help='Port for Sahara.'),
|
||||
cfg.StrOpt('SAHARA_API_VERSION',
|
||||
default='1.1',
|
||||
help='API version for Savanna.'),
|
||||
help='API version for Sahara.'),
|
||||
cfg.StrOpt('FLAVOR_ID',
|
||||
default=None,
|
||||
help='OpenStack flavor ID for virtual machines. If you leave '
|
||||
|
@ -91,8 +91,8 @@ COMMON_CONFIG_OPTS = [
|
|||
default='test-cluster',
|
||||
help='Name for cluster.'),
|
||||
cfg.StrOpt('USER_KEYPAIR_ID',
|
||||
default='savanna-i-test-key-pair',
|
||||
help='OpenStack key pair ID of your SSH public key. Savanna '
|
||||
default='sahara-i-test-key-pair',
|
||||
help='OpenStack key pair ID of your SSH public key. Sahara '
|
||||
'transfers this key to cluster nodes for access by users '
|
||||
'to virtual machines of cluster via SSH. You can export '
|
||||
'your id_rsa.pub public key to OpenStack and specify its '
|
||||
|
@ -119,18 +119,18 @@ COMMON_CONFIG_OPTS = [
|
|||
'automatically, using nova client.'),
|
||||
cfg.StrOpt('FLOATING_IP_POOL',
|
||||
default=None,
|
||||
help='Pool name for floating IPs. If Savanna uses Nova '
|
||||
help='Pool name for floating IPs. If Sahara uses Nova '
|
||||
'management network and auto assignment of IPs was '
|
||||
'enabled then you should leave default value of this '
|
||||
'parameter. If auto assignment was not enabled, then you '
|
||||
'should specify value (floating IP pool name) of this '
|
||||
'parameter. If Savanna uses Neutron management network, '
|
||||
'parameter. If Sahara uses Neutron management network, '
|
||||
'then you should always specify value (floating IP pool '
|
||||
'name) of this parameter.'),
|
||||
cfg.BoolOpt('NEUTRON_ENABLED',
|
||||
default=False,
|
||||
help='If Savanna uses Nova management network, then you '
|
||||
'should leave default value of this flag. If Savanna '
|
||||
help='If Sahara uses Nova management network, then you '
|
||||
'should leave default value of this flag. If Sahara '
|
||||
'uses Neutron management network, then you should set '
|
||||
'this flag to True and specify values of the following '
|
||||
'parameters: FLOATING_IP_POOL and '
|
||||
|
@ -430,7 +430,7 @@ class ITConfig:
|
|||
register_config(cfg.CONF, IDH_CONFIG_GROUP, IDH_CONFIG_OPTS)
|
||||
|
||||
cfg.CONF(
|
||||
[], project='Savanna_integration_tests',
|
||||
[], project='Sahara_integration_tests',
|
||||
default_config_files=config_files
|
||||
)
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ OS_USERNAME = 'admin'
|
|||
OS_PASSWORD = 'admin'
|
||||
OS_TENANT_NAME = 'admin'
|
||||
OS_AUTH_URL = 'http://127.0.0.1:5000/v2.0'
|
||||
SAVANNA_HOST = '127.0.0.1'
|
||||
SAHARA_HOST = '127.0.0.1'
|
||||
FLAVOR_ID = 2
|
||||
USER_KEYPAIR_ID = 'savanna-key-pair'
|
||||
USER_KEYPAIR_ID = 'sahara-key-pair'
|
||||
PATH_TO_SSH_KEY = '/home/ubuntu/.ssh/id_rsa'
|
||||
FLOATING_IP_POOL = 'net04_ext'
|
||||
NEUTRON_ENABLED = True
|
||||
|
@ -14,7 +14,7 @@ INTERNAL_NEUTRON_NETWORK = 'net04'
|
|||
|
||||
[VANILLA]
|
||||
|
||||
IMAGE_NAME = 'savanna-vanilla-image'
|
||||
IMAGE_NAME = 'sahara-vanilla-image'
|
||||
SKIP_CLUSTER_CONFIG_TEST = True
|
||||
|
||||
[HDP]
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
#SWIFT_AUTH_VERSION = 2
|
||||
|
||||
|
||||
# Host for Savanna API (string value)
|
||||
#SAVANNA_HOST = '127.0.0.1'
|
||||
# Host for Sahara API (string value)
|
||||
#SAHARA_HOST = '127.0.0.1'
|
||||
|
||||
# Port for Savanna API (integer value)
|
||||
#SAVANNA_PORT = '8386'
|
||||
# Port for Sahara API (integer value)
|
||||
#SAHARA_PORT = '8386'
|
||||
|
||||
# Api version for Savanna (string value)
|
||||
#SAVANNA_API_VERSION = '1.1'
|
||||
# Api version for Sahara (string value)
|
||||
#SAHARA_API_VERSION = '1.1'
|
||||
|
||||
|
||||
# OpenStack flavor ID for virtual machines. If you leave default value of this
|
||||
|
@ -58,7 +58,7 @@
|
|||
#CLUSTER_NAME = 'test-cluster'
|
||||
|
||||
|
||||
# OpenStack key pair ID of your SSH public key. Savanna transfers this key to
|
||||
# OpenStack key pair ID of your SSH public key. Sahara transfers this key to
|
||||
# cluster nodes for access of users to virtual machines of cluster via SSH.
|
||||
# You can export your id_rsa.pub public key to OpenStack and specify its key
|
||||
# pair ID in configuration file of tests. If you already have key pair in
|
||||
|
@ -70,7 +70,7 @@
|
|||
# automatically. Also to key pair ID will be added little ID (8 characters
|
||||
# (letters and/or digits)) for its uniqueness. In the end of tests key pair
|
||||
# will be deleted (string value)
|
||||
#USER_KEYPAIR_ID = 'savanna-i-test-key-pair'
|
||||
#USER_KEYPAIR_ID = 'sahara-i-test-key-pair'
|
||||
|
||||
# Path to id_rsa key which is used with tests for remote command execution.
|
||||
# If you specify wrong path to key then you will have the error "Private key
|
||||
|
@ -80,17 +80,17 @@
|
|||
#PATH_TO_SSH_KEY = <None>
|
||||
|
||||
|
||||
# Pool name for floating IPs. If Savanna uses Nova management network and auto
|
||||
# Pool name for floating IPs. If Sahara uses Nova management network and auto
|
||||
# assignment of IPs was enabled then you should leave default value of this
|
||||
# parameter. If auto assignment was not enabled then you should specify value
|
||||
# (floating IP pool name) of this parameter. If Savanna uses Neutron management
|
||||
# (floating IP pool name) of this parameter. If Sahara uses Neutron management
|
||||
# network then you should always specify value (floating IP pool name) of this
|
||||
# parameter (string value)
|
||||
#FLOATING_IP_POOL = <None>
|
||||
|
||||
|
||||
# If Savanna uses Nova management network then you should leave default value
|
||||
# of this flag. If Savanna uses Neutron management network then you should set
|
||||
# If Sahara uses Nova management network then you should leave default value
|
||||
# of this flag. If Sahara uses Neutron management network then you should set
|
||||
# this flag to True and specify values of the following parameters:
|
||||
# FLOATING_IP_POOL and INTERNAL_NEUTRON_NETWORK (boolean value)
|
||||
#NEUTRON_ENABLED = False
|
||||
|
@ -102,7 +102,7 @@
|
|||
# This is a debugging aid for instances when errors are logged
|
||||
# on the cluster nodes but the cause of the failure is not
|
||||
# evident from the integration test logs, ie an Oozie exception.
|
||||
# It is intended for use on local hosts, not savanna-ci.
|
||||
# It is intended for use on local hosts, not the official ci host.
|
||||
#RETAIN_CLUSTER_AFTER_TEST = False
|
||||
|
||||
[VANILLA]
|
||||
|
|
|
@ -60,19 +60,19 @@ class ITestCase(unittest2.TestCase):
|
|||
self.idh_config = cfg.ITConfig().idh_config
|
||||
|
||||
telnetlib.Telnet(
|
||||
self.common_config.SAVANNA_HOST, self.common_config.SAVANNA_PORT
|
||||
self.common_config.SAHARA_HOST, self.common_config.SAHARA_PORT
|
||||
)
|
||||
|
||||
self.sahara = savanna_client.Client(
|
||||
self.common_config.SAVANNA_API_VERSION,
|
||||
self.common_config.SAHARA_API_VERSION,
|
||||
username=self.common_config.OS_USERNAME,
|
||||
api_key=self.common_config.OS_PASSWORD,
|
||||
project_name=self.common_config.OS_TENANT_NAME,
|
||||
auth_url=self.common_config.OS_AUTH_URL,
|
||||
savanna_url='http://%s:%s/v%s/%s' % (
|
||||
self.common_config.SAVANNA_HOST,
|
||||
self.common_config.SAVANNA_PORT,
|
||||
self.common_config.SAVANNA_API_VERSION,
|
||||
self.common_config.SAHARA_HOST,
|
||||
self.common_config.SAHARA_PORT,
|
||||
self.common_config.SAHARA_API_VERSION,
|
||||
self.common_config.OS_TENANT_ID
|
||||
))
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ from sahara.openstack.common import processutils
|
|||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
synchronized = lockutils.synchronized_with_prefix('savanna-')
|
||||
synchronized = lockutils.synchronized_with_prefix('sahara-')
|
||||
|
||||
|
||||
def _get_connect_string(backend, user, passwd, database):
|
||||
|
@ -78,14 +78,14 @@ def _is_backend_avail(backend, user, passwd, database):
|
|||
|
||||
|
||||
def _have_mysql(user, passwd, database):
|
||||
present = os.environ.get('SAVANNA_MYSQL_PRESENT')
|
||||
present = os.environ.get('SAHARA_MYSQL_PRESENT')
|
||||
if present is None:
|
||||
return _is_backend_avail('mysql', user, passwd, database)
|
||||
return present.lower() in ('', 'true')
|
||||
|
||||
|
||||
def _have_postgresql(user, passwd, database):
|
||||
present = os.environ.get('SAVANNA_TEST_POSTGRESQL_PRESENT')
|
||||
present = os.environ.get('SAHARA_TEST_POSTGRESQL_PRESENT')
|
||||
if present is None:
|
||||
return _is_backend_avail('postgres', user, passwd, database)
|
||||
return present.lower() in ('', 'true')
|
||||
|
@ -193,7 +193,7 @@ class BaseMigrationTestCase(unittest2.TestCase):
|
|||
'alembic.ini')
|
||||
)
|
||||
|
||||
self.ALEMBIC_CONFIG.savanna_config = CONF
|
||||
self.ALEMBIC_CONFIG.sahara_config = CONF
|
||||
|
||||
self.snake_walk = False
|
||||
self.downgrade = False
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Hadoop Cluster by Savanna",
|
||||
"Description" : "Hadoop Cluster by Sahara",
|
||||
|
||||
"Resources" : {
|
||||
"cluster-worker-001-port" : {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Hadoop Cluster by Savanna",
|
||||
"Description" : "Hadoop Cluster by Sahara",
|
||||
|
||||
"Resources" : {
|
||||
"cluster-worker-001-port" : {
|
||||
|
|
|
@ -160,7 +160,7 @@ class TestClusterCreateValidation(u.ValidationTestCase):
|
|||
'hadoop_version': "1.2.1",
|
||||
},
|
||||
bad_req_i=(1, 'INVALID_REFERENCE',
|
||||
"Savanna doesn't contain plugin "
|
||||
"Sahara doesn't contain plugin "
|
||||
"with name 'wrong_plugin'")
|
||||
)
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ class TestClusterTemplateCreateValidation(u.ValidationTestCase):
|
|||
'hadoop_version': "1.2.1",
|
||||
},
|
||||
bad_req_i=(1, 'INVALID_REFERENCE',
|
||||
"Savanna doesn't contain plugin "
|
||||
"Sahara doesn't contain plugin "
|
||||
"with name 'wrong_plugin'")
|
||||
)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class CryptoTest(unittest2.TestCase):
|
|||
self.assertIn('-----BEGIN RSA PRIVATE KEY-----', kp[0])
|
||||
self.assertIn('-----END RSA PRIVATE KEY-----', kp[0])
|
||||
self.assertIn('ssh-rsa ', kp[1])
|
||||
self.assertIn('Generated by Savanna', kp[1])
|
||||
self.assertIn('Generated by Sahara', kp[1])
|
||||
|
||||
def test_to_paramiko_private_key(self):
|
||||
pk_str = c.generate_key_pair()[0]
|
||||
|
|
|
@ -40,7 +40,7 @@ def generate_key_pair(key_length=2048):
|
|||
'-N', '', # w/o passphrase
|
||||
'-t', 'rsa', # create key of rsa type
|
||||
'-f', keyfile, # filename of the key file
|
||||
'-C', 'Generated by Savanna' # key comment
|
||||
'-C', 'Generated by Sahara' # key comment
|
||||
]
|
||||
if key_length is not None:
|
||||
args.extend(['-b', key_length])
|
||||
|
|
Loading…
Reference in New Issue