Extending quota support for neutron LBaaS entities

Part of extending quota mechanism to support neutron
LBaaS entities.
Adding new test for testing the lbaas resources.
The test is skipped if network lbaas extension is not available

This is one of four changes related to the BP.
This one is for tempest project.
Another one is for neutron project
and another one is for python-neutronclient package
and another one for horizon/openstack-dashboard project.

See blueprint neutron-quota-extension for another three changes.

Change-Id: I3b2739c28ff8dfbc4271d6f5d14b0655b6f9e203
Implements: blueprint neutron-quota-extension
Fix hardcoded gateway in IPV6 subnet api tests

This patch removes the hardcoding and calculates the Gateway-ip
based on the tenant_network_v6_cidr value.

Change-Id: Iee4c450714caf49d6753d9455e6ab3698b64340d
Closes-Bug: #1318962
lbaas basic - open firewall for http on vip port

This is necessary for test_load_balancer_basic to work
when the linuxbridge agent is used.

Change-Id: I620882c31461d438add0f011cb916e28e2f266a3
Closes-Bug: 1313117
cleaning up index.rst file

Removed notes about the generation of the file.

Change-Id: I70bf5438a8fea9ca4f785313db4975b328f3a749
Fixed argument parsing in run script

Replaced += with = when adding arguments to the testrargs string
to prevent the script from doubling in length with each additional
argument.

Change-Id: If0ab41d6062c83cee50f830ffd9428c1302fd997
Closes-Bug: #1325405
Adds keystone roles v2 tests in v3

This submission is to add the tests missing in v3 and present in v2.
Submitting roles test cases.

Change-Id: I0e995848ed0019a4895cdff2b70795b5eaf9795a
Add test for compute API os-quota-class-sets

This tests showing and updating the 'default' quota class, which is
really all this API is used for. It was removed in Icehouse in part to
not knowing it was used even though python-novaclient and Horizon were
using it. The removal was reverted and this change is to enforce what
the API is used for.

The extension only lives in the Nova v2 API, it was removed in the v3
API in Icehouse.

This change adds new quota client and test classes for the new API.

An external lock fixture is used in all compute API quota tests to
avoid introducing race bugs with the existing tenant-specific
os-quota-sets tests.

Closes-Bug: #1325727

Change-Id: Ib0cde08dfaa0f6a5e180d247864fb59d76eca903
Verify V2 list server_group API attributes

This patch adds the JSON schema for Nova V2 list
server_group API response and validate the response with added
JSON schema to block the backward incompatibility change in the future.

The response body of List server_group V2 API is given below:

{
    "server_groups": [
        {
            "id": "616fb98f-46ca-475e-917e-2563e5a8cd19",
            "name": "test",
            "policies": ["anti-affinity"],
            "members": [],
            "metadata": {}
        }
    ]
}

Partially implements blueprint nova-api-attribute-test

Change-Id: I554237d9b66b42ea75ef3b47c8a9038c80b3cfb5
Add tox job to build docs

This commit adds a tox job to build the docs. It calls the setup.py
build_sphinx command.

Change-Id: I84dbd1aaea142bbe45c73df04856e128621143db
Improve test isolation in test_networks:BulkNetworkOpsTest*

Each test should be using its own networks. The sharing of networks
causes weird, unintended interactions.

Change-Id: Ifef6e9604fb40bba771bf41eea2f08246a803faf
Verify list-Floating-IP-Bulk Nova API attributes

This patch adds the JSON schema for Nova V2 list-Floating-IP-Bulk
API response and validate the response with added JSON schema
to block the backward incompatibility change in the future.
The response body of list-Floating-IP-Bulk V2 API is below:
{
    "floating_ip_info": [
        {
            "address": "10.10.10.1",
            "instance_uuid": null,
            "interface": "eth0",
            "pool": "nova",
            "project_id": null
        },
        {
            "address": "10.10.10.3",
            "instance_uuid": null,
            "interface": "eth0",
            "pool": "nova",
            "project_id": null
        }
    ]
}
Partially implements blueprint nova-api-attribute-test

Change-Id: I43b6f0618cb85d78577e7c63d8fbf08acc5e93a3
Allowed Address Pair API Tests Enhancements

Add test to update 'allowed-address-pair' attribute of port

-Create a port without allowed-address-pair
-Set allowed-address-pair attribute of port using port_update
-Validate that allowed-address-pair attribute of port is updated successfully

Change-Id: I0556617f837f62e3ccc06f50c049af0b227357b0
Sharing codes for volumes list tests

1. merge the common tests between v1 and v2, and set its
   default value for v2.
2. make volumes v1 list tests inherits common tests
3. leave volumes v2 specific tests in direcotry 'tempest/api/volume/v2'
4. delete BaseVolumeV2Test

Partially implements: blueprint cinder-v2-api-tests

Change-Id: I7cecbde9543c441a2f3478941f85625755aabf7f
Fix availability zone client in compute admin test

In /tempest/api/compute/admin/test_availability_zone.py file,
V3 test class use the V2 Availability Zone client.

This patch correct the client for V2 and V3 by instantiating the
correct one in base class.

Change-Id: I97903b1ea7faa02c5880c091a166e386295de0da
Replace the console output on Error with fault a message

Trying to get the console log from an ERROR-ed server
does not really works

The console log does not contains any meaningful info
related to most status changes,
it is just what the instance prints to the serial console.

Only one action is guest assisted: the 'soft reboot',
which automatically switched to 'hard reboot'
when the guest forgets to assist
(ie. does not shutdown in 120 sec)

Testing the console output presence before reporting
active state would make more sense.

Instead of attempting to get the serial console output,
after this change the response 'fault' field will be used
for exception detail when available.

Closes-Bug: #1332414

This reverts commit c1a3bbe37c6202562fad5ff1be6e818d12797aee.

Change-Id: I2018f98cdc4a1bc7dd8f34833df228dc56d88a95
Make unable to ping log messages appropriate level

The ping from an ssh connection checks in _check_remote_connectivity()
aren't necessarily expected to pass on the first attempt. However,
every time the ping was unsuccessful the method would log an
exception which is too severe a log for an expected error. This
commit uses a more appropriate log level for this case.

Change-Id: I8068fa85472259676acebd99b9d191065661e101
Add parametric tests of Swift object API, part 4

Add positive tests of Swift object "COPY" APIs from the viewpoint of
completeness of query parameters.

Change-Id: Iada4a9e00ce66dccd46993fd3edcc39c625c9022
Verify "get a server" API response attributes

Now most attributes of Nova v2/v3 APIs are not checked in Tempest,
and this patch adds some tests which check these attributes to block
the backward incompatibility change in the future.

This patch adds the checks of "get a server" API responses.

The response body of v2 API is the following:
  {
    "server": {
      "id": "c2f2ebe8-5a25-442b-83d2-9f0926a7a88a",
      "name": "vm01-v3",
      "status": "ACTIVE",
      "image": {
        "id": "b62655db-2ff7-4d7f-8821-d0a468a25bec",
        "links": [{"href": "http://[..]", "rel": "bookmark"}]
      },
      "flavor": {
        "id": "42",
        "links": [{"href": "http://[..]", "rel": "bookmark"}]
      },
      "user_id": "832ebd066fb0427ea77c4aab6bab5ec1",
      "tenant_id": "b8d8f3df596b482e93c4225b1d72d2c2",
      "created": "2014-03-13T00:40:21Z",
      "updated": "2014-03-13T00:40:31Z",
      "metadata": {},
      "links": [
        {"href": "http://[..]", "rel": "self"},
        {"href": "http://[..]", "rel": "bookmark"}
      ],
      "addresses": {
        "private": [{
          "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:5f:c3:0f",
          "version": 4, "addr": "10.0.0.5", "OS-EXT-IPS:type": "fixed"
        }]
      },
      "key_name": null,
      "hostId": "6efdef81d6341b7fac789263e366cdf3ed5136f5894db8a2b79d1bc7",
      "progress": 0,
      "OS-SRV-USG:launched_at": "2014-03-13T00:40:31.000000",
      "OS-SRV-USG:terminated_at": null,
      "OS-EXT-AZ:availability_zone": "nova",

      "OS-EXT-STS:task_state": null,
      "OS-EXT-STS:vm_state": "active",
      "OS-EXT-STS:power_state": 1,

      "OS-EXT-SRV-ATTR:host": "localhost-dev",
      "OS-EXT-SRV-ATTR:instance_name": "instance-0000004a",
      "OS-EXT-SRV-ATTR:hypervisor_hostname": "localhost-dev",

      "os-extended-volumes:volumes_attached": [],
      "accessIPv4": "",
      "accessIPv6": "",
      "config_drive": "",
      "OS-DCF:diskConfig": "MANUAL"
    }
  }

The one of v3 API is the following:
  {
    "server": {
      "id": "c2f2ebe8-5a25-442b-83d2-9f0926a7a88a",
      "name": "vm01-v3",
      "status": "ACTIVE",
      "image": {
        "id": "b62655db-2ff7-4d7f-8821-d0a468a25bec",
        "links": [{"href": "http://[..]", "rel": "bookmark"}]
      },
      "flavor": {
        "id": "42", "links": [{"href": "http://192.168.11.100:8774/flavors/42", "rel": "bookmark"}]
      },
      "user_id": "832ebd066fb0427ea77c4aab6bab5ec1",
      "tenant_id": "b8d8f3df596b482e93c4225b1d72d2c2",
      "created": "2014-03-13T00:40:21Z",
      "updated": "2014-03-13T00:40:31Z",
      "metadata": {},
      "links": [
        {"href": "http://[..]", "rel": "self"},
        {"href": "http://[..]", "rel": "bookmark"}
      ],
      "addresses": {
        "private": [{
          "version": 4, "type": "fixed",
          "addr": "10.0.0.5", "mac_addr": "fa:16:3e:5f:c3:0f"
        }]
      },
      "key_name": null,
      "host_id": "6efdef81d6341b7fac789263e366cdf3ed5136f5894db8a2b79d1bc7",
      "progress": 0,
      "os-server-usage:launched_at": "2014-03-13T00:40:31.000000",
      "os-server-usage:terminated_at": null,
      "os-extended-availability-zone:availability_zone": "nova",

      "os-extended-status:task_state": null,
      "os-extended-status:vm_state": "active",
      "os-extended-status:power_state": 1,
      "os-extended-status:locked_by": null,

      "os-extended-server-attributes:host": "localhost-dev",
      "os-extended-server-attributes:instance_name": "instance-0000004a",
      "os-extended-server-attributes:hypervisor_hostname": "localhost-dev",

      "os-extended-volumes:volumes_attached": [],
      "os-pci:pci_devices": [],
      "os-access-ips:access_ip_v4": "",
      "os-access-ips:access_ip_v6": "",
      "os-config-drive:config_drive": ""
    }
  }

Partially implements blueprint nova-api-attribute-test

Change-Id: I951eae22d694349ae734e1ea16f24f500af6a894
Add network service tag to compute tests

This commit adds the network service tag to all the compute api tests
that are using network services so that they're properly tagged.

Partially implements bp add-service-tags

Change-Id: I0b3436e4b3a2f1c2285a17718ecb8e413bc60269
Add querying for lists in ceilometer client

Resources, meters, alarms has query param in ceilometer API.
But current ceilometer client hasn't such ability.

Change-Id: I2d77b0a8d9d79aab7b9198ffb06b054b2fb87983