# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-import io
# https://docs.python.org/3/library/io.html
+import io
+import tempfile
from apex.deploy_settings import DeploySettings
from apex.deploy_settings import DeploySettingsException
deploy_files = ('deploy_settings.yaml',
'os-nosdn-nofeature-noha.yaml',
- 'os-nosdn-ovs-noha.yaml',
+ 'os-nosdn-ovs_dpdk-noha.yaml',
'os-ocl-nofeature-ha.yaml',
- 'os-odl_l2-sdnvpn-ha.yaml',
- 'os-odl_l3-nofeature-ha.yaml',
+ 'os-odl-bgpvpn-ha.yaml',
+ 'os-odl-bgpvpn-noha.yaml',
+ 'os-odl-nofeature-ha.yaml',
'os-nosdn-nofeature-ha.yaml',
- 'os-nosdn-ovs-ha.yaml',
+ 'os-nosdn-ovs_dpdk-ha.yaml',
'os-nosdn-performance-ha.yaml',
- 'os-odl_l2-nofeature-ha.yaml',
+ 'os-odl-nofeature-ha.yaml',
'os-odl_l2-sfc-noha.yaml',
'os-onos-nofeature-ha.yaml',
'os-onos-sfc-ha.yaml')
def test__validate_settings(self):
for c in test_deploy_content:
- f = open('/tmp/apex_deploy_test_file', 'w')
- f.write(c)
- f.close()
- assert_raises(DeploySettingsException,
- DeploySettings, '/tmp/apex_deploy_test_file')
+ try:
+ f = tempfile.NamedTemporaryFile(mode='w')
+ f.write(c)
+ f.flush()
+ assert_raises(DeploySettingsException,
+ DeploySettings, f.name)
+ finally:
+ f.close()
def test_dump_bash(self):
# the performance file has the most use of the function