Added Template&Confs to Tempest Env

When tempests runs on zuul it'll copy templates and static
physical configuration files from the vitrage_tempest dir to /etc/vitrage/

Change-Id: If961d099ce04c200cf9d03486fc891088b6dffd2
This commit is contained in:
Noam Bloom 2016-06-02 11:16:57 +03:00
parent b9d9d1fdd5
commit d40b93e9ab
3 changed files with 10 additions and 4 deletions

View File

@ -29,7 +29,10 @@ fi
(cd $DEVSTACK_PATH/tempest/; sudo pip install -r requirements.txt -r test-requirements.txt)
(cd $DEVSTACK_PATH/tempest/; sudo oslo-config-generator --config-file etc/config-generator.tempest.conf --output-file etc/tempest.conf)
(cd $DEVSTACK_PATH/; sudo sh -c 'cat vitrage/devstack/files/tempest/tempest.conf >> tempest/etc/tempest.conf')
(cd $DEVSTACK_PATH/; sudo sh -c 'cp -rf vitrage/devstack/files/tempest/tempest.conf /etc/tempest.conf')
(cd $DEVSTACK_PATH/; sudo sh -c 'cp -rf vitrage/vitrage_tempest_tests/tests/resources/static_physical/* /etc/vitrage/static_datasources/')
(cd $DEVSTACK_PATH/; sudo sh -c 'cp -rf vitrage/vitrage_tempest_tests/tests/resources/templates/api/* /etc/vitrage/templates/')
sudo cp $DEVSTACK_PATH/tempest/etc/logging.conf.sample $DEVSTACK_PATH/tempest/etc/logging.conf

View File

@ -50,14 +50,16 @@ class TestStaticPhysical(BaseApiTest):
# template file
file_path = '/opt/stack/vitrage/vitrage_tempest_tests/tests/' \
'resources/static_physical/tempest_configuration.yaml'
'resources/static_physical/' \
'static_physical_configuration.yaml'
with open(file_path, 'rb') as f:
template_data = f.read()
template_data = template_data.replace('tmp-devstack', hostname)
# new file
new_file = open(
'/etc/vitrage/static_datasources/tempest_configuration.yaml', 'wb')
'/etc/vitrage/static_datasources/'
'static_physical_configuration.yaml', 'wb')
new_file.write(template_data)
new_file.close()
@ -65,7 +67,8 @@ class TestStaticPhysical(BaseApiTest):
@staticmethod
def _delete_switches():
path = '/etc/vitrage/static_datasources/tempest_configuration.yaml'
path = '/etc/vitrage/static_datasources/' \
'static_physical_configuration.yaml'
if os.path.exists(path):
os.remove(path)