read static file from resources dir

Change-Id: I716aa51a7161af42d9aedddbf2232f4de85a61aa
This commit is contained in:
Eyal 2018-01-24 10:19:05 +02:00
parent f578e5ee4e
commit a3de888adc
3 changed files with 7 additions and 3 deletions

View File

@ -29,11 +29,11 @@ if [ "$DEVSTACK_GATE_USE_PYTHON3" == "True" ]; then
export PYTHON=python3 export PYTHON=python3
fi fi
sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/static_physical/static_physical_configuration.yaml /etc/vitrage/
sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/heat_template.yaml /etc/vitrage/ sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/heat_template.yaml /etc/vitrage/
sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/heat_nested_template.yaml /etc/vitrage/ sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/heat_nested_template.yaml /etc/vitrage/
sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/server.yaml /etc/vitrage/ sudo cp -rf $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/tests/resources/heat/server.yaml /etc/vitrage/
sudo cp $DEVSTACK_PATH/tempest/etc/logging.conf.sample $DEVSTACK_PATH/tempest/etc/logging.conf
sudo cp -rf $DEVSTACK_PATH/tempest/etc/logging.conf.sample $DEVSTACK_PATH/tempest/etc/logging.conf
${PYTHON:-python} $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/add_legacy_dir_templates.py ${PYTHON:-python} $DEVSTACK_PATH/vitrage/vitrage_tempest_tests/add_legacy_dir_templates.py

View File

@ -34,5 +34,6 @@ def main():
full_path = resources_path + f full_path = resources_path + f
TestConfiguration.add_templates(full_path) TestConfiguration.add_templates(full_path)
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main()) sys.exit(main())

View File

@ -18,6 +18,8 @@ import time
from oslo_log import log as logging from oslo_log import log as logging
from vitrage_tempest_tests.tests.base import BaseVitrageTempest from vitrage_tempest_tests.tests.base import BaseVitrageTempest
from vitrage_tempest_tests.tests.common.general_utils \
import tempest_resources_dir
from vitrage_tempest_tests.tests import utils from vitrage_tempest_tests.tests import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -71,7 +73,8 @@ class TestStaticPhysical(BaseVitrageTempest):
hostname = socket.gethostname() hostname = socket.gethostname()
# template file # template file
file_path = '/etc/vitrage/static_physical_configuration.yaml' resources_path = tempest_resources_dir() + '/static_physical/'
file_path = resources_path + '/static_physical_configuration.yaml'
with open(file_path, 'r') as f: with open(file_path, 'r') as f:
template_data = f.read() template_data = f.read()
template_data = template_data.replace('tmp-devstack', hostname) template_data = template_data.replace('tmp-devstack', hostname)