277 Commits

Author SHA1 Message Date
Andreas Jaeger
8a28340628 Fix tools/configure_for_func_testing.sh
Remove an erroneous "source", we test for existing of a file, the source
is misplaced.

The source results in errors executing like:
/home/zuul/src/opendev.org/openstack/neutron/tools/configure_for_func_testing.sh: line 81: [: source: binary operator expected

Change-Id: Iea8121eb4b25e66e2527feb5bf3f8f351114c721
2019-08-04 17:46:38 +08:00
Sara Nierodzik
a75385f2c5 Functional testing script password update
This patch includes a fix for "configure_for_func_testing.sh" script.
When the guidelines are followed from the following link:
https://docs.openstack.org/neutron/latest/contributor/testing/testing.
html
the test script displays the following error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'
(using password: YES).
The fix for this is to include the saved password in order to access the
MySQL database.

Change-Id: I6ab5cb3ef1583258cebec9f8f5966eda250a6367
Bug-Link: https://bugs.launchpad.net/neutron/+bug/1836028
2019-07-16 10:26:20 +00:00
elajkat
d9e61138ff change from fixup_uca to fixup_ubuntu
In a recent change [0] in devstack fixup_uca (Universal Cloud Archive)
was changed to fixup_ubuntu. This change follows this in
configure_for_func_testing.sh

[0]: https://review.opendev.org/619562

Change-Id: Ibf6a85d470f179ee996dcc4e6717d433dd860752
Related-Bug: #1792936
2019-07-04 07:10:05 +00:00
ZhongShengping
161e6b80f0 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: Ifc446e00d7f69cb23411b3a50c8d880c719f1e73
2019-04-23 10:00:45 +08:00
Doug Wiegley
55f2336981
Add method to tox to use local neutron-lib with unit tests
Change-Id: Ic96bb04cc3f9ed1438596b2150030ab22887b091
2019-03-02 14:56:15 -07:00
Zuul
362f5e2bb2 Merge "Remove unnecessary 'set -x' at EOL in genconfig script" 2018-12-15 14:09:19 +00:00
Akihiro Motoki
f8984c6699 Convert policy.json into policy-in-code
This commit introduces a framework for policy-in-code support
in the neutron stadium and converts the existing policy.json
in the neutron repository into the policy-in-code style.

NOTES:
1) This commit tries not to change the existing policy behavior
provided by the neutron repository even if there are some stale policies
or policies to be defined in a neutron-related project.
They should be clean up later in Stein release.

2) 'default' policy should be dropped from the default policies
as all default policies should be defined in the code (as many projects
which already completed policy-in-code do). However, dropping 'default'
policy potentially affects policy behavior in neutron-related projects,
so it needs to be visit carefully. Considering this, this commit decides
to keep the 'default' policy.

Partially Implements: blueprint neutron-policy-in-code
Change-Id: I6a61079da4d4f5080ee32d640144e6bdb14735fa
2018-12-13 20:37:53 +00:00
Akihiro Motoki
af55934341 Remove unnecessary 'set -x' at EOL in genconfig script
tools/generate_config_file_samples.sh contains 'set -x'
at the end of line but it is unnecessary.

It was pointed out in the policy-in-code review
and I borrowed a script from this.

Change-Id: I2a0fd6051702693db340904fbe738d44ca4f15c0
2018-12-13 13:28:57 +00:00
Rodolfo Alonso Hernandez
b617df2b21 Change "cmd" folder in fullstack tests
When fullstack tests are executed manually using a debugger
(e.g.: PyCharm integrated debugger), the "cmd" folder is imported
instead of "cmd" [1] module.

To solve this problem, this folder and the references to this path
must be changed.

[1] https://docs.python.org/3/library/cmd.html

Change-Id: I8e6b6995c10875a882a46ca3a0d779aafda124a3
Closes-Bug: #1805844
2018-12-01 22:58:37 +00:00
Slawek Kaplonski
b0ffcf5f31 Update abandon_old_reviews script to check Zuul votes
Before this patch script was looking for patches which have
-1 vote from "jenkins". This was given in the past by zuul v2.
Now we have zuul v3 and there is "verified" vote give by "zuul"
instead so script needs to be updated also.

Change-Id: Ieba7a6d1babee99b14af45836c788741d23bc560
2018-08-30 10:18:48 +02:00
Slawek Kaplonski
2e91736df0 Modify abandon_old_reviews script
This script can now check and abandon old patches only from
specified project.
Project must be one of Neutron deliverables.
Project can be passed to script with parameter:
"--project <project_name>"

If no project is specified it will get old patches from all projects
which are part of neutron stadium.

Change-Id: I83b9a556d551db9f78b3d628df8648309e1dda1d
2018-08-27 10:56:35 +02:00
Zuul
77b0dedce4 Merge "Switch to stestr" 2018-06-07 02:24:02 +00:00
Slawek Kaplonski
ec537c49e9 Switch to stestr
According to Openstack summit session [1] stestr is
maintained project to which all Openstack projects
should migrate.
Let's switch it then.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: If3383707c9baf69e03bcccc50970da748a834141
2018-06-02 13:03:33 +02:00
Slawek Kaplonski
3e9e2a5b4b Disable IPv6 forwarding by default on HA routers
In case of HA routers IPv6 forwarding is not disabled by default and
then enabled only on master node.
Before this patch it was done in opposite way, so forwarding was
enabled by default and then disabled on backup nodes.
When forwarding was enabled/disabled for qg- port, MLDv2 packets are
sent and that might lead to temportary packets loss as packets to
FIP were sent to this backup node instead of master one.

Related-Bug: #1771841

Change-Id: Ia6b772e91c1f94612ca29d7082eca999372e60d6
2018-05-31 20:19:21 +00:00
Zuul
6f93a23296 Merge "Fix ip_conntrack_proto_sctp modprobe error" 2018-05-14 09:22:38 +00:00
Zuul
e228ee7c61 Merge "Change defaults in tools/configure_for_func_testing.sh" 2018-05-14 09:22:36 +00:00
Brian Haley
8034b4946e Fix ip_conntrack_proto_sctp modprobe error
tools/configure_for_func_testing.sh tries to load the
ip_conntrack_proto_sctp module unconditionally, even if
it doesn't exist.  Detect and only load if necessary.

Trivialfix

Change-Id: Idff8c9402d8ffcb21ae4f561642f65aeebbe8067
2018-05-11 16:00:39 +00:00
Brian Haley
ec07a63ec1 Change defaults in tools/configure_for_func_testing.sh
The defaults in tools/configure_for_func_testing.sh don't
match what devstack uses, so running it while a stack is
running breaks all database access.  Change to source
local.conf if it exists, else use the devstack defaults
to be less destructive.

Change-Id: I2d2a7ef034f670f3927ecc7b7706876872a01c77
2018-05-10 18:56:11 -04:00
Zuul
0c150460c4 Merge "Pull in ubuntu cloud archive openvswitch pkg" 2018-03-13 07:50:11 +00:00
Jakub Libosvar
806af8ad7a functional: Fix RABBIT_PASSWORD env var
Caller of configure_func_for_testing.sh script is able to override default
password for rabbit service. This patch replaces RABBIT_HOST as a
password to RABBIT_PASSWORD env var.

TrivialFix

Change-Id: Ie9cafc1fb75209ae1cacc58f254c1da33521d6b5
2018-03-06 16:53:04 +00:00
IWAMOTO Toshihiro
b95434816f Pull in ubuntu cloud archive openvswitch pkg
The environments for functional and fullstack tests are prepared
differently than others and aren't using UCA.  They should use the
ubuntu cloud archive, too.

Depends-On: Ie18833bfa30f1789e63cbe9c86f5ece3453f43fb
Change-Id: I75374fce0e01bac874107abea0b7389382588905
2018-02-19 13:24:42 +09:00
Chandan Kumar
813295f8cf Remove the bundled intree neutron tempest plugin
The plugin has been split into its own repository[1] in accordance with
Queens Goal "Split Tempest Plugins into Separate Repos/Projects[2]".
This patch removes the local copy as well as the setuptools entry point.
We can also now remove the autodoc_tree_excludes pbr option since
there's no more plugin to exclude and it defaults to [setup.py].

The patch leaves still in-tree base classes and constants in order to
avoid breakage of projects depending on such code. In the future, we
will deprecate those and gradually move affected subprojects to the new
repo.

List of affected repositories:
 - neutron-vpnaas
 - openstack-ansible-os_neutron
 - tripleo-quickstart-extras
 - networking-midonet
 - networking-l2gw
 - neutron-dynamic-routing
 - networking-vsphere
 - networking-plumgrid
 - networking-zvm

[1] http://git.openstack.org/cgit/openstack/neutron-tempest-plugin
[2] https://governance.openstack.org/tc/goals/queens/split-tempest-plugins.html

Depends-On: I371aa4d5f043f695df04b98b0f485c8f0548f2b3

Change-Id: Ia21aad29d0bbf779583964db6f1665c9b3b83161
2017-11-22 12:54:33 -08:00
Armando Migliaccio
966f405551 Allow fullstack to operate on dhclient-script for OpenSUSE
This script's permissions by default limits access to root, but
that is not consistent to other platforms. Tweaking the permissions
is the easiest/least impactful fix imaginable.

Change-Id: Icfad974cb0c9f896b05003ea0f89693528eaeb80
2017-09-19 15:50:57 -04:00
Armando Migliaccio
e40ba77269 Tweak configure_for_func_testing to work on OpenSUSE
Ensure OpenSUSE is supported as a platform when installing
packages. Signal also that the configuration is completed
successfully. That's friendly when the script is invoked
manually.

Change-Id: Id9489ecbbacaf7b98a022e7fbdd9cddae3a4c398
2017-09-19 15:03:13 -04:00
XieYingYun
402d2482b3 Fix to use . to source script files
Adhering to coding conventions. Refer to ``Code conventions`` at
https://docs.openstack.org/contributor-guide/ for details.
When you have to source a script file, for example, a credentials file
to gain access to user-only or admin-only CLI commands, use . instead of source.
https://docs.openstack.org/contributor-guide/writing-style/code-conventions.html

Change-Id: I1ff56e0775da68e43a691f7f25b3a4ce7930406a
2017-09-01 02:40:38 -07:00
Ihar Hrachyshka
a77fb4ec26 Prioritize tox environment executables for fullstack/functional tests
Otherwise tests will use executables from global paths (f.e. /usr/bin/)
when those are available, which doesn't play well with a system that has
devstack installed.

Change-Id: I3213d5cb570b09d5049b7087cd710337e2698eb3
2017-08-29 13:29:16 -07:00
Ihar Hrachyshka
a99897ffb3 Use rootwrap for fullstack test runner
We plan to switch to devstack-gate for fullstack job, and it revokes
direct sudo calls before executing tests, so we can't rely on sudo
working anymore.

This also moves functional-testing.filters to a more generic filename
(testing.filters) because the filters are now deployed and used by
fullstack target too.

Related-Bug: #1557168
Related-Bug: #1693689

Change-Id: I1718ea51836adbb8ef8dea79822a722dcf111127
2017-06-08 18:42:47 +00:00
Jenkins
0479f0f9d2 Merge "fullstack: Don't let dhcp agents failover" 2017-04-21 17:56:46 +00:00
Jakub Libosvar
bc979efdb8 fullstack: Don't let dhcp agents failover
It turned out dhcp tests work only because agents are considered dead
after 10 seconds while they report to server every 60 seconds. This led
to calling network resync after agent revival and hiding the fact dhcp
agent is not capable of receiving any amqp messages.

This patch sets the report interval of agents to the half of
agent_down_time on server side and uses eventlet dhcp agent in order to
trigger eventlet monkey patching code.

Eventlet was behind the failure with messages not getting processed. As
[1] notes: "Note: If the “eventlet” executor is used, the threading and
time library need to be monkeypatched."

Because each port calls dhclient to obtain IP address and each dhclient
instance overwrites /etc/resolv.conf there was added a script that
generates fullstack-dhclient-script from an existing dhclient-script
before starting fulltstack tests. This generated script is passed to
each dhclient process running in fake fullstack machine using -sf
parameter.

[1] https://docs.openstack.org/developer/oslo.messaging/server.html

Related-bug: 1453350

Change-Id: I0336176b9c364fe3a95be5cef9e7a3af1ef9d7e9
2017-04-20 14:04:50 +00:00
Jenkins
55be865d9a Merge "Add launchpad bug update support to abandon script" 2017-04-20 09:06:05 +00:00
Jenkins
e0eb0d6bfc Merge "Replaces yaml.load() with yaml.safe_load() in neutron" 2017-04-17 06:56:53 +00:00
Kevin Benton
514580692c Add launchpad bug update support to abandon script
Change-Id: If6db7c8f39665dfdef9b3936fd75e33bd9b76e03
2017-04-16 02:44:03 -07:00
gengchc2
edb6766294 Replaces yaml.load() with yaml.safe_load() in neutron
Yaml.load() return Python object may be dangerous if you receive
a YAML document from an untrusted source such as the Internet.
The function yaml.safe_load() limits this ability to simple Python
objects like integers or lists.

Reference:
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: I026355f3e71b7fd3aeee2fe5c7920a1c6306ab02
2017-03-10 01:09:16 +00:00
Brian Haley
a0552e75e3 Fix bashate warnings
Three ((value++)) lines are generating this bashate warning:
E043: Arithmetic compound has inconsistent return semantics

This will now be an error when running pep8 checks.

Trivialfix

Change-Id: If7a63e550d5d27fe6716cc63c85426cd2250732f
2017-03-07 13:32:04 -05:00
Victor Morales
a14439549f Add bashate support
Bashate is a style checker program for bash scripts.  This addition
improves the quality of the current bash scripts and ensures that
any future change will follow the same standards.

Change-Id: Ia346f77632d4ac7beb288fa3aacea221d7969c87
2017-02-25 06:29:55 +00:00
Jenkins
f760bd792f Merge "configure_for_func_testing.sh: Remove neutron-legacy inclusion" 2017-02-03 21:02:24 +00:00
Jakub Libosvar
d5c07fe512 ovsfw: Support protocol numbers instead of just tcp and udp
Neutron API accepts also protocol numbers as protocols for security
groups. This patch makes support for it in OVS firewall driver. iptables
driver already supports it.

Fullstack test covering SCTP connection was added and it requires
ip_conntrack_proto_sctp kernel module in order to make conntrack work
with SCTP.

Change-Id: I6c5665a994c4a50ddbb95cd1360be0de0a6c7e40
Closes-bug: 1625516
2017-01-20 11:17:40 -05:00
Jenkins
edd0c130d9 Merge "Replace nc command with ncat" 2017-01-07 03:15:48 +00:00
Sławek Kapłoński
a12de8975e Fullstack tests for DHCP agent HA
This patch adds fullstack tests for DHCP agent HA functionallity.

There are two tests added:
* One is checking if network will be properly
  rescheduled to new agent if existing DHCP agent will be down,
* Second is checking if network handled by 2 DHCP agents will have properly
  working DHCP service even if one DHCP agent will be down

Change-Id: Iaad373cafd6f83f2c1f8e7ac58dc70070e7aabaf
2017-01-04 22:48:46 +00:00
Jakub Libosvar
8f37f2d34e Replace nc command with ncat
Ncat has better capabilities like SCTP which nc doesn't have.

Change-Id: I7a3a955465aa05032ead63459191167cfe3f98bd
2017-01-03 16:09:14 +00:00
YAMAMOTO Takashi
74e7145b60 configure_for_func_testing.sh: Remove neutron-legacy inclusion
After devstack change (see Depends-On below),
it isn't necessary anymore.

Depends-On: I3ff136fc8330c92007cdfe91b77d7f9865eabd8d
Change-Id: Iec6f1fb59bf1f656100947f50311afcee4636ca2
2016-12-01 22:40:02 +09:00
YAMAMOTO Takashi
c15c4e4ede configure_for_func_testing.sh: Source lib/neutron as well
Also, set ENABLED_SERIVICES before sourcing devstack files
because they uses it.  This is a preparation for an upcoming
change in devstack. [1]

[1] I3ff136fc8330c92007cdfe91b77d7f9865eabd8d

Change-Id: Ida1f83b6b3ef9b76be13c063c7e35a8703214078
2016-12-01 20:40:19 +09:00
Jenkins
ac834fd040 Merge "Remove duplicated tool" 2016-11-11 22:26:52 +00:00
Henry Gessau
b0e56ac646 Retire deprecations for constants, exceptions, attributes
Subprojects have had enough time to switch to neutron-lib for
the deprecated items from these modules.

Change-Id: Ib2f4acf7e0153667389c57a52f2db33a23758b24
2016-11-09 23:43:38 -05:00
Ihar Hrachyshka
80eb375ba1 Fixed functional iptables firewall tests for newer kernels
Iptables functional tests fail on Xenial and other newer kernels if
br_netfilter kernel module is not loaded, in which case sysctl knobs to
enable bridge firewalling are not available, and attempt to set them
with _enable_netfilter_for_bridges fails.

We should load the kernel module before running those tests. Luckily,
devstack has a function for just that (plus more).

Change-Id: I602d8cd02c73b18e9d719b19998e36059ae28cd8
Depends-On: Id6bfd9595f0772a63d1096ef83ebbb6cd630fafd
Related-Bug: #1622914
2016-09-29 13:39:18 +00:00
Armando Migliaccio
9339117c24 Remove duplicated tool
This is hosted in reviewday

Change-Id: I485440ea448c092f020fc12900d558e9513cee19
Depends-on: I2d9034a31a2492a5723db6d8e10e495b20696db6
2016-09-06 13:13:19 -07:00
Jenkins
5f849165a6 Merge "Make milestone-review-dash script pull all Stadium projects" 2016-09-01 11:37:44 +00:00
Armando Migliaccio
40f5846280 Make milestone-review-dash script pull all Stadium projects
Change-Id: I2ba04d777001ebac12e5cbeaf5d530c932cc99f7
2016-08-31 18:08:49 -07:00
Henry Gessau
99cfd671be debtcollector for globals
The deprecation shim created by Doug turns out to be rather useful.
It emits a warning when an global (attribute of a module) is
referenced but that global has been moved to another module.

This update makes the following changes to the shim:

 - Rename it to _MovedGlobals to better describe what it is a
   debtcollector for.

 - Use inspect to get the original reference and to check that
   _MovedGlobals is called from the last line of a module.

 - Save the old reference automatically in the instance to prevent it
   from getting garbage collected.

 - Beef up the _moved_global() method for moving/renaming individual
   globals, allowing it to move and rename or rename in place.

Change-Id: I868aa4a3129dd05467a103364088efbb86bc5d0f
2016-08-30 10:18:19 -04:00
Henry Gessau
961c5e73e9 Add tool to list moved globals
This tools list the constants and exceptions that have moved
to neutron-lib. Add it to pep8 to raise awareness of moved
globals.

Related Blueprint: neutron-lib

Change-Id: Ic6439f98d4bf8f566debf26eca3337f359119d5a
2016-08-18 10:14:42 -04:00