Refactor usage of custom_match tests

For some requests a check outside of custom_match was used, thus
bug #1262534 was not completely closed.

This patch refactors part of the code to use custom_match
as far as possible and also adds some more checks.

Closes-Bug: #1262534
Change-Id: Ic0760d6d91a83bdce45ae42dd3f9d05a7bc8b6b3
Moves negative tests from test_server_metadata

This change set moves the negative tests in
tempest/api/compute/servers/test_server_metadata to
a new file test_server_metadata_negative

Also removes usage of modules directly and qualifies
test_server_create_metadata_key_too_long as negative test.
 ** seprates test into individuals
Note: HACKING.rst
The second requirement is that all negative tests must be added to a negative
test file. If such a file doesn't exist for the particular resource being
tested a new test file should be added

Change-Id: I91f1ee898866e458ff15a4d5035a772ff5c14701
Add a couple log errors to whitelist.yaml

These log errors have hit the large ops jobs several times. There is one
in ceilometer acentral and one in nova conductor.

Change-Id: Idc30110085e95c615958fc5f90e86417855e6d7a
Avoid expiration before updating metadata

The X-Delete-At value might already be in the past after the initial
object creation because the current time is used to set the
X-Delete-At value. Creating the initial object before starting each
test prevents this.

Change-Id: Id892e802601b50d4eeadbf5b857212adef591456
Closes-Bug: #1269597
Rewrite RemoteClient.get_boot_time()

This is doing conversion between time formats, while we could really
just stay in seconds. This also fixes the method to work for cirros,
which doesn't know about human readable time formats.

Change-Id: Id123d71adb29d169a26f0dde6af00f292fe61d09
Closes-Bug: #1244823
Sync Patch and PatchObject fixtures from oslo-incubator

This change allow us to set a replacement function to these fixtures.
Depends on I32a90b4d47174b6adb53b525a4add7002411b29d

Change-Id: I897db568280c026f92f7f6da8c1ea974274fc037
Make --debug flag on run_tests and run_tempest use testtools.run

This commit changes the --debug flag on run_tests.sh and run_tempest.sh
so that instead of setting set +o xtrace will run tests with testools.run.
This enables pdb to work because calling subunit.run or using testr will
interfere with pdb.

Change-Id: I9953af7a2375a1d26df69559799be3df973756af
Add simple node group tmpl API test for Savanna

It tests CRUD and list operations for node group templates.

Change-Id: Ib2c94db50db03998ad402d52b4f87032581fdc76
Check if service is available for cli tests

This commit adds checks to the CLI tests to see whether the service
that is being tested is available or not. Previously the tests would
run regardless of whether the service was listed as available in the
config file or not.

Change-Id: I16e0bbab85d2234d671ea2577757b38480e66d69
Fix class inheritance for volume_types tests

Previously the tests in test_volume_types.py manually setup an
admin_client using the admin credentials specified in the config file.
However, this is not correct because with tenant isolation those
credentials shouldn't be used other then to create a new tenant.
Additionally, everything performed in the test class's setUpClass was
already done in the base class. This commit corrects this by
changing the test class inheritance to the proper base class.

Closes-Bug: #1271312

Change-Id: Ia798c2c41d132a2ed17d6e0a9215d21a00c97a32
Skip test_list_servers_by_admin_with_all_tenants test

This patch add skip decorator for test_list_servers_by_admin_with_all_tenants.
After use 'all_projects' instead of 'all_tenants', will fix this test.

Related Patch: https://review.openstack.org/#/c/58292/

Change-Id: Ibb71c3a966f6c09b93e821781d4266d56d65950b
Related-Bug: #1265416
Remove baremetal xml support

Ironic decided to not to support xml in API, therefore we remove
corresponding workpiece from the tests.

Change-Id: I35849526778e3ad9428ee9c791a78cf0b86b190f
Update 'Member' with option 'operator_role' in tempest.conf

In function _get_object_storage_client(), it is better to use the
option 'operator_role' in tempest.conf than hard code the role
to 'Member' here.

Change-Id: Id1de7ee55159f6583a0a93ee87e26a5deaacfd6e
Closes-Bug: #1267857
Removes vim headers 3rd round

This is a follow up on:
  Change-Id: I8d09cb41ad633719857973a3ea228cd8dd3a9270

The vim headers in all the files are being removed. We've missed these
files because of delays in the patches.

Change-Id: Ie8097db6c60481749c88991864187ade64f39ecb
Closes-Bug: #1229324
Remove unused method basic_auth from rest client

This method is not being used. Removing to reduce the area we need to cover in
the unit tests.

Related to bp unit-tests

Change-Id: I4ede8975d6fbbd4e5a4366f1ae2d771ffa526f91
Run SNAT specific test cases only with ext-gw-mode extension

In network api's test_routers, there are test cases which involves
enable_snat attribute. We should not be running these test cases if
the ext-gw-mode extension is not supported by network plugin.
Adding decorator to corresponding methods in test_routers.

Change-Id: I71fd96ce6b30ba7307c92733c363eb996ee6c1db
Closes-Bug: #1273360
Use BaseComputeTest.create_test_server

By using this instead of ClientServers.create_server, we inherit
everything that is automatically setup in
BaseComputeTest.create_test_server.

Change-Id: I4b6cbf8243083cb377323a4aff8de305d5c300f9
Remove Nova v3 XML tests completely

We have decided that XML support is removed from Nova v3 API and
the tests also are removed from Tempest.
Most code has been removed from Tempest, but there are some code
related to Nova v3 XML tests yet.

This patch removes them from Tempest.

Part of bp:remove-v3-xml-api

Change-Id: Ie3c595fb77143e58e30404c42f358d6443a52c0b
tighten up isolated creds create

we're spewing giant user and tenant names in logs, which make
actually getting to the bottom of things less useful, as we're
constantly doing left / right scrolling. Shorten this up.

this changes makes a number of fix ups here.

1) it shortens down the name to just classname + rand piece, no
need to add extra -tempest- -tenant, as it's pretty redundant. We
throw out any value which has a '.' in it, because that's not a
class name.

2) it fixes the scenario isolated creds call. __name__ is package
name, and cls.__name__ actually gives us the class name.

3) it stops using a variable in a different namespace as a
temporary variable for isolated creds create. This looks like it
was based on a find / replace refactor to remove importing modules.
It worked, but it was wrong.

4) it stops using the same random bits for user & tenant. There is
no reason these should match, and in the new scheme they would if
they shared random bits.

Change-Id: I216155d68cbdbf9bed10e2ab9b7a1ea714570358
Remove super call in overloaded close()

Change Ia30058bc4752489107b998bd44d38c27901cfe63 introduced a super()
call after overloading the close() method in VerifiedHTTPSConnection.
However, the parent class httplib.HTTPConnection was definied using
the old-style class contructor so the super() call won't work. This
commit fixes that by removing the super() call and explicitly calling
the parent class's close() method.

Closes-Bug: #1273737

Change-Id: I17b86e67716b427866bc33ca3c15cb4e32ba6587