From d13fdaef4356c75d4cde7dd7934e991400bbd2e6 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Wed, 13 Sep 2017 11:42:22 -0600 Subject: [PATCH] Fix unit tests and test configuration A recent change in the neutron repository changed the import statements for external_process, fixing fallout. Fix post gate hook to accommodate for new os-testr. New versions now use .stestr instead of previous .testrepository directory. Related-bug: #1716746 Change-Id: Iba7579f8de63c6ce87d95167918fc46979702a35 --- .gitignore | 1 + .stestr.conf | 3 +++ neutron_dynamic_routing/services/bgp/agent/entry.py | 3 +-- .../tests/contrib/post_test_hook.sh | 10 +++++----- test-requirements.txt | 1 - 5 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .stestr.conf diff --git a/.gitignore b/.gitignore index 475071ad..a593695f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ subunit.log !/.gitreview !/.mailmap !/.pylintrc +!/.stestr.conf !/.testr.conf # Files created by releasenotes build diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..37583b1c --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./neutron_dynamic_routing/tests/unit} +top_dir=./ diff --git a/neutron_dynamic_routing/services/bgp/agent/entry.py b/neutron_dynamic_routing/services/bgp/agent/entry.py index b4b3bd99..031d91f4 100644 --- a/neutron_dynamic_routing/services/bgp/agent/entry.py +++ b/neutron_dynamic_routing/services/bgp/agent/entry.py @@ -18,7 +18,6 @@ import sys from oslo_config import cfg from oslo_service import service -from neutron.agent.linux import external_process from neutron.common import config as common_config from neutron.conf.agent import common as config from neutron import service as neutron_service @@ -32,7 +31,7 @@ def register_options(): config.register_root_helper(cfg.CONF) cfg.CONF.register_opts(bgp_dragent_config.BGP_DRIVER_OPTS, 'BGP') cfg.CONF.register_opts(bgp_dragent_config.BGP_PROTO_CONFIG_OPTS, 'BGP') - cfg.CONF.register_opts(external_process.OPTS) + config.register_external_process_opts(cfg.CONF) def main(): diff --git a/neutron_dynamic_routing/tests/contrib/post_test_hook.sh b/neutron_dynamic_routing/tests/contrib/post_test_hook.sh index 0507aad0..b51b08e0 100644 --- a/neutron_dynamic_routing/tests/contrib/post_test_hook.sh +++ b/neutron_dynamic_routing/tests/contrib/post_test_hook.sh @@ -13,11 +13,11 @@ VENV=${1:-"dsvm-functional"} function generate_testr_results { # Give job user rights to access tox logs sudo -H -u $OWNER chmod o+rw . - sudo -H -u $OWNER chmod o+rw -R .testrepository - if [ -f ".testrepository/0" ] ; then - .tox/$VENV/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit - $SCRIPTS_PATH/subunit2html ./testrepository.subunit testr_results.html - gzip -9 ./testrepository.subunit + sudo -H -u $OWNER chmod o+rw -R .stestr + if [ -f ".stestr/0" ] ; then + .tox/$VENV/bin/subunit-1to2 < .stestr/0 > ./stestr.subunit + $SCRIPTS_PATH/subunit2html ./stestr.subunit testr_results.html + gzip -9 ./stestr.subunit gzip -9 ./testr_results.html sudo mv ./*.gz /opt/stack/logs/ fi diff --git a/test-requirements.txt b/test-requirements.txt index 8b63b3e8..a8e1b21c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,7 +13,6 @@ sphinx>=1.6.2 # BSD openstackdocstheme>=1.16.0 # Apache-2.0 oslo.concurrency>=3.8.0 # Apache-2.0 os-testr>=0.8.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT testscenarios>=0.4 # Apache-2.0/BSD