Commit Graph

4 Commits

Author SHA1 Message Date
Chris Dent 787bb33606 Use external placement in functional tests
Adjust the fixtures used by the functional tests so they
use placement database and web fixtures defined by placement
code. To avoid making redundant changes, the solely placement-
related unit and functional tests are removed, but the placement
code itself is not (yet).

openstack-placement is required by the functional tests. It is not
added to test-requirements as we do not want unit tests to depend
on placement in any way, and we enforce this by not having placement
in the test env.

The concept of tox-siblings is used to ensure that the
placement requirement will be satisfied correctly if there is a
depends-on. To make this happen, the functional jobs defined in
.zuul.yaml are updated to require openstack/placement.

tox.ini has to be updated to use a envdir that is the same
name as job. Otherwise the tox siblings role in ansible cannot work.

The handling of the placement fixtures is moved out of nova/test.py
into the functional tests that actually use it because we do not
want unit tests (which get the base test class out of test.py) to
have anything to do with placement. This requires adjusting some
test files to use absolute import.

Similarly, a test of the comparison function for the api samples tests
is moved into functional, because it depends on placement functionality,

TestUpgradeCheckResourceProviders in unit.cmd.test_status is moved into
a new test file: nova/tests/functional/test_nova_status.py. This is done
because it requires the PlacementFixture, which is only available to
functional tests. A MonkeyPatch is required in the test to make sure that
the right context managers are used at the right time in the command
itself (otherwise some tables do no exist). In the test itself, to avoid
speaking directly to the placement database, which would require
manipulating the RequestContext objects, resource providers are now
created over the API.

Co-Authored-By: Balazs Gibizer <balazs.gibizer@ericsson.com>
Change-Id: Idaed39629095f86d24a54334c699a26c218c6593
2018-12-12 18:46:49 +00:00
Chris Dent 26db00344f Remove invalid URL in gabbi tests
The use of a literal snowman in a URL is an invalid URL. In Python 3
the url parsing code used by gabbi will not accept this URL and
correctly rejects it. Python 2 is less strict and passes it on
(presumably encoding it somewhere in the stack).

Python 3's behavior is correct and the fact that the test ever
worked was an artifact of Python 2's bad behavior. The test
immediately following the removed test is testing the correct and
legitimate HTTP behavior, so it is best to just remove the bad one.

By doing so all functional tests pass under python3 so the
test-functional-py3.txt has been made empty, with a comment. This
was done, instead of removing it, to signal the state of affairs.

Change-Id: If40f5093c65491dcfc225dffd95c6dc1318a0f99
2017-01-17 21:10:45 +00:00
Michal b07efcc214 Removal of tests with different result depending on testing env
Remove gabbi tests which are reporting success or failure depending
on the environment they are ran in as this was misleading.

Change-Id: Ifb06b353e4264f4276ebb294a089c4fede74067f
2016-10-13 19:27:08 +02:00
Chris Dent 2e45b95a8f [placement] Add some tests ensuring unicode resource provider info
Add some gabbi tests which demonstrate that it is possible to create
and query a resource provider that has a name that is outside the
bounds of ascii. The tests using a 4byte wide utf-8 character are left
as xfails because not all installations of mysql will support it.

Also confirm that if a unicode characters (uri-encoded or not) in
the uuid part of a resource providers path will result in the
expected 404 and not explode.

Closes-Bug: #1621605
Change-Id: I3d906c3296aa28b595fcc23c448c1744972c319d
2016-09-08 19:38:51 +00:00