diff options
author | Mehdi Abaakouk <sileht@redhat.com> | 2017-04-25 14:31:00 +0200 |
---|---|---|
committer | Mehdi Abaakouk <sileht@redhat.com> | 2017-05-02 19:23:50 +0200 |
commit | 3aaba70c3ac6b57a6e0c1854fd223111c6d5f1ec (patch) | |
tree | c6c8a93f3545f43cfa749f2b7c4b326f2f892999 | |
parent | 27ac71bc5257f9eb453ff7fd5e903afe374cd04f (diff) | |
download | ceilometer-3aaba70c3ac6b57a6e0c1854fd223111c6d5f1ec.tar.gz |
tempest: Allow to configure granularity
Change-Id: I31344a9f8938ae9c7875cad76430508dd9fd4539
-rw-r--r-- | ceilometer/tests/integration/gabbi/gabbits-live/create_stack.json | 2 | ||||
-rw-r--r-- | ceilometer/tests/integration/gabbi/gabbits-live/update_stack.json | 2 | ||||
-rw-r--r-- | ceilometer/tests/tempest/config.py | 5 | ||||
-rw-r--r-- | ceilometer/tests/tempest/scenario/test_telemetry_integration.py | 1 | ||||
-rw-r--r-- | devstack/plugin.sh | 2 | ||||
-rw-r--r-- | devstack/settings | 3 |
6 files changed, 13 insertions, 2 deletions
diff --git a/ceilometer/tests/integration/gabbi/gabbits-live/create_stack.json b/ceilometer/tests/integration/gabbi/gabbits-live/create_stack.json index 91f7dafa..57a63664 100644 --- a/ceilometer/tests/integration/gabbi/gabbits-live/create_stack.json +++ b/ceilometer/tests/integration/gabbi/gabbits-live/create_stack.json @@ -44,7 +44,7 @@ "description": "Scale-up if the mean CPU > 10% on 1 minute", "metric": "cpu_util", "aggregation_method": "mean", - "granularity": 60, + "granularity": $ENVIRON["AODH_GRANULARITY"], "evaluation_periods": 1, "threshold": 10, "comparison_operator": "gt", diff --git a/ceilometer/tests/integration/gabbi/gabbits-live/update_stack.json b/ceilometer/tests/integration/gabbi/gabbits-live/update_stack.json index de0fce66..54f8e291 100644 --- a/ceilometer/tests/integration/gabbi/gabbits-live/update_stack.json +++ b/ceilometer/tests/integration/gabbi/gabbits-live/update_stack.json @@ -43,7 +43,7 @@ "description": "Scale-down if the mean CPU > 10% on 1 minute", "metric": "cpu_util", "aggregation_method": "mean", - "granularity": 60, + "granularity": $ENVIRON["AODH_GRANULARITY"], "evaluation_periods": 1, "threshold": 10, "comparison_operator": "gt", diff --git a/ceilometer/tests/tempest/config.py b/ceilometer/tests/tempest/config.py index 4125a7fd..0df195b1 100644 --- a/ceilometer/tests/tempest/config.py +++ b/ceilometer/tests/tempest/config.py @@ -47,4 +47,9 @@ TelemetryGroup = [ default=1, help="The seconds to sleep after an unsuccessful " "notification received."), + cfg.IntOpt('alarm_granularity', + default=300, + help="Granularity to use for aodh alarms. This must match the " + "configured Gnocchi archive policy") + ] diff --git a/ceilometer/tests/tempest/scenario/test_telemetry_integration.py b/ceilometer/tests/tempest/scenario/test_telemetry_integration.py index d2dec4b2..fecebae2 100644 --- a/ceilometer/tests/tempest/scenario/test_telemetry_integration.py +++ b/ceilometer/tests/tempest/scenario/test_telemetry_integration.py @@ -83,6 +83,7 @@ class TestTelemetryIntegration(manager.ScenarioTest): os.environ.update({ "ADMIN_TOKEN": auth[0], + "AODH_GRANULARITY": str(config.CONF.telemetry.alarm_granularity), "AODH_SERVICE_URL": self._get_endpoint(auth, "alarming_plugin"), "GNOCCHI_SERVICE_URL": self._get_endpoint(auth, "metric"), "PANKO_SERVICE_URL": self._get_endpoint(auth, "event"), diff --git a/devstack/plugin.sh b/devstack/plugin.sh index dc020902..8d4d9401 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -476,6 +476,8 @@ if is_service_enabled ceilometer; then init_ceilometer # Start the services start_ceilometer + elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then + iniset $TEMPEST_CONFIG telemetry alarm_granularity $CEILOMETER_ALARM_GRANULARITY fi if [[ "$1" == "unstack" ]]; then diff --git a/devstack/settings b/devstack/settings index f82513f2..b7299e2d 100644 --- a/devstack/settings +++ b/devstack/settings @@ -19,6 +19,9 @@ fi # Gnocchi default archive_policy for Ceilometer GNOCCHI_ARCHIVE_POLICY=${GNOCCHI_ARCHIVE_POLICY:-low} +# FIXME(sileht): put 300 by default to match the archive policy +# when the gate job have overrided this. +CEILOMETER_ALARM_GRANULARITY=${CEILOMETER_ALARM_GRANULARITY:-60} # Ceilometer connection info. CEILOMETER_SERVICE_PROTOCOL=http |