Browse Source

Fix stable/pike gate

This patch is fixing the by:

1. Update code to reflect stricter PEP8 handling

2. Adding a /bin/bash in front of the ovn-ctl commands.

3. Use a native zuul v3 job for rally

4. Fix post gate hook to accommodate for new os-testr

The reason for 2. still unknown to me, perhaps something has changed in
Ubuntu Xenial (it doens't fail on CentOS for example) which was causing
the error below:

$ /usr/local/share/openvswitch/scripts/ovn-ctl --no-monitor start_northd
/usr/local/share/openvswitch/scripts/ovn-ctl: 1: local: -vfile:info: bad
variable name

Backport note:
The original patch in master branch included some hack for OVS. At the
moment of the cherry-pick, OVS was fixed so I removed it in
devstack/lib/networking-ovn.

Conflicts:
	devstack/lib/networking-ovn
	networking_ovn/db/migration/alembic_migrations/versions/queens/expand/5c198d2723b6_add_ovn_revision_resource_type_as_pk.py
	networking_ovn/db/migration/alembic_migrations/versions/queens/expand/f48286668608_add_ovn_revision_numbers_table.py
	networking_ovn/journal/exceptions.py
	networking_ovn/ovsdb/impl_idl_ovn.py

Change-Id: I9dca4ba494082a0bf37833b13b05609c715a492d
(cherry picked from commit 1af6ea97bb)
(cherry picked from commit c7c16d41f8)
changes/53/595853/3
Lucas Alvares Gomes 3 years ago
parent
commit
386543b978
  1. 1
      .gitignore
  2. 3
      .stestr.conf
  3. 4
      networking_ovn/agent/metadata/server.py
  4. 8
      networking_ovn/db/migration/alembic_migrations/script.py.mako
  5. 9
      networking_ovn/db/migration/alembic_migrations/versions/pike/expand/e229b8aad9f2_add_journal_and_maintenance_tables.py
  6. 4
      networking_ovn/ovsdb/impl_idl_ovn.py
  7. 10
      networking_ovn/tests/contrib/post_test_hook.sh
  8. 4
      networking_ovn/tests/unit/ml2/test_mech_driver.py
  9. 9
      networking_ovn/tests/unit/ovsdb/test_impl_idl_ovn.py
  10. 106
      playbooks/legacy/rally-dsvm-networking-ovn/post.yaml
  11. 65
      playbooks/legacy/rally-dsvm-networking-ovn/run.yaml
  12. 5
      releasenotes/source/conf.py
  13. 1
      test-requirements.txt
  14. 6
      tools/tox_install.sh
  15. 11
      zuul.d/legacy-networking-ovn-jobs.yaml
  16. 28
      zuul.d/networkin-ovn-rally-task.yaml
  17. 4
      zuul.d/project.yaml

1
.gitignore

@ -49,6 +49,7 @@ ChangeLog
!/.gitignore
!/.gitreview
!/.mailmap
!/.stestr.conf
!/.pylintrc
!/.testr.conf
!/devstack/lib

3
.stestr.conf

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

4
networking_ovn/agent/metadata/server.py

@ -163,8 +163,8 @@ class UnixDomainMetadataProxy(object):
mode = self.conf.metadata_proxy_socket_mode
if mode == config.DEDUCE_MODE:
user = self.conf.metadata_proxy_user
if (not user or user == '0' or user == 'root'
or agent_utils.is_effective_user(user)):
if (not user or user == '0' or user == 'root' or
agent_utils.is_effective_user(user)):
# user is agent effective user or root => USER_MODE
mode = config.USER_MODE
else:

8
networking_ovn/db/migration/alembic_migrations/script.py.mako

@ -21,6 +21,10 @@ Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
@ -28,9 +32,5 @@ down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
%endif
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
def upgrade():
${upgrades if upgrades else "pass"}

9
networking_ovn/db/migration/alembic_migrations/versions/pike/expand/e229b8aad9f2_add_journal_and_maintenance_tables.py

@ -21,10 +21,6 @@ Create Date: 2017-04-28 11:41:47.487584
"""
# revision identifiers, used by Alembic.
revision = 'e229b8aad9f2'
down_revision = 'ac094507b7f4'
from alembic import op
from oslo_utils import uuidutils
import sqlalchemy as sa
@ -32,6 +28,11 @@ import sqlalchemy as sa
from networking_ovn.journal import constants as journal_const
# revision identifiers, used by Alembic.
revision = 'e229b8aad9f2'
down_revision = 'ac094507b7f4'
def upgrade():
op.create_table(
'ovn_journal',

4
networking_ovn/ovsdb/impl_idl_ovn.py

@ -415,8 +415,8 @@ class OvsdbNbOvnIdl(Backend, ovn_api.API):
ret_opts = []
for row in self._tables['DHCP_Options'].rows.values():
external_ids = getattr(row, 'external_ids', {})
if (external_ids.get('subnet_id') in subnet_ids
and not external_ids.get('port_id')):
if (external_ids.get('subnet_id') in subnet_ids and not
external_ids.get('port_id')):
ret_opts.append({
'cidr': row.cidr, 'options': dict(row.options),
'external_ids': dict(external_ids),

10
networking_ovn/tests/contrib/post_test_hook.sh

@ -11,11 +11,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_DIR/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_DIR/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi

4
networking_ovn/tests/unit/ml2/test_mech_driver.py

@ -406,8 +406,8 @@ class TestOVNMechanismDriver(test_plugin.Ml2PluginV2TestCase):
self.assertEqual(
tools.UnorderedList(
["22:22:22:22:22:22 2.2.2.2",
port['port']['mac_address'] + ' ' + port_ip
+ ' ' + '1.1.1.1']),
port['port']['mac_address'] + ' ' + port_ip +
' ' + '1.1.1.1']),
called_args_dict.get('port_security'))
old_mac = port['port']['mac_address']

9
networking_ovn/tests/unit/ovsdb/test_impl_idl_ovn.py

@ -648,11 +648,10 @@ class TestNBImplIdlOvn(TestDBImplIdlOvn):
def test_get_subnets_dhcp_options(self):
self._load_nb_db()
get_row_dict = lambda row: {
'cidr': row.cidr,
'external_ids': row.external_ids,
'options': row.options,
'uuid': row.uuid}
def get_row_dict(row):
return {'cidr': row.cidr, 'external_ids': row.external_ids,
'options': row.options, 'uuid': row.uuid}
subnets_options = self.nb_ovn_idl.get_subnets_dhcp_options(
['subnet-id-10-0-1-0', 'subnet-id-10-0-2-0'])

106
playbooks/legacy/rally-dsvm-networking-ovn/post.yaml

@ -1,106 +0,0 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*nose_results.html
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testr_results.html.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.testrepository/tmp*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testrepository.subunit.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}/tox'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.tox/*/log/*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/rally-plot/**
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/rally-plot/extra/index.html
- --include=*/
- --exclude=*
- --prune-empty-dirs

65
playbooks/legacy/rally-dsvm-networking-ovn/run.yaml

@ -1,65 +0,0 @@
- hosts: all
name: Autoconverted job legacy-rally-dsvm-networking-ovn from old job gate-rally-dsvm-networking-ovn
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
git://git.openstack.org \
openstack-infra/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin networking-ovn git://git.openstack.org/openstack/networking-ovn
enable_plugin rally git://git.openstack.org/openstack/rally
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_NEUTRON=1
export RALLY_SCENARIO=ovn
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
export PROJECTS="openstack/networking-ovn $PROJECTS"
export PROJECTS="openstack/rally $PROJECTS"
export DEVSTACK_GATE_SETTINGS=/opt/stack/new/networking-ovn/devstack/devstackgaterc
function post_test_hook {
$BASE/new/rally/tests/ci/rally-gate.sh
}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

5
releasenotes/source/conf.py

@ -37,6 +37,9 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
from networking_ovn.version import version_info as ovn_version
extensions = [
'openstackdocstheme',
'reno.sphinxext',
@ -67,8 +70,6 @@ copyright = u'2015, Networking OVN Developers'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
from networking_ovn.version import version_info as ovn_version
# The full version, including alpha/beta/rc tags.
release = ovn_version.version_string_with_vcs()
# The short X.Y version.

1
test-requirements.txt

@ -13,7 +13,6 @@ doc8 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
os-testr>=0.8.0 # Apache-2.0
pylint==1.4.5 # GPLv2
testrepository>=0.0.18 # Apache-2.0/BSD
testresources>=0.2.4 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
WebTest>=2.0 # MIT

6
tools/tox_install.sh

@ -64,5 +64,9 @@ else
$install_cmd -U -e ${NEUTRON_PIP_LOCATION}
fi
$install_cmd -U $*
# TODO(lucasagomes): Remove the "|| true" after
# https://review.openstack.org/#/c/561593/ is merged. This is just a
# workaround to avoid the pip warning "ERROR: You must give at least one
# requirement to install (see "pip help install")" from breaking the gate
$install_cmd -U $* || true
exit $?

11
zuul.d/legacy-networking-ovn-jobs.yaml

@ -76,17 +76,6 @@
- openstack-infra/devstack-gate
- openstack/networking-ovn
- job:
name: networking-ovn-rally-dsvm
parent: legacy-networking-ovn-dsvm-base
run: playbooks/legacy/rally-dsvm-networking-ovn/run.yaml
post-run: playbooks/legacy/rally-dsvm-networking-ovn/post.yaml
timeout: 7800
required-projects:
- openstack-infra/devstack-gate
- openstack/networking-ovn
- openstack/rally
- job:
name: networking-ovn-tempest-dsvm-multinode
parent: legacy-networking-ovn-dsvm-base-multinode

28
zuul.d/networkin-ovn-rally-task.yaml

@ -0,0 +1,28 @@
- job:
name: networking-ovn-rally-task
parent: rally-task-at-devstack
required-projects:
- name: openstack-dev/devstack
- name: openstack-infra/devstack-gate
- name: openstack/rally
- name: openstack/rally-openstack
- name: openstack/networking-ovn
vars:
devstack_plugins:
rally-openstack: https://git.openstack.org/openstack/rally-openstack
networking-ovn: https://git.openstack.org/openstack/networking-ovn
devstack_services:
ovn-northd: true
ovn-controller: true
networking-ovn-metadata-agent: true
br-ex-tcpdump: true
br-int-flows: true
q-dhcp: false
q-l3: false
devstack_local_confg:
HYSICAL_NETWORK: public
Q_USE_PROVIDERNET_FOR_PUBLIC: true
ENABLE_CHASSIS_AS_GW: true
OVN_L3_CREATE_PUBLIC_NETWORK: true
rally_task: rally-jobs/ovn.yaml
timeout: 7800

4
zuul.d/project.yaml

@ -4,7 +4,7 @@
- networking-ovn-tempest-dsvm-ovs-master:
voting: false
- networking-ovn-tempest-dsvm-ovs-release
- networking-ovn-rally-dsvm
- networking-ovn-rally-task
- networking-ovn-dsvm-functional
- networking-ovn-dsvm-functional-py35:
branches: ^(?!stable/newton).*$
@ -24,7 +24,7 @@
gate:
jobs:
- networking-ovn-tempest-dsvm-ovs-release
- networking-ovn-rally-dsvm
- networking-ovn-rally-task
- networking-ovn-dsvm-functional
- networking-ovn-dsvm-functional-py35:
branches: ^(?!stable/newton).*$

Loading…
Cancel
Save