Adds test for Sec group default rule Nova V2 API

This patch adds the test for below 'os-security-group-default-rules'
Nova V2 APIs-
- Create Security Group default rule
- Delete Security Group default rule
- List Security Group default rule
- GET Security Group default rule

This patch also adds the new json client.

Related-Bug: 1311500

Change-Id: Icf52a64b5719587cd02b906f3a0f8d17886241aa
Check rebuild server action API attributes

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

The response body of server rebuild V2 API is given below:
{
    "server": {
        "accessIPv4": "1.2.3.4",
        "accessIPv6": "fe80::100",
        "addresses": {
            "private": [
                {
                    "addr": "192.168.0.3",
                    "version": 4
                }
            ]
        },
        "adminPass": "seekr3t",
        "created": "2012-09-12T17:20:36Z",
        "flavor": {
            "id": "1",
            "links": [
                {
                    "href": "http://openstack.example.com/
                            openstack/flavors/1",
                    "rel": "bookmark"
                }
            ]
        },
        "hostId": "1e3da81662360b7e5ea6d8123031f67168b6992f20bb84df69",
        "id": "075e40fe-9f03-4652-ba8e-5f8e2547899a",
        "image": {
            "id": "70a599e0-31e7-49b7-b260-868f441e862b",
            "links": [
                {
                    "href": "http://openstack.example.com/openstack/
                            images/70a599e0-31e7-49b7-b260-868f441e862b",
                    "rel": "bookmark"
                }
            ]
        },
        "links": [
            {
                "href": "http://openstack.example.com/v2/openstack/
                        servers/075e40fe-9f03-4652-ba8e-5f8e2547899a",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/openstack/
                        servers/075e40fe-9f03-4652-ba8e-5f8e2547899a",
                "rel": "bookmark"
            }
        ],
        "metadata": {
            "meta var": "meta val"
        },
        "name": "foobar",
        "progress": 0,
        "status": "ACTIVE",
        "tenant_id": "openstack",
        "updated": "2012-09-12T17:20:37Z",
        "user_id": "fake"
    }
}

The response body of server rebuild V3 API is given below:
{
    "server": {
        "addresses": {
            "private": [
                {
                    "addr": "192.168.0.3",
                    "mac_addr": "aa:bb:cc:dd:ee:ff",
                    "type": "fixed",
                    "version": 4
                }
            ]
        },
        "admin_password": "seekr3t",
        "created": "2013-11-14T06:29:00Z",
        "flavor": {
            "id": "1",
            "links": [
                {
                    "href": "http://openstack.example.com/flavors/1",
                    "rel": "bookmark"
                }
            ]
        },
        "host_id": "28d8d56f0e3a77e2089172b68032e017045e20aa5dfc6cb66",
        "id": "a0a80a94-3d81-4a10-822a-daa0cf9e870b",
        "image": {
            "id": "70a599e0-31e7-49b7-b260-868f441e862b",
            "links": [
                {
                    "href": "http://glance.openstack.example.com/
                    images/70a599e0-31e7-49b7-b260-868f441e862b",
                    "rel": "bookmark"
                }
            ]
        },
        "links": [
            {
                "href": "http://openstack.example.com/v3/servers/
                a0a80a94-3d81-4a10-822a-daa0cf9e870b",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/servers/
                a0a80a94-3d81-4a10-822a-daa0cf9e870b",
                "rel": "bookmark"
            }
        ],
        "metadata": {
            "meta_var": "meta_val"
        },
        "name": "foobar",
        "progress": 0,
        "status": "ACTIVE",
        "tenant_id": "openstack",
        "updated": "2013-11-14T06:29:02Z",
        "user_id": "fake"
    }
}

Partially implements blueprint nova-api-attribute-test

Change-Id: Ia75f7862bf8eac40f7a9b125fb7e101830da514b
Use python abc in auth class

Instead of using NotImplementedError the abc class has the advantage
that it fails faster if a class doesn't implement the needed interface.
Adapt unit test and test class.

Change-Id: Ide914a4bb577a28a3d202cbf088c404323a29b21
Partial-Bug: #1346797
Check rescue_server action attributes of Nova APIs

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

For V3 API, "admin_password" in response body is depend on config
variable "enable_instance_password". So schema and request
is adjusted accordingly.
NOTE - V2 rescue API's response does not on above config variable.

The response body of rescue server V2 APIs is below:
{
    "adminPass": "%(password)s"
}

The response body of rescue server V3 APIs is below:
If CONF.enable_instance_password is true-
{
    "admin_password": "%(password)s"
}
Else
    {}

Partially implements blueprint nova-api-attribute-test

Change-Id: I85f18eaa58bfef1871100816f97487f9fa9bc0ee
Avoid errors in log when neutron tests are skipped

The BaseNetworkTest class setUpClass() method will initialize
various class attributes which the tearDownClass() method
expects to exist. Unfortunately when Neutron is not
available, the entire of the setUpClass() method is skipped,
but tearDownClass() still runs. This causes the logs to get
polluted with errors about missing attributes during
tearDownClass(). eg

ERROR tempest.test [-] tearDownClass failed: type object
 'DHCPAgentSchedulersTestJSON' has no attribute 'ipsecpolicies'
TRACE tempest.test     for ipsecpolicy in cls.ipsecpolicies:

Make the tearDownClass() code be conditional on neutron
being enabled too.

Change-Id: I042ca5c47e5c1e8d1042754fd7f36036a40b2f03
Fix javelin2's skip logic in checks

The create logic always requires the top level section in the yaml file,
but it can be empty.

Change-Id: Ia06bba8877be1cf4e66dad21eaeb2a323bf9f9b5
Fix skip_path logic if path part is empty

This was the case for the image client.

Change-Id: I5568bf6781ad57524c033868c2ab9f2ba4bb566d
Use random binary data for test images

There have been some complaints that the image api testing does nothing
to verify the actual path of uploading binary image data. Since binary
data is the norm rather than the exception, this patch modifies most
usage of image data to be randomly selected binary data.

Change-Id: I54457ed3aea14b540820b5e451c529831074a7bf
Allow out of quota failure status code to be 413 or 403

This commit I7c179748769b8a0e2cc2e476ebefe33449f6f304 changes the
error code for when a request fails due to quota exhaustion from 413
to 403. The corresponding tempest tests now allow both 413 and 403 as
an acceptable error code to fit into the new branchless tempest model.

Change-Id: Ia7906d9036d760fc51cd36639bde721e5782a36d
Related-bug: #1334903
Merge "Allow out of quota failure status code to be 413 or 403"
Merge "Check rebuild server action API attributes"
Merge "Use python abc in auth class"
Merge "Use random binary data for test images"
Merge "Adds test for Sec group default rule Nova V2 API"
Merge "Fix javelin2's skip logic in checks"
Merge "Avoid errors in log when neutron tests are skipped"
Merge "Check rescue_server action attributes of Nova APIs"
Skip test_rescope_token

There are several problems with revocation events in Keystone and
the test is currently failing on postgres. There's several fixes
proposed in Keystone to fix these but until they're merged this
test isn't working.

Change-Id: I9182d542fae0b4a5280dc482300203f84c8f4d8c
Closes-Bug: #1351026
Merge "Fix skip_path logic if path part is empty"