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
Use a more sensible network topology for some router tests

This is achieved by creating subnets on separate logical
networks. A negative tests is also added to verify that
interface attachment fails when done with overlapping
subnets.

Closes-bug: #1316742

Change-Id: Idb1965e32d30acd962e1a3fa755b6c8b25c1bc31
Deduplicate status call checks

This commit updates the jsonschema validation method validate_response()
to use the rest client method expected_success() to check that the
correct status code response is received. Previously validate response
was doing the same check despite there already being a method available
for doing the check. As a part of using expected_success() to validate
the status codes using the jsonschema it was necessary to expand
expected_successs() to handle both single expected codes as well as a
list of codes. This is because it's perfectly valid for the jsonschema
to specify a list of expected responses.

Change-Id: I400bb9aff89c18f3964a1d8ec45bfb8dfd75301d
Enhanced Trove (database) flavor API tests

 - Added test to make sure trove flavors matched OS (nova) flavors
 - Added response status checks to existing tests

Partially implements: blueprint trove-tempest

Change-Id: I59cc551ef5ec58fe43b794ae8dbd6a89c40c774b
Reworked scenario tests to use their own non-default security groups

Moved _create_security_group_nova to base OfficialClientTest class, so
that now it can be used by all scenario tests. All scenario tests now
create security group with "loginable" rules explicitly and attach it to
servers instead of using "default" security group.

Change-Id: If82c681b4a7f62808f46b03c57d113f8f5c97f6f
Closes-Bug: #1247060
Add cinder CLI tests "qos-list" and "encryption-type-list"

Below two tests are added for cinder cli:
qos-list
encryption-type-list

Change-Id: Ic025ec401135b1de64871ef1df368cd13f85f7a3
Nodestate API test for power state set

This patch implements Nodestate API tests, to set the power state of
the node for the following power states -
1. power on
2. rebooting
3. power off

Change-Id: Icbb2719ffae772878f183c0c77c1e9d9028655c1
Clarify API extension description of Nova API

On Nova API, we can see two names for each API extension. The one is
"Name", the other is "Alias". The "Name" is represented with camelcase
and the "Alias" is done with characters and hyphens:

 $ nova list-extensions
 +--------------+-----------------------+------------------+---------+
 | Name         | Summary               | Alias            | Updated |
 +--------------+-----------------------+------------------+---------+
 | AdminActions | Enable admin-only ... | os-admin-actions | ...     |
 | Agents       | Agents support.       | os-agents        | ...     |
 | ConsoleOutput| Console log output... | os-console-output| ...     |
 | Consoles     | Interactive Console.. | os-consoles      | ...     |

In Tempest, we can select API extensions what we test and it should be
based on "Alias", because on Nova side we have been a lot stricter about
format/uniqueness for the alias which is seen as the canonical name.
This patch clarifies it.

Change-Id: I3e753c81182af83e01ad3a1f2eb9782c8abb6f50
Check create/get/delete V2 server_group attributes

This patch adds the JSON schema for Nova V2 create, get & delete
server_group APIs response and validate the response with added
JSON schema to block the backward incompatibility change in the future.

The response body of create & get server_group V2 APIs is same and given
below:

{
    "server_group": {
        "id": "5bbcc3c4-1da2-4437-a48a-66f15b1b13f9",
        "name": "test",
        "policies": ["anti-affinity"],
        "members": [],
        "metadata": {}
    }
}

Delete server_group API only return 204 response code.

Partially implements blueprint nova-api-attribute-test

Change-Id: I0447292553394877493fc264451559d9df14242f
Optimization and response status code update

In following test files response status code is not being checked -
1. test_api_discovery.py
2. test_chassis.py
3. test_nodes.py
4. test_ports.py

This patch adds checking for missing response status code in above.
Also it optimize codes of files.
Change-Id: I4bc5aa756508b533919c283ce18f641fec50b30e
Mising CLI test for Keystone

This patch adds following missing Keystone CLI test -
1. ec2 credentialslist

Partially implements: blueprint missing-cli-tests-in-tempest

Change-Id: Ibf0070e12f3087756addcbed841d52c73cf70553
Convert get_console_output length=None to -1 for Nova V3 API calls

Nova commit 8e5577f52f660960738f1fc0384dff77fa30fc8a makes the nova v3
get_console_output extension handle unlimited length with -1.

In the nova v2 API the length parameter is optional but the nova v3 API
uses jsonschema validation so it expects a value to check against.

Closes-Bug: #1328582

Change-Id: Ib1ae85e644e08c24aaf0ba2baaa8812286ef0ebd
cleanup on remote_client

Remove unused get_files method.

Change-Id: I6c48a0e557602fba8a2b1931ce949af2cdd8aa8c
Add unittests for remote client

Remote client is used in servers tests to provide some common operations into a
remote server. It's backended by the ssh class, which already has tests, so all
of its calls are mocked and due to that there are some 'useless' tests that are
pretty much checking response's format and checking if the ssh call didn't
change to avoid inconsistencies in the future.

Partially implements bp unit-tests

Change-Id: I5dabc170a557c81bb9b0605bf101719585d7c53b
Adds test for Floating Ips bulk Nova V2 API

This patch adds the test for following Nova V2 APIs-
- Create Floating Ips bulk
- Delete Floating Ips bulk
- List Floating Ips bulk

This patch also adds the config option for unallocated
Floating IP Range

Change-Id: I6af52bb2ce2caadf8491740097df71d041643e78
make 'server' as 'required' in server update schema

This patch make the 'server' attribute as 'required' in
server update schema (base_update_server).

This attribute is not optional in server's update API response.

Partially implements blueprint nova-api-attribute-test

Change-Id: Ibec518910597fc9e03a69d1d2bc94e719cfab0f9
fix usage of allow_tenant_isolation

Some tests are not use allow_tenant_isolation when it True.

Change-Id: I85461a7829440e4a9f8ca63eb214f56604a09039
Add total runtime to summary output

This commit adds the total runtime in secs to the summary view from
subunit-trace.py

Change-Id: If56f2a048b3d1ab3d51425d5b3560e1f365a6c3a
add block_device_mapping to create_server params for nova clients

Change-Id: Ic931fab33b461b00a2155407bf307c692c7f18e6
Closes-Bug: #1327942
Sync versionutils from oslo-incubator

This is needed for comparing client versions from the command line to
required versions for CLI tests.

Tempest already has the immediate oslo dependencies of gettextutils and
log and those are up-to-date enough for what's needed in versionutils,
so this is a --nodeps sync.

Part of blueprint minversion-check-for-cli-tests

Change-Id: I19784499a9bb1135a9c8dc8b26fc56c53489ed22