Add tempest test for heat resource OS::Nova::KeyPair

The template will create two OS::Nova::KeyPair and will test that:
   [*] The key with save_private_key flag set to true outputs both
       public and private keys.
   [*] The key with save_private_key flag set to false outputs
       only the public key.

Testing other cases will require to recreate the stack and
include a negative test case.

Change-Id: I751a85e0efd997a1238c53d8802ebdd8b551e7aa
Partial-Bug: #1271995
Improve ServerCfnInitTestJSON asserts and debugging

This change asserts that every heat resource goes into the
CREATE_COMPLETE state, and if the WaitCondition times
out then the server console log is logged.

To make the template more readable and maintainable, usages of
Fn::Join have been replaced with Fn::Replace.

Change-Id: I59fb54a292e77c7acf3c3ba2e1b02bdf06e998de
Fix InvalidInstanceID.NotFound handling

The matcher used with boto tests is returing with None,
 when it matches. The incorrect condition handling may lead to
longer deletion time or failure.

Change-Id: I7d03528ab6183dd9a49169c0a6ec2a4a95fb7d52
Add security group deletion to the cleanup util

Add security group deletion code to the stress cleanup utility.

Change-Id: I39b70da4000da1a72fff7b3384831673eb7e06f7
Stress runner friendly logging.conf.sample

tempest.common.log.TestsFormatter formatter was removed from the tempest
repository. It makes the current sample config file useless.
We will use the same ContextFormatter in the sample config as we use in the
normal runs.

The tempest.log file will be appended, instead of replacing.
The summary of the stress runs will be printed to the stdout.

The syslog handler preserved in the sample config, but it is not in use
anymore. If someone want to use, he can enable it by little change.

NOTE:
You need change tempest.conf [DEFAULT]/log_config_append to point a valid
logging config, if you would like to use special log related
configuration.

Change-Id: Ic6ede3943e309a102d4af6dec505f0d4cbd3bc2b
Adds L3 agent test case to test_l3_agent_scheduler.py

This submission is to verify "add L3 Agent" and "remove L3 Agent"
functionality and also added required methods in both XML/JSON
interface

Change-Id: I7829b7aefdea3c138ffb8070ba1497343f4a11fe
Extend network debug infos on network failures

After the https://review.openstack.org/#/c/76640/ is merge tempest will
be allowed to dump the ovs db.

The ovs db dump can help in identifying trunk/access port miss configuration
issues.

Change-Id: Ia751dc5046ce07369b9044eda3b20c63d38bac99
Fix setup_test_v3_user method in identity base.py

Create user in v3 identity json/xml only has two parameters.
To test the fixing, I add a v3 user test :
- test_get_user

Change-Id: I2168a21f361e0ed83b91de06652bfeea424f92f6
Configure the ec2 zone explicitly

Tempest now creates Availability zones which in parallel run,
may causes issues with EC2 tests.

The EC2 tests will use the preconfigured zone, instead of just picking a
random existing zone.

Closes-Bug: 1265672
Change-Id: I12dfaca868a3f0aec2a85fe45d8a524940d9eae0
Add unit tests for image waiter

This commit adds unit tests for the image waiter in
tempest.common.waiters. It adds tests for both the timeout case and
the success path.

Partially implements bp unit-tests

Co-Authored-With: Sean Dague <sean.dague@samsung.com>

Change-Id: Ib0501cd3bc323fd036444dacf884879963842e50
Add Cinder tests for quota sets

This commit adds client for the Cinder quota API and adds
tests to list and update the quotas.

Change-Id: Ic53dbf6e6ef26c4275039091fc4db6a63f796dba
Closes-Bug: #1252774
Removes gate test annotation in security_groups

This submission is to remove type=gate to smoke in
security_groups test scripts of compute.

Change-Id: I1f16c48614aec3beae1b9ec2dc0a66d8f65e8626
Prepare for enabling H302 rule (api/compute/admin)

We can use H302 rule but ignore it now. This commit prepares for
enabling H302 rule. But this commit modifies a part of Tempest only
because if we fix all of them at one time, it's hard to merge this
commit.

    ---------------
    tempest/api/compute/admin     <- This patch
    tempest/api/compute/{c*,f*,i*,s*,t*}
    tempest/api/compute/{v3,volumes},data_processing
    tempest/api/identity/admin
    tempest/api/image
    tempest/api/{n*,o*,t*}
    tempest/api/volume,tempest/*
    tempest/services/compute/json
    tempest/services/compute/v3/json
    tempest/services/compute/xml
    tempest/services/identity
    tempest/services/{im*,n*,o*,t*}
    tempest/services/volume
    tempest/clients.py: TBD
    ---------------

Change-Id: Id993c8b157c0b1256aa17c2b8e8f8da46111c521
Prepare for enabling H302 rule(services/compute/v3/json)

Currently H302 rule is ignored by tox. However, this rule should
be enabled. This patch partially fixes this problem to prepare for
H302 rule.

Change-Id: I4f573cb306f86cf8476f8fa8950a47c21e443db8
Prepare for enabling H302 rule(api/image)

Currently H302 rule is ignored by tox. However, this rule should
be enabled. This patch partially fixes this problem to prepare for
H302 rule.

Change-Id: Ieb47937ae222e3ccf8d8c630f344a64db8d256ba
Do not setUpClass or tearDownClass V3 tests if API is disabled

Bugs in performing tearDown may occur if v3 is
disabled as the skip would cause the setUp to be
incomplete, causing the tearDown to reference undefined
instance variables.

Change-Id: I69110c6149ee22aa3e0d6ee27c52ef0159e9a235
Closes-Bug: #1282839
Closes-Bug: #1282829
Closes-Bug: #1282827
Stop volume leaking test_server_rescue_negative

test_server_rescue_negative created a volume, but did not deleted it.

Change-Id: Id54e34eb79547bb8197d61f91c210eba57563a03
Blueprint: stop-leaking
Fix test by waiting to lbaas entity delete

This fix prevents a scenario where an
lbaas entity is trying to be deleted while it still in use,
because an associate entity still didn't finished it's deletion.
Handling the DB before completing the back-end operations
can cause problems.
So waiting for back-end system response is crucial for
keeping the DB model consistent.

A new network timeout and time interval options were
added in configuration file. These were added to give control over
network resources wait periods without effecting other projects.

Added wait_for_resource_deletion and is_resource_deleted functions,
similar to the common rest_client functions but with resource type
as a parameter since network service has no rest_client for each resource.
calling the new function when deleting vips and pools.

Bug #1288326 was opened to address the fact that network rest client does
not fit common REST client framework approach where each resource
has its own implementation of the client.

This change is a replacement for the change below.
https://review.openstack.org/#/c/68190/3
Was replaced due to a development workstation crash.

Change-Id: Ie6468f0488ea2515ed8ccbe1a8c9c55b9ab4a3de
Closes-Bug: #1271214
Add support for negative tests with admin client

This adds the missing support for admin clients and implements an
example based on flavor creation. Instead of listing all result code
checks it is now possible to define on default.

Change-Id: I9512c1b91eb227e35faf24e3e88ed73a6ed3b734
Partially-implements: bp autogen-negative-tests
Enable H302 check (api/compute/{c*,f*,i*,s*,t*})

We can use H302 rule but ignore it now. This commit prepares for
enabling H302 rule. But this commit modifies a part of Tempest only
because if we fix all of them at one time, it's hard to merge this
commit.
    ---------------
    tempest/api/compute/admin
    tempest/api/compute/{c*,f*,i*,s*,t*}     <- This patch
    tempest/api/compute/{v3,volumes},data_processing
    tempest/api/identity/admin
    tempest/api/image
    tempest/api/{n*,o*,t*}
    tempest/api/volume,tempest/*
    tempest/services/compute/json
    tempest/services/compute/v3/json
    tempest/services/compute/xml
    tempest/services/identity
    tempest/services/{im*,n*,o*,t*}
    tempest/services/volume
    tempest/clients.py: TBD
    ---------------

Change-Id: I9d4041754df0e9f20937300b1e19c8ae63d4090a