Browse Source

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
changes/65/503765/4
Brian Haley 4 years ago
parent
commit
d13fdaef43
5 changed files with 10 additions and 8 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -0
      .stestr.conf
  3. +1
    -2
      neutron_dynamic_routing/services/bgp/agent/entry.py
  4. +5
    -5
      neutron_dynamic_routing/tests/contrib/post_test_hook.sh
  5. +0
    -1
      test-requirements.txt

+ 1
- 0
.gitignore View File

@ -28,6 +28,7 @@ subunit.log
!/.gitreview
!/.mailmap
!/.pylintrc
!/.stestr.conf
!/.testr.conf
# Files created by releasenotes build


+ 3
- 0
.stestr.conf View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./neutron_dynamic_routing/tests/unit}
top_dir=./

+ 1
- 2
neutron_dynamic_routing/services/bgp/agent/entry.py View File

@ -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():


+ 5
- 5
neutron_dynamic_routing/tests/contrib/post_test_hook.sh View File

@ -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


+ 0
- 1
test-requirements.txt View File

@ -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


Loading…
Cancel
Save