There is fakes.wsgi_app() for testing legacy v2 API code, but the
method becomes unnecessary. So this patch removes the method and
unit tests which used the method for legacy v2 API.
NOTE: This patch just removes the test of createserverext extension
which is not documented and not tested with Tempest.
The extension is not implemented and seems unnecessary legacy.
Let's remove the test.
Partially implements blueprint remove-legacy-v2-api-code
Change-Id: I0eaa0a9860af7d574a689722785d5d3d614eb0c1
The test_copy_resources_adds_allocation_ratios() unit test in
test_tracker.py was duplicating assertions of the test directly above it
called test_compute_node_created_on_empty(). So, we delete the duplicate
unit test and in the process clean up the
test_compute_node_created_on_empty() test case to remove some lines that
were improperly overriding the RT's allocation ratio attributes instead
of relying on the CONF values to set them.
Change-Id: Ie7012e222d05a1872246961bea94df4640ffa368
The resource tracker never calls ComputeNode.destroy() and therefore
never calls nova.db.compute_node_delete(). However, the base test case
class in test_resource_tracker.py was stubbing this out for some reason.
Change-Id: I14083850974202ead38dea996c42456155814219
The Service object is no longer coupled with the ComputeNode object and
is not used in the resource tracker at all. test_resource_tracker.py was
still creating a service entry in its setUp() and mocking out
service-related stuff, so we remove that.
Change-Id: I83bf0253c92f318cbc782aee4e6f411925b6a7af
The base test case class in test_resource_tracker.py was starting a
conductor service... for no reason at all. The resource tracker no
longer directly calls any conductor calls at all. Everything is done via
the objects interfaces now or via the scheduler client. So, we remove
the call to start a conductor service and the stubout of a flavor_get
call that was not in use any more.
Change-Id: I356604a9240ed53a6f0463fc1d99989ed263b826
The StatsDictTestCase in test_resource_tracker.py was supposed to be
verifying that the "stats" dict field on the ComputeNode object was
being populated with some keys like num_instances,
num_proj_{project_uuid), etc. Unfortunately, all this test was really
asserting was that the behaviour of the ComputeNode object when
saving/setting the stats dict converted the values from integers to
strings.
The *actual* setting of real values of stats information is already
being fully tested with unit tests that are readable and cover all
variations of the stats keys in test_tracker.TestInstanceClaim's
methods, so we remove the StatsDictTestCase from
test_resource_tracker.py.
Change-Id: Ief658c0da2503b8e9905f5da2dd4c667a3fce550
The test_tracker.py file over time had had the host and
hypervisor_hostname (nodename) values hard-coded as strings throughout
the file. This commit simply replaces those strings with references to
module-level constants in order to simplify and make the test cases more
consistent. Some of the test cases were using the string 'fake-host' to
refer to the host and 'fakehost' to refer to the nodename. Other tests
were using the string 'fake-node' to refer to the nodename. This fixes
those all up to be consistent and refer to two constants.
Change-Id: I4158f5661cf083e224171ff47103f77a79a94125
There was a test class in test_resource_tracker.py that was testing
whether if a virt driver returned a non-dict value of the 'stats' key of
the returned dict from the virt driver get_available_resource() call
that calling update_available_resource() would raise a ValueError. Well,
duh, of course it would. But why do we need to *assert* that this
behaviour occurs? It's just bloated unit tests for no reason.
Change-Id: Ie18dd38d0398af96ff805dcd3fcd18f8bc3c65f8
The PciStatsTestCase in test_resource_tracker.py was not testing
anything that test_tracker.InstanceClaimTestCase.test_claim_with_pci()
was not already testing, so we remove it.
Change-Id: I627090ecb349e8b09a47782e8f6f74c85d461214
TrackerTestCase in test_resource_tracker.py had three unit tests that
stressed code paths and had assertions that were identical to the code
paths and assertions in test_tracker.TestInitComputeNode. So, we get rid
of the heavyweight TrackerTestCase from test_resource_tracker.
Change-Id: Ib7d6d5901dbfdf32377ec4ed14b88a4905b619a7
Removes a duplicate test from test_resource_tracker.py that was entirely
covered by test_tracker.TestInstanceClaim.test_claim_numa() but using
the lightweight NoDBTestCase base test class.
Change-Id: I76cff9e498f9f9b863bc9256cf73a1d8453f62b5
This removes db2 support from tree completely. This is an oddball non
open database that made doing live data migrations difficult. It is
used by 0% of users in the OpenStack User Survey.
Supporting commercial software that doesn't have users at the cost of
delivering features and fixes to our community is the wrong
tradeoff. This corrects that.
It rewrites migrations, which we typically don't ever do, but it is
better if newton fresh environments fail early in db creation instead
of very deep in the data migration process.
Change-Id: Ifeb9929e4515e3483eb65d371126afd7672b92a4
This sets up the HTTPProxyToWSGI middleware in front of Nova-API. The
purpose of thise middleware is to set up the request URL correctly in
case there is a proxy (For instance, a loadbalancer such as HAProxy)
in front of Nova.
So, for instance, when TLS connections are being terminated in the
proxy, and one tries to get the versions from the / resource of
Nova, one will notice that the protocol is incorrect; It will show
'http' instead of 'https'. So this middleware handles such cases.
Thus helping Keystone discovery work correctly.
The HTTPProxyToWSGI is off by default and needs to be enabled via a
configuration value.
Change-Id: Ia78f73e96585ab33a379a0b0be6d9682f7fbd810
Closes-Bug: #1573766
Removes test_claim_sets_instance_host_and_node() from
test_resource_tracker.py after adding a few assertions to an existing
unit test in test_tracker.py that validate the exact same code path
without a heavyweight TestCase-derived test class.
Change-Id: I25cbc33d1216d0b6a909ce184f486a75d8f25bd8
This unit test in test_resource_tracker.py was ostensibly testing to
ensure that if resources didn't change on the compute node, that the
scheduler client's update_resource_stats() method was not called (and
conversely, if the resources *did* change, that the
update_resource_stats() scheduler client call *was* called.
This was a good unit test. The problem was that this unit test already
existed entirely in the test_tracker.py test file in the
TestUpdateComputeNode test class. The test_tracker.py test classes don't
suffer from deriving from a test class base that spawns a conductor
process and init's a database (in other words, isn't a unit test). And
so goodbye duplicate SchedulerClientTrackerTestCase.
Change-Id: I4905883dc4372fff413f009ec9110985998542bd
The unit tests that tested the (very simple)
_set_instance_host_and_node() and _unset_instance_host_and_node() were
not unit tests -- they were subclassing from TestCase, not NoDBTestCase
and the setUp() of that class was doing all sorts of "real" stuff,
including starting a conductor process, init'ing a database, etc. This
patch moves those unit tests into test_tracker.py and has them
inheriting from NoDBTestCase.
Change-Id: I1f4f60bd2b3b607b1c9ac92360f38c7b5ce48df1