[openstack] Remove nova hosts specific logic
os-hosts CLIs and python API bindings had been deprecated from python-novaclient 9.0.0 and finally became removed in 10.0.0 release. The related scenarios become redundant. We cannot launch then in gates and it is impossible to ensure that they work even with old novaclient release. Since it is not something critical and what is called regulary in old OpenStack environments we should not provide any workaround and can just remove the os-hosts logic from Rally. [*] https://github.com/openstack/python-novaclient/blob/master/releasenotes/notes/remove-hosts-d08855550c40b9c6.yaml Change-Id: I915983dbc634dafcab1cc54dba7bae8d4e368884
This commit is contained in:
parent
6849d25036
commit
1efddbd5ba
@ -924,26 +924,6 @@
|
||||
constant:
|
||||
concurrency: 2
|
||||
times: 4
|
||||
-
|
||||
title: NovaHosts.list_hosts tests
|
||||
scenario:
|
||||
NovaHosts.list_hosts: {}
|
||||
runner:
|
||||
constant:
|
||||
concurrency: 2
|
||||
times: 4
|
||||
-
|
||||
title: NovaHosts.list_and_get_hosts tests
|
||||
scenario:
|
||||
NovaHosts.list_and_get_hosts: {}
|
||||
runner:
|
||||
constant:
|
||||
concurrency: 2
|
||||
times: 4
|
||||
contexts:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
-
|
||||
title: NovaServices.list_services tests
|
||||
scenario:
|
||||
|
@ -1,60 +0,0 @@
|
||||
# Copyright 2016 IBM Corp
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rally import consts
|
||||
from rally.task import validation
|
||||
|
||||
from rally_openstack import scenario
|
||||
from rally_openstack.scenarios.nova import utils
|
||||
|
||||
|
||||
"""Scenarios for Nova hosts."""
|
||||
|
||||
|
||||
@validation.add("required_services", services=[consts.Service.NOVA])
|
||||
@validation.add("required_platform", platform="openstack", admin=True)
|
||||
@scenario.configure(name="NovaHosts.list_hosts", platform="openstack")
|
||||
class ListHosts(utils.NovaScenario):
|
||||
|
||||
def run(self, zone=None):
|
||||
"""List all nova hosts.
|
||||
|
||||
Measure the "nova host-list" command performance.
|
||||
|
||||
:param zone: List nova hosts in an availability-zone.
|
||||
None (default value) means list hosts in all
|
||||
availability-zones
|
||||
"""
|
||||
self._list_hosts(zone)
|
||||
|
||||
|
||||
@validation.add("required_services", services=[consts.Service.NOVA])
|
||||
@validation.add("required_platform", platform="openstack", admin=True)
|
||||
@scenario.configure(name="NovaHosts.list_and_get_hosts", platform="openstack")
|
||||
class ListAndGetHosts(utils.NovaScenario):
|
||||
|
||||
def run(self, zone=None):
|
||||
"""List all nova hosts, and get detailed information for compute hosts.
|
||||
|
||||
Measure the "nova host-describe" command performance.
|
||||
|
||||
:param zone: List nova hosts in an availability-zone.
|
||||
None (default value) means list hosts in all
|
||||
availability-zones
|
||||
"""
|
||||
hosts = self._list_hosts(zone, service="compute")
|
||||
|
||||
for host in hosts:
|
||||
self._get_host(host.host_name)
|
@ -916,19 +916,6 @@ class NovaScenario(scenario.OpenStackScenario):
|
||||
"""
|
||||
return self.admin_clients("nova").availability_zones.list(detailed)
|
||||
|
||||
@atomic.action_timer("nova.list_hosts")
|
||||
def _list_hosts(self, zone=None, service=None):
|
||||
"""List nova hosts.
|
||||
|
||||
:param zone: List all hosts in the given nova availability-zone ID
|
||||
:param service: Name of service type to filter
|
||||
:returns: Nova host list
|
||||
"""
|
||||
hosts = self.admin_clients("nova").hosts.list(zone)
|
||||
if service:
|
||||
hosts = [host for host in hosts if host.service == service]
|
||||
return hosts
|
||||
|
||||
@atomic.action_timer("nova.list_interfaces")
|
||||
def _list_interfaces(self, server):
|
||||
"""List interfaces attached to a server.
|
||||
@ -938,15 +925,6 @@ class NovaScenario(scenario.OpenStackScenario):
|
||||
"""
|
||||
return self.clients("nova").servers.interface_list(server)
|
||||
|
||||
@atomic.action_timer("nova.get_host")
|
||||
def _get_host(self, host_name):
|
||||
"""Describe a specific host.
|
||||
|
||||
:param host_name: host name to get.
|
||||
:returns: host object
|
||||
"""
|
||||
return self.admin_clients("nova").hosts.get(host_name)
|
||||
|
||||
@atomic.action_timer("nova.list_services")
|
||||
def _list_services(self, host=None, binary=None):
|
||||
"""return all nova service details
|
||||
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"NovaHosts.list_and_get_hosts": [
|
||||
{
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"concurrency": 2,
|
||||
"times": 10
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 2,
|
||||
"users_per_tenant": 2
|
||||
}
|
||||
},
|
||||
"sla": {
|
||||
"failure_rate": {
|
||||
"max": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
---
|
||||
NovaHosts.list_and_get_hosts:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
concurrency: 2
|
||||
times: 10
|
||||
context:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"NovaHosts.list_hosts": [
|
||||
{
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"concurrency": 2,
|
||||
"times": 10
|
||||
},
|
||||
"sla": {
|
||||
"failure_rate": {
|
||||
"max": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
---
|
||||
NovaHosts.list_hosts:
|
||||
-
|
||||
runner:
|
||||
type: "constant"
|
||||
concurrency: 2
|
||||
times: 10
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
@ -168,9 +168,6 @@ class Nova(ResourceManager):
|
||||
def list_aggregates(self):
|
||||
return self.client.aggregates.list()
|
||||
|
||||
def list_hosts(self):
|
||||
return self.client.hosts.list()
|
||||
|
||||
def list_hypervisors(self):
|
||||
return self.client.hypervisors.list()
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
# Copyright 2016 IBM Corp.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
|
||||
from rally_openstack.scenarios.nova import hosts
|
||||
from tests.unit import test
|
||||
|
||||
|
||||
class NovaHostsTestCase(test.TestCase):
|
||||
|
||||
def test_list_hosts(self):
|
||||
scenario = hosts.ListHosts()
|
||||
scenario._list_hosts = mock.Mock()
|
||||
scenario.run(zone=None)
|
||||
scenario._list_hosts.assert_called_once_with(None)
|
||||
|
||||
def test_list_and_get_hosts(self):
|
||||
fake_hosts = [mock.Mock(host_name="fake_hostname")]
|
||||
scenario = hosts.ListAndGetHosts()
|
||||
scenario._list_hosts = mock.create_autospec(scenario._list_hosts,
|
||||
return_value=fake_hosts)
|
||||
scenario._get_host = mock.create_autospec(scenario._get_host,
|
||||
"fake_hostname")
|
||||
scenario.run(zone="nova")
|
||||
|
||||
scenario._list_hosts.assert_called_once_with("nova", service="compute")
|
||||
scenario._get_host.assert_called_once_with(
|
||||
"fake_hostname")
|
@ -836,17 +836,6 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
|
||||
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
|
||||
"nova.search_hypervisors")
|
||||
|
||||
def test__get_host(self):
|
||||
nova_scenario = utils.NovaScenario()
|
||||
result = nova_scenario._get_host("host_name")
|
||||
self.assertEqual(
|
||||
self.admin_clients("nova").hosts.get.return_value,
|
||||
result)
|
||||
self.admin_clients("nova").hosts.get.assert_called_once_with(
|
||||
"host_name")
|
||||
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
|
||||
"nova.get_host")
|
||||
|
||||
def test__list_interfaces(self):
|
||||
nova_scenario = utils.NovaScenario()
|
||||
result = nova_scenario._list_interfaces("server")
|
||||
@ -948,26 +937,6 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
|
||||
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
|
||||
"nova.list_availability_zones")
|
||||
|
||||
@ddt.data({},
|
||||
{"zone": "foo_zone"},
|
||||
{"zone": "foo_zone", "service": "some"})
|
||||
@ddt.unpack
|
||||
def test__list_hosts(self, zone=None, service=None):
|
||||
|
||||
hosts = [mock.Mock(service="foo"), mock.Mock(service="some")]
|
||||
|
||||
self.admin_clients("nova").hosts.list.return_value = hosts
|
||||
nova_scenario = utils.NovaScenario()
|
||||
|
||||
result = nova_scenario._list_hosts(zone, service=service)
|
||||
|
||||
if service:
|
||||
hosts = [h for h in hosts if h.service == service]
|
||||
self.assertEqual(hosts, result)
|
||||
self.admin_clients("nova").hosts.list.assert_called_once_with(zone)
|
||||
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
|
||||
"nova.list_hosts")
|
||||
|
||||
@ddt.data({},
|
||||
{"host": "foo_host"},
|
||||
{"binary": "foo_binary"},
|
||||
|
Loading…
Reference in New Issue
Block a user