Refactor _find_caller into a public test finder utility

This moves the _find_caller utility method from rest_client into it's
own public utility so that we can use it elsewhere in Tempest, like to
uniquely identify which test case fails in a TimeoutException.

This is useful to uniquely fingerprint timeout failures with
elastic-recheck which is not always possible right now because we don't
have multi-line query support with elastic-recheck.

Related-Bug: #1315201

Change-Id: I0cef7697e36a0ecd29c2540a5c283d322b2c62b7
Merge "Add a lacking message format letter 's'"
Removing unnecessary pass instructions

There are some files in Tempest where code has unnecessary
pass instructions. This CR fixes that.

Change-Id: Ie32399d731edad8a4d0b9cdec8aa7e9444eda254
tests the user-password-update for Keystone V2 API

This patch adds JSON/XML client and test for below Keystone V2 API :
1. user-password-update

Change-Id: Ifa1b3e005c82f09b8ba63b6cd8a6671892f5006f
Enforces the use of Credentials (part2)

Multiversion auth part5

Refactor mangers, utils and test base classes to use Credentials instead
of username, password and tenant_name.
Makes changes to tests where needed - some of the tests create their own
managers.

Partially implements: bp multi-keystone-api-version-tests

Change-Id: If05f5704d90390362cebf45e2664f2bfbc72268d
Access credential fields as attributes

Some tests access credentials attributes using dictionary
syntax (e.g. with get method); changed to use the Credentials
attribute directly.

Partially implements: bp multi-keystone-api-version-tests

Change-Id: Ic5b68af18d9a2dda581bdc1500d064e0ba732ec4
Add in a concurrency aware subunit filter

A live filter for subunit stream that will let us display the
concurrency of the streams as we go.

* This includes the worker id as {#} at the beginning of the lines
* Dumps out stdout/stderr if they are found inline (makes for easier
  debug
* Dumps out pythonlogging on failures if found inline
* Prints skip reasons

Based on I1b529546e005f47aba56b451e1c0d8b0da09fca3, but because
that started as Robert's I couldn't un Abandon it.

Change-Id: Icc99b652e4e8ae85b73bb905a3b704447a63195f
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
Merge "Add compute service tags to ListSnapshotImagesTest"
Check non json type on glance client json_request method

This patch adds Content-Type headers for request and responses in
glance_http json_request methods based on what was discussed in a
previous patch.
(https://review.openstack.org/#/c/84454/4/tempest/tests/test_glance_http.py)
Also includes a couple of unit tests to assure the behavior.

Related to bp unit-tests

Change-Id: I570c86401f878ab8048194be252ce82d1b44f5b4
Merge "Verify attributes through Nova os-quota-sets API"
Add unit tests for tempest hacking checks

This commit adds unit tests for the remaining untested hacking checks:
 - T102: import_no_clients_in_api
 - T104: scenario_tests_need_service_tags
 - T106: no_vi_headers
 - T107: service_tags_not_in_module_path

Change-Id: Ib2a82c5e92fbd7f165477f1906cf117f064fcef5
Merge "Adds more testcases to test_telemetry_alarming_api"
Merge "Add in a concurrency aware subunit filter"
Verify update host Nova V2/V3 APIs attributes

This patch adds the JSON schema for Nova V2 & V3 update host
APIs response and validate the response with added
JSON schema to block the backward incompatibility change in the future.

The response body of update host V2 API is below:

{
    "host": "%(host_name)s",
    "maintenance_mode": "off_maintenance",
    "status": "enabled"
}

The response body of update host V3 API is below:
{
    "host": {
        "host": "%(host_name)s",
        "maintenance_mode": "off_maintenance",
        "status": "enabled"
    }
}

Partially implements blueprint nova-api-attribute-test

Change-Id: Idecedd2bbe98444b07dcf328bc73ca84e68a197a
Merge "Refactor _find_caller into a public test finder utility"
Verify the response attributes of 'create-aggregate' API

This patch verifies the response attributes of 'create-aggregate'.
The response attributes of v2 and v3 are the same:
{
    "aggregate": {
        "availability_zone": "nova",
        "created_at": "2012-10-01T18:50:27.781065",
        "deleted": false,
        "deleted_at": null,
        "id": 1,
        "name": "name",
        "updated_at": null
    }
}
The status_code is different:
  v2 -> 200
  v3 -> 201
This patch also fixed a typo bug in the compute/aggregates.py

Partially implements blueprint nova-api-attribute-test

Change-Id: I584ee2b9ac6033fb365a8dadd4e3844b1c37edb2
Verify list_addresses_by_network APIs attributes

This patch adds the JSON schema for Nova V2 & V3 server
list_addresses_by_network APIs response and validate the
response with added JSON schema to block the backward
incompatibility change in the future.

The response body of server list_addresses_by_network V2 API is below:

{
    "private": [
        {
            "version": 4,
            "addr": "192.168.0.3"
        }
    ]
}

The response body of server list_addresses_by_network V3 API is below:

{
    "private": [
        {
            "version": 4,
            "addr": "192.168.0.3",
            "type": "fixed",
            "mac_addr": "aa:bb:cc:dd:ee:ff"
        }
    ]
}

Partially implements blueprint nova-api-attribute-test

Change-Id: I76e25523708fb9454518f215dc60f201d7483464
Inherit V2 keypair API's tests from V3 tests

There is a lot of copy&paste test code for Nova v2/v3 API tests.
In addition, we need to add many checks for API test coverage.
As the result, we should apply the same changes to v2 and v3 tests.

This patch reuse the test code between V2 and V3 Keypair APIs
Inheriting the V2 Keypair API's test from V3 tests.

Partially implements blueprint nova-api-test-inheritance

Change-Id: Ibe170a00e27619827678a1bbe104623ca24a81a3
Inherit V2 API's flavors tests from V3 tests

There is a lot of copy&paste test code for Nova v2/v3 API tests.
In addition, we need to add many checks for API test coverage.
As the result, we should apply the same changes to v2 and v3 tests.

This patch reuse the test code of flavors APIs between V2 and V3
Inheriting the V2 flavors API's test from V3 tests.

Partially implements blueprint nova-api-test-inheritance

Change-Id: I85463baec7af1e4e8bcc6310804fd15c1958d7ed
Share Certificates API's tests between V2 & V3

There is a lot of copy&paste test code for Nova v2/v3 API tests.
In addition, we need to add many checks for API test coverage.
As the result, we should apply the same changes to v2 and v3 tests.

This patch reuse the test code of V2 and V3 Certificates APIs
Inheriting the V2 Certificates API's test from V3 tests.
Also removing the status code check which is different between
V2 & V3. Status code has been validated at client side.

Partially implements blueprint nova-api-test-inheritance

Change-Id: I98e03cecdbd36e521d007bbfb92a5f9818ff28f6