Fix for excluding gbpservice/tests/contrib/nfp_service/ from UTs

Excluding the gbpservice/tests/contrib/nfp_service/ from python27 tests
by moving out the directory permanently to gbpservice/contrib/.
Fixed file path references in few files as part of this.

Enabled whole gbpservice tests instead of just gbpservice/neutron in
.testr.conf. Fixed FW and VPN driver UTs as part of this.

Fixed pep8 warnings in reference controller. As part of this, added
oslo.i18n installation to nfp reference configurator vm, and used
gbpservice._i18n.py for i18n in logs.

Fix to mock rmq connection in the advanced controller unit tests

Change-Id: I4743e44f86e78b7d19ccd824a7c65195f12f856d
Closes-Bug: 1684076
This commit is contained in:
Rajendra Machani
2017-04-19 15:40:52 +05:30
committed by ashutosh mishra
parent ebd8bcce5a
commit 7db0f27231
18 changed files with 73 additions and 31 deletions

View File

@@ -81,12 +81,14 @@ def dib():
# element for creating configurator image
if 'nfp-reference-configurator' in dib['elements']:
image_name = 'nfp_reference_service'
service_dir = "%s/../../../../tests/contrib/nfp_service/" % cur_dir
service_dir = "%s/../../../../contrib/nfp_service/" % cur_dir
service_dir = os.path.realpath(service_dir)
pecan_dir = "%s/../../../../nfp/" % cur_dir
pecan_dir = os.path.realpath(pecan_dir)
gbpservice_i18n_file = "%s/../../../../_i18n.py" % cur_dir
os.environ['PECAN_GIT_PATH'] = pecan_dir
os.environ['SERVICE_GIT_PATH'] = service_dir
os.environ['GBPSERVICE_I18N_FILE'] = gbpservice_i18n_file
if 'devuser' in dib['elements']:
os.environ['DIB_DEV_USER_USERNAME'] = 'ubuntu'
os.environ['DIB_DEV_USER_SHELL'] = '/bin/bash'

View File

@@ -4,6 +4,7 @@ set -eu
# copy the reference_configurator and pecan folders to VM at /root/
cp -rL ${SERVICE_GIT_PATH}/reference_configurator ${TMP_MOUNT_PATH}/root/
cp -rL ${PECAN_GIT_PATH}/pecan ${TMP_MOUNT_PATH}/root/
cp -rL ${GBPSERVICE_I18N_FILE} ${TMP_MOUNT_PATH}/root/
ls -lR ${TMP_MOUNT_PATH}/root/

View File

@@ -6,7 +6,7 @@ set -eu
cd /usr/local/lib/python2.7/dist-packages/
service_path='gbpservice/tests/contrib/nfp_service'
service_path='gbpservice/contrib/nfp_service'
pecan_path='gbpservice/nfp'
mkdir -p $service_path
mkdir -p $pecan_path
@@ -14,6 +14,7 @@ mkdir -p $pecan_path
find gbpservice/ -type d -exec touch {}/__init__.py \;
mv /root/reference_configurator $service_path/
mv /root/pecan $pecan_path/
mv /root/_i18n.py gbpservice/
cd $service_path
PWD=`pwd`

View File

@@ -1,7 +1,7 @@
#!/bin/bash
apt-get install -y --force-yes python-pecan
apt-get install -y --force-yes oslo.serialization oslo.log python-yaml
apt-get install -y --force-yes oslo.serialization oslo.log oslo.i18n python-yaml
ls -lR /home/ubuntu/
cd /usr/local/lib/python2.7/dist-packages/gbpservice/nfp/pecan/api && python setup.py develop