Fix py27 tests in controllerconfig component

Fixes include:
- Use a new dummy value for the SW_VERSION to allow unit tests
  to remain unchanged when the release version changes.
- Fix problem with import of fm_core module in unit tests.
- Fix bug in config file parsing introduced by FM decoupling.

Story: 2003360
Task: 26215
Depends-On: Ic5411ac4e9c7be9de329fa99dd438aeba1914fbd

Change-Id: I36bc428ebf0a39a353b137d21353e8ac42c53369
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
This commit is contained in:
Bart Wensley 2018-09-06 12:23:19 -05:00
parent 0426081c88
commit 91784140da
20 changed files with 31 additions and 33 deletions

View File

@ -2,4 +2,5 @@
.coverage
.testrepository
cover
.cache

View File

@ -2836,7 +2836,7 @@ class ConfigAssistant():
self.nfv_ks_password)
self.fm_ks_user_name = config.get(
'cREGION', 'FM_USER_NAME')
self.panko_ks_password = config.get(
self.fm_ks_password = config.get(
'cREGION', 'FM_PASSWORD')
self.add_password_for_validation('FM_PASSWORD',
self.fm_ks_password)

View File

@ -127,4 +127,4 @@ FM_USER_NAME=fmTWO
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -121,4 +121,4 @@ FM_USER_NAME=fmTWO
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -129,10 +129,10 @@ PANKO_USER_NAME=panko
PANKO_PASSWORD=password2WO*
GNOCCHI_USER_NAME=gnocchi
GNOCCHI_PASSWORD=password2WO*
FM_USER_NAME=fm
FM_PASSWORD=password2WO*
MTCE_USER_NAME=mtce
MTCE_PASSWORD=password2WO*
FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[cAUTHENTICATION]
ADMIN_PASSWORD=Li69nux*

View File

@ -65,18 +65,6 @@ EXTERNAL_OAM_1_ADDRESS=10.10.10.4
[cNETWORK]
# Data Network Configuration
VSWITCH_TYPE=nuage_vrs
NEUTRON_L2_PLUGIN=NC
NEUTRON_L2_AGENT=nuage_vrs
NEUTRON_L3_EXT_BRIDGE=provider
NEUTRON_ML2_MECHANISM_DRIVERS=NC
NEUTRON_ML2_TYPE_DRIVERS=NC
NEUTRON_ML2_TENANT_NETWORK_TYPES=vlan,vxlan
NEUTRON_ML2_SRIOV_AGENT_REQUIRED=NC
NEUTRON_HOST_DRIVER=NC
NEUTRON_FM_DRIVER=NC
NEUTRON_NETWORK_SCHEDULER=NC
NEUTRON_ROUTER_SCHEDULER=NC
METADATA_PROXY_SHARED_SECRET=NuageNetworksSharedSecret
[cSECURITY]
[cREGION]
@ -141,10 +129,10 @@ PANKO_USER_NAME=panko
PANKO_PASSWORD=password2WO*
GNOCCHI_USER_NAME=gnocchi
GNOCCHI_PASSWORD=password2WO*
FM_USER_NAME=fm
FM_PASSWORD=password2WO*
MTCE_USER_NAME=mtce
MTCE_PASSWORD=password2WO*
FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[cAUTHENTICATION]
ADMIN_PASSWORD=Li69nux*

View File

@ -117,4 +117,4 @@ FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -127,4 +127,4 @@ FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -123,4 +123,4 @@ FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -123,4 +123,4 @@ FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -124,4 +124,4 @@ FM_USER_NAME=fm
FM_PASSWORD=password2WO*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -64,4 +64,4 @@ LOGICAL_INTERFACE=LOGICAL_INTERFACE_2
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -61,4 +61,4 @@ PXEBOOT_CIDR=192.168.203.0/24
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -54,4 +54,4 @@ PXEBOOT_CIDR=192.168.203.0/24
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -58,4 +58,4 @@ SUBNET=192.168.203.0/24
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -71,4 +71,4 @@ LOGICAL_INTERFACE=LOGICAL_INTERFACE_2
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -42,7 +42,7 @@ LOGICAL_INTERFACE=LOGICAL_INTERFACE_2
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION
[SYSTEM]
SYSTEM_TYPE=All-in-one

View File

@ -60,4 +60,4 @@ LOGICAL_INTERFACE=LOGICAL_INTERFACE_2
ADMIN_PASSWORD=Li69nux*
[VERSION]
RELEASE = 18.04
RELEASE = TEST.SW.VERSION

View File

@ -9,17 +9,21 @@ import ConfigParser
import difflib
import filecmp
import fileinput
import mock
from mock import patch
import os
import pytest
import shutil
import sys
import controllerconfig.systemconfig as cr
import configutilities.common.exceptions as exceptions
from configutilities import validate, REGION_CONFIG
import controllerconfig.common.keystone as keystone
import test_answerfile
sys.modules['fm_core'] = mock.Mock()
import controllerconfig.systemconfig as cr # noqa: E402
FAKE_SERVICE_DATA = {u'services': [
{u'type': u'keystore', u'description': u'Barbican Key Management Service',

View File

@ -6,13 +6,18 @@ SPDX-License-Identifier: Apache-2.0
"""
import ConfigParser
import mock
import os
import pytest
import sys
import controllerconfig.systemconfig as cr
import configutilities.common.exceptions as exceptions
from configutilities import validate, DEFAULT_CONFIG
sys.modules['fm_core'] = mock.Mock()
import controllerconfig.systemconfig as cr # noqa: E402
def _dump_config(config):
""" Prints contents of config object """