diff options
author | 2017-06-25 21:25:36 -0400 | |
---|---|---|
committer | 2017-08-23 08:59:54 -0400 | |
commit | f4d388ea508ba00771e43a219ac64e0d430b73bd (patch) | |
tree | 4f61a89664474154c3d6f7adecfbb0396617199c /tests/test_apex_python_utils_py.py | |
parent | 807fad268c90649f2901c5f5c4cdeb788a0308e0 (diff) |
Migrates Apex to Python
Removes all bash libraries and converts almost all of the code to a
mixture of Python and Ansible. utils.sh and clean.sh still exist.
clean.sh will be migrated fully to clean.py in another patch.
The Apex Python package is now built into the opnfv-apex-common RPM. To
install locally do 'pip3 install .'. To deploy:
opnfv-deploy -d <file> -n <file> --image-dir /root/apex/.build -v --debug
Non-python files (THT yaml, settings files, ansible playbooks) are all
installed into /usr/share/opnfv-apex/. The RPM will copy settings files
into /etc/opnfv-apex/.
JIRA: APEX-317
Change-Id: I3232f0329bcd13bce5a28da6a8c9c84d0b048024
Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'tests/test_apex_python_utils_py.py')
-rw-r--r-- | tests/test_apex_python_utils_py.py | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/tests/test_apex_python_utils_py.py b/tests/test_apex_python_utils_py.py deleted file mode 100644 index 550042f5..00000000 --- a/tests/test_apex_python_utils_py.py +++ /dev/null @@ -1,91 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Dan Radez (Red Hat) -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import shutil -import sys -import tempfile - -from test_apex_ip_utils import get_default_gateway_linux -from apex_python_utils import main -from apex_python_utils import get_parser -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_inventory - -from nose.tools import assert_equal -from nose.tools import assert_raises - - -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' -inventory = '../config/inventory/pod_example_settings.yaml' - - -class TestCommonUtils(object): - @classmethod - def setup_class(klass): - """This method is run once for each class before any tests are run""" - klass.parser = get_parser() - klass.iface_name = get_default_gateway_linux() - - @classmethod - def teardown_class(klass): - """This method is run once for each class _after_ all tests are run""" - - def setUp(self): - """This method is run once before _each_ test method is executed""" - - def teardown(self): - """This method is run once after _each_ test method is executed""" - - def test_main(self): - sys.argv = ['apex_python_utils', '-l', '/dev/null'] - assert_raises(SystemExit, main) - sys.argv = ['apex_python_utils', '--debug', '-l', '/dev/null'] - assert_raises(SystemExit, main) - sys.argv = ['apex_python_utils', '-l', '/dev/null', - 'parse-deploy-settings', - '-f', deploy_sets] - 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, - '-td', tmp_dir, - '-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', - '-f', deploy_sets]) - assert_equal(parse_deploy_settings(args), None) - - def test_find_ip(self): - args = self.parser.parse_args(['find-ip', - '-i', self.iface_name]) - assert_equal(find_ip(args), None) - - def test_build_nic_template(self): - args = self.parser.parse_args(['nic-template', - '-s', net_sets, - '-r', 'compute', - '-t', nic_template, - '--deploy-settings-file', deploy_sets]) - 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) |