Minor fixes in Ceilometer benchmark scenarios
1. Renames ceilometer.py to alarms.py as it contains scenarios for alarms only. 2. Complete a TODO to use self._generate_random_name Change-Id: I536e0ebd20f8dc56e31a75f117994c3abe4c9f2d Closes-Bug: #1323629
This commit is contained in:
parent
3353933ef5
commit
7d461b19ed
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"CeilometerBasic.create_alarm": [
|
"CeilometerAlarms.create_alarm": [
|
||||||
{
|
{
|
||||||
"args": {
|
"args": {
|
||||||
"meter_name": "ram_util",
|
"meter_name": "ram_util",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
CeilometerBasic.create_alarm:
|
CeilometerAlarms.create_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"CeilometerBasic.create_and_delete_alarm": [
|
"CeilometerAlarms.create_and_delete_alarm": [
|
||||||
{
|
{
|
||||||
"args": {
|
"args": {
|
||||||
"meter_name": "ram_util",
|
"meter_name": "ram_util",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
CeilometerBasic.create_and_delete_alarm:
|
CeilometerAlarms.create_and_delete_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"CeilometerBasic.create_and_list_alarm": [
|
"CeilometerAlarms.create_and_list_alarm": [
|
||||||
{
|
{
|
||||||
"args": {
|
"args": {
|
||||||
"meter_name": "ram_util",
|
"meter_name": "ram_util",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
CeilometerBasic.create_and_list_alarm:
|
CeilometerAlarms.create_and_list_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"CeilometerBasic.create_and_update_alarm": [
|
"CeilometerAlarms.create_and_update_alarm": [
|
||||||
{
|
{
|
||||||
"args": {
|
"args": {
|
||||||
"meter_name": "ram_util",
|
"meter_name": "ram_util",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
CeilometerBasic.create_and_update_alarm:
|
CeilometerAlarms.create_and_update_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"CeilometerBasic.list_alarms": [
|
"CeilometerAlarms.list_alarms": [
|
||||||
{
|
{
|
||||||
"runner":{
|
"runner":{
|
||||||
"type": "constant",
|
"type": "constant",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
CeilometerBasic.list_alarms:
|
CeilometerAlarms.list_alarms:
|
||||||
-
|
-
|
||||||
runner:
|
runner:
|
||||||
type: "constant"
|
type: "constant"
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
times: 10
|
times: 10
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
|
|
||||||
CeilometerBasic.create_alarm:
|
CeilometerAlarms.create_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
@ -32,7 +32,7 @@
|
|||||||
times: 10
|
times: 10
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
|
|
||||||
CeilometerBasic.create_and_delete_alarm:
|
CeilometerAlarms.create_and_delete_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
@ -47,7 +47,7 @@
|
|||||||
times: 10
|
times: 10
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
|
|
||||||
CeilometerBasic.create_and_list_alarm:
|
CeilometerAlarms.create_and_list_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
@ -62,7 +62,7 @@
|
|||||||
times: 10
|
times: 10
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
|
|
||||||
CeilometerBasic.create_and_update_alarm:
|
CeilometerAlarms.create_and_update_alarm:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
meter_name: "ram_util"
|
meter_name: "ram_util"
|
||||||
@ -77,7 +77,7 @@
|
|||||||
times: 10
|
times: 10
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
|
|
||||||
CeilometerBasic.list_alarms:
|
CeilometerAlarms.list_alarms:
|
||||||
-
|
-
|
||||||
runner:
|
runner:
|
||||||
type: "constant"
|
type: "constant"
|
||||||
|
@ -16,7 +16,7 @@ from rally.benchmark.scenarios import base
|
|||||||
from rally.benchmark.scenarios.ceilometer import utils as ceilometerutils
|
from rally.benchmark.scenarios.ceilometer import utils as ceilometerutils
|
||||||
|
|
||||||
|
|
||||||
class CeilometerBasic(ceilometerutils.CeilometerScenario):
|
class CeilometerAlarms(ceilometerutils.CeilometerScenario):
|
||||||
@base.scenario(context={"cleanup": ["ceilometer"]})
|
@base.scenario(context={"cleanup": ["ceilometer"]})
|
||||||
def create_alarm(self, meter_name, threshold, **kwargs):
|
def create_alarm(self, meter_name, threshold, **kwargs):
|
||||||
"""Test creating an alarm.
|
"""Test creating an alarm.
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from rally.benchmark.scenarios import base
|
from rally.benchmark.scenarios import base
|
||||||
from rally.benchmark.scenarios import utils as scenario_utils
|
from rally.benchmark.scenarios import utils as scenario_utils
|
||||||
|
|
||||||
@ -27,11 +25,9 @@ class CeilometerScenario(base.Scenario):
|
|||||||
:param kwargs: optional parameters to create alarm
|
:param kwargs: optional parameters to create alarm
|
||||||
:returns: alarm dictionary used to create an alarm
|
:returns: alarm dictionary used to create an alarm
|
||||||
"""
|
"""
|
||||||
# TODO(Aswad): Reuse _generate_random_name from base.Scenario instead
|
alarm_id = self._generate_random_name()
|
||||||
# of generating alarm_uuid. Ref: bp/benchmark-scenarios-for-neutron.
|
alarm = {"alarm_id": alarm_id,
|
||||||
alarm_uuid = str(uuid.uuid4())
|
"name": "TestAlarm-%s" % alarm_id,
|
||||||
alarm = {"alarm_id": alarm_uuid,
|
|
||||||
"name": "TestAlarm-%s" % alarm_uuid,
|
|
||||||
"description": "Test Alarm"}
|
"description": "Test Alarm"}
|
||||||
|
|
||||||
alarm.update(kwargs)
|
alarm.update(kwargs)
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from rally.benchmark.scenarios.ceilometer import ceilometer
|
from rally.benchmark.scenarios.ceilometer import alarms
|
||||||
from tests import test
|
from tests import test
|
||||||
|
|
||||||
|
|
||||||
class CeilometerBasicTestCase(test.TestCase):
|
class CeilometerAlarmsTestCase(test.TestCase):
|
||||||
def test_create_alarm(self):
|
def test_create_alarm(self):
|
||||||
scenario = ceilometer.CeilometerBasic()
|
scenario = alarms.CeilometerAlarms()
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock()
|
scenario._create_alarm = mock.MagicMock()
|
||||||
scenario.create_alarm("fake_meter_name",
|
scenario.create_alarm("fake_meter_name",
|
||||||
@ -31,7 +31,7 @@ class CeilometerBasicTestCase(test.TestCase):
|
|||||||
{'fakearg': 'f'})
|
{'fakearg': 'f'})
|
||||||
|
|
||||||
def test_list_alarm(self):
|
def test_list_alarm(self):
|
||||||
scenario = ceilometer.CeilometerBasic()
|
scenario = alarms.CeilometerAlarms()
|
||||||
|
|
||||||
scenario._list_alarms = mock.MagicMock()
|
scenario._list_alarms = mock.MagicMock()
|
||||||
scenario.list_alarms()
|
scenario.list_alarms()
|
||||||
@ -39,7 +39,7 @@ class CeilometerBasicTestCase(test.TestCase):
|
|||||||
|
|
||||||
def test_create_and_list_alarm(self):
|
def test_create_and_list_alarm(self):
|
||||||
fake_alarm = mock.MagicMock()
|
fake_alarm = mock.MagicMock()
|
||||||
scenario = ceilometer.CeilometerBasic()
|
scenario = alarms.CeilometerAlarms()
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
||||||
scenario._list_alarms = mock.MagicMock()
|
scenario._list_alarms = mock.MagicMock()
|
||||||
@ -54,7 +54,7 @@ class CeilometerBasicTestCase(test.TestCase):
|
|||||||
def test_create_and_update_alarm(self):
|
def test_create_and_update_alarm(self):
|
||||||
fake_alram_dict_diff = {'description': 'Changed Test Description'}
|
fake_alram_dict_diff = {'description': 'Changed Test Description'}
|
||||||
fake_alarm = mock.MagicMock()
|
fake_alarm = mock.MagicMock()
|
||||||
scenario = ceilometer.CeilometerBasic()
|
scenario = alarms.CeilometerAlarms()
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
||||||
scenario._update_alarm = mock.MagicMock()
|
scenario._update_alarm = mock.MagicMock()
|
||||||
@ -69,7 +69,7 @@ class CeilometerBasicTestCase(test.TestCase):
|
|||||||
|
|
||||||
def test_create_and_delete_alarm(self):
|
def test_create_and_delete_alarm(self):
|
||||||
fake_alarm = mock.MagicMock()
|
fake_alarm = mock.MagicMock()
|
||||||
scenario = ceilometer.CeilometerBasic()
|
scenario = alarms.CeilometerAlarms()
|
||||||
|
|
||||||
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
scenario._create_alarm = mock.MagicMock(return_value=fake_alarm)
|
||||||
scenario._delete_alarm = mock.MagicMock()
|
scenario._delete_alarm = mock.MagicMock()
|
Loading…
Reference in New Issue
Block a user