Code Review
/
apex.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add gluon scenario config file
[apex.git]
/
tests
/
test_apex_python_utils_py.py
diff --git
a/tests/test_apex_python_utils_py.py
b/tests/test_apex_python_utils_py.py
index
47c1009
..
eb16f67
100644
(file)
--- a/
tests/test_apex_python_utils_py.py
+++ b/
tests/test_apex_python_utils_py.py
@@
-7,7
+7,9
@@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import shutil
import sys
import sys
+import tempfile
from test_apex_ip_utils import get_default_gateway_linux
from apex_python_utils import main
from test_apex_ip_utils import get_default_gateway_linux
from apex_python_utils import main
@@
-16,6
+18,7
@@
from apex_python_utils import parse_net_settings
from apex_python_utils import parse_deploy_settings
from apex_python_utils import find_ip
from apex_python_utils import build_nic_template
from apex_python_utils import parse_deploy_settings
from apex_python_utils import find_ip
from apex_python_utils import build_nic_template
+from apex_python_utils import parse_inventory
from nose.tools import assert_equal
from nose.tools import assert_raises
from nose.tools import assert_equal
from nose.tools import assert_raises
@@
-25,6
+28,7
@@
net_sets = '../config/network/network_settings.yaml'
net_env = '../build/network-environment.yaml'
deploy_sets = '../config/deploy/deploy_settings.yaml'
nic_template = '../build/nics-template.yaml.jinja2'
net_env = '../build/network-environment.yaml'
deploy_sets = '../config/deploy/deploy_settings.yaml'
nic_template = '../build/nics-template.yaml.jinja2'
+inventory = '../config/inventory/pod_example_settings.yaml'
class TestCommonUtils(object):
class TestCommonUtils(object):
@@
-55,11
+59,13
@@
class TestCommonUtils(object):
assert_equal(main(), None)
def test_parse_net_settings(self):
assert_equal(main(), None)
def test_parse_net_settings(self):
+ tmp_dir = tempfile.mkdtemp()
args = self.parser.parse_args(['parse-net-settings',
'-s', net_sets,
args = self.parser.parse_args(['parse-net-settings',
'-s', net_sets,
- '-
i', 'True'
,
+ '-
td', tmp_dir
,
'-e', net_env])
assert_equal(parse_net_settings(args), None)
'-e', net_env])
assert_equal(parse_net_settings(args), None)
+ shutil.rmtree(tmp_dir, ignore_errors=True)
def test_parse_deploy_settings(self):
args = self.parser.parse_args(['parse-deploy-settings',
def test_parse_deploy_settings(self):
args = self.parser.parse_args(['parse-deploy-settings',
@@
-75,6
+81,10
@@
class TestCommonUtils(object):
args = self.parser.parse_args(['nic-template',
'-s', net_sets,
'-r', 'compute',
args = self.parser.parse_args(['nic-template',
'-s', net_sets,
'-r', 'compute',
- '-t', nic_template,
- '-n', 'admin_network'])
+ '-t', nic_template])
assert_equal(build_nic_template(args), None)
assert_equal(build_nic_template(args), None)
+
+ def test_parse_inventory(self):
+ args = self.parser.parse_args(['parse-inventory',
+ '-f', inventory])
+ assert_equal(parse_inventory(args), None)