Commit Graph

196 Commits

Author SHA1 Message Date
Chandan Kumar 80b4f18e1e Remove bundled intree monasca-api tempest plugin
* https://review.openstack.org/#/c/526844/ move the intree
  bundled tempest plugin to a new repo monasca-tempest-plugin.
  Let's use it and remove the bundled tempest plugin from repo.

* Moved post_host script to main root directory
* Removed dummy gate_hook.sh script
* Fixed the jobs for the same

Story: 2001400
Task: 6085

Depends-On: I2ce2bd8238d44a451faeba9ddbfe27d900e9adef
Change-Id: I79cea368271bbef33914dba7b95f5546a1b8d3c1
2018-01-31 11:50:16 +05:30
Zuul dbb0fcb67c Merge "Statistics api failure when end time is not used" 2018-01-30 21:07:26 +00:00
James Gu 88d587a047 Statistics api failure when end time is not used
Statisics api fails when no end time is present with Casssandra.
Fixed the bug and added a test case with no end time.

Change-Id: I39fd349ab03877d4a67ec89a7859adf2707233f6
story: 2001461
task: 6175
2018-01-29 10:01:18 -08:00
Monasca CI 11b30ddb37 Fix Metric Statistics period call
Default InfluxDB behaviour is to return a timestamp with no value for
each time period requested. Since we remove those from the return value,
this behaviour breaks pagination because it thinks we hit the limit
but we returned nothing. With fill(none), Influx will not return a
timestamp for a period with no value, which fixes limit and pagination.

Change-Id: I81a7d3610541ef4b333b11e54136ad1cc516687a
Story: 2001457
Task: 6169
2018-01-17 09:54:17 +01:00
Witold Bedyk 2639d50b3a Replace iteritems() with items()
In process of Python 3 support implementation replacing dict.iteritems() with
dict.items().

Change-Id: Ida5caa4d9999daceb381d14659af6d3ba8d2c343
Story: 2000975
Task: 5948
2017-12-18 09:36:21 +01:00
James Gu ba43f07726 Add cassandra support
Support Cassandra db installation and Cassandra related
configurations for Monasca api and persister services
in devstack. Add Monasca rest API Cassandra plugin for
retrieving metric, dimension, measurement, statistics
and alarms.

Change-Id: Ie60d668692e1f25f555dda2355f4e513d582736c
story: 2001231
task: 5759
2017-12-15 19:11:00 +00:00
Witold Bedyk 594b94c7d6 Allow parentheses '()' in dimensions
Update tempest tests to allow parentheses in dimensions.
Update documentation.

Change-Id: Idceed9a6cf2deff2c60bc865dc6a8fb2d0640412
Story: 2001385
Task: 5960
2017-12-05 14:32:51 +00:00
Andrea Adams 8781a256f0 Adds tags for inhibit and silence
The new silence and inhibit rules will include tags on the alarm
that can be queried via the api. For more information and
documentation see: https://review.openstack.org/#/c/466403

Change-Id: I85b8bfc9338ee17709ec30aeb4b807b3bc12404e
2017-10-25 05:08:57 +00:00
Adrian Czarnecki cdc3acb279 Migrate to Zuul v3
Story: 2001238
Task: 5764
Task: 5765

Change-Id: I263b1a92a9ec7b5e38d9c1dc8b02e214102a92c2
Needed-By: I7bc913d0e5cd9e8a06a63cc3d11740056c7036d7
2017-10-24 04:16:44 +00:00
Dobroslaw Zybort c4db8adfca Fix TestAlarmsCount failure in tempest tests
This will fix following error:
RuntimeError: resource_cleanup for TestAlarmsCount did not call
the super's resource_cleanup.

Change-Id: I700285eb0b0408678b93431bcc3de47e67f28e75
2017-09-20 07:56:50 +02:00
Hangdong Zhang e2b5b3ed73 Update the documentation link for doc migration
Change-Id: I3f52e5253fdc967cc9a4f99343bd6f21e5a143eb
2017-07-21 10:54:21 +08:00
Vu Cong Tuan d4cb471d45 Replace assertEqual([], items) with assertEmpty(items)
Since assertEmpty() function has already been implemented in tempest,
let's use this function instead of generic assertEqual() function.
This change makes the code and the error messages to be more readable.
Therefore it improves maintainability a little bit.

Change-Id: I451d5f091f2103dd838da28afca7f3b9fe955d89
2017-06-13 10:02:47 +07:00
roland-hochmuth c8694aeff8 Remove xrange for run both Python 2 and Python 3
Change-Id: Ibf1b45fe27f1943265cdc36e99b7a53263885eb2
2017-05-31 08:51:43 +02:00
Kaiyan Sheng 03b5f34c99 Change to "monasca-read-only-user" for read only tests
"monasca-read-only-user" is a better name instead of "anotherrole"
for read only tempest tests. It's also set by default in
api-config.conf
Also change test.attr() to decorators.attr() in tempest tests
because of the deprecation warning.

Change-Id: I05427147e2755bdc6fde483a145258f6fb695356
2017-05-22 16:33:09 -06:00
Luong Anh Tuan c2176f12bf Replace test.attr with decorators.attr
Function 'tempest.test.attr()' has moved to 'tempest.lib.decorators
.attr()' in Pike and will be removed in a future version[1].
This patch replaces the 'tempest.test.attr()' with the 'tempest.lib
.decorators.attr().'

[1] Iaafbb112b6eee458089cc49918359a8a8d0485e2

Change-Id: I66562ad991b86bf3950a945541d7a5b6e0fd20a1
2017-05-19 16:39:21 +07:00
Dobroslaw Zybort 626c6c7826 Clean whitespaces in README and code indentation
Remove note about installing `nose` when not needed.

Change-Id: I2824f6ff89e72a5b3d80cb3cbfc8edf56dbabdcf
2017-05-15 12:49:38 +02:00
Artur Basiak e366823ac5 Mofidy tempest tests and WSGI_MODE for keystone
Keystone in default devstack installation runs as a uwsgi process
which isn't using ports 5000 and 35357. Instead it uses aliases bind
to default http port.
Set up keystone installation to runs as wsgi which uses default ports
that are used by monasca components.
Change tempest tests configuration to work with
keystone deployed in uwsgi mode.
Remove custom tempest.conf file. Using configure_auth_token_middleware
for monasca-api configuration file and use openrc to generate
environmental variables.

Story: 2000995
Task: 4173

Change-Id: I337609a471a8ee8e350e149df9e9d7924a730f57
2017-05-02 15:22:35 +02:00
Artur Basiak c7c3fba304 Use proper type for notification periods
Use int for valid_notification_periods to
have list of integers not list of strings.

Change-Id: I70f5aab2eb4956167b507960d6be441827355720
2017-04-10 12:52:07 +02:00
Shinya Kawabata e8831f8229 Add multibyte character support for alarm definition
It was failed that putting multibyte character into
alarm definition name and description by monascaclient.
There were some mistakes about treatment of utf8 encoding.
And mysql connection had no utf8 option, so mysql could not
handle multibyte character.

Change-Id: I8743f89fcc5d5efd4e50f440b76d78abc037e8e7
2017-03-14 15:24:00 +01:00
Jenkins efb66441e5 Merge "Bugfix: Forbid colon in dimension name" 2017-03-11 16:41:30 +00:00
Kamil Choroba dcd65110df Bugfix: Forbid colon in dimension name
Monasca-Agent http_check plugin creates
dimensions which contain multiple colon:
url:http://192.168.10.4:5601

This bugfix makes it possible to query for
metrics with such dimensions. Until now an
exception was thrown.

Closes-Bug: 1668937
Change-Id: I39ed6fba99491630f6a7e0c67743b807e3529461
2017-03-10 13:35:04 +01:00
Ken'ichi Ohmichi 6cf77ebc2d Switch to use stable data_utils
Tempest provides stable library interfaces under tempest.lib.
This patch switches to use it for data_utils.

Change-Id: I4e7de66b522ba11e1d895728d52757ca0bd19305
2017-03-07 14:49:21 -08:00
Craig Bryant 55dab3b887 Fix alarm-list from CLI failing if multiple sort-by
If you run the command: monasca alarm-list  --sort-by severity,state
It fails with: "Unprocessable Entity" complaining that 'name,state'
is not a valid sort_by field. It is treating the comma separated
list as a single entry.

Fix by doing a split using ',' if the sort_by field is a string.

Created a tempest test that showed the problem

Change-Id: I68ce80ccea8493f5980e4d95929a38e587464949
2017-02-16 07:45:53 -07:00
Jenkins cf6be5d8c4 Merge "Fix alarm_count with multiple group_by fields from CLI" 2017-02-13 11:15:31 +00:00
Jenkins baf32f7656 Merge "Fix alarm count failing with metric name" 2017-02-09 18:52:24 +00:00
Jenkins c5d3e5839c Merge "Add Tempest tests for invalid IDs and fix potential 500 errors" 2017-02-09 14:09:33 +00:00
Craig Bryant 990ecb84da Fix alarm_count with multiple group_by fields from CLI
CLI sends multiple group_by fields with ',' as a separator, but the
',' gets urlencoded. Falcon then treats the group_by parameter
as a string instead of a list so 'state,severity' was treated as a
single value and failed validation. The fix was to do a split using ','.
The tempest tests did not urlencode the ',' so Falcon treated
group_by as a list and the tests succeeded even though the
same test through the CLI would fail.

Created tempest test that shows the failure and that it now works

Change-Id: Ice01df6e66c6b019270fed27de08de8ee713114f
2017-02-07 14:11:47 -07:00
Craig Bryant 8f31008ec5 Fix alarm count failing with metric name
Created a tempest test that showed that alarm-count with metric-name failed
with a 500.

Fixed the sqla implementation of get_alarms_count(). Not sure how it
happened, but the code for querying by metric-name was all wrong.
Replaced bad code with code from get_alarms() for handling the metric-name.

Also, add test for count alarms by state and refactor some tests to remove
duplicate code

Change-Id: I7ecb896fd6594fa11c5f2029bec44f09ef413637
2017-02-07 10:48:14 -07:00
Tomasz Trębski 10c19b6f6f [PEP8] Extended code analysis
Following commits makes tempests code
compliant with PEP8 rules

Change-Id: I08e0a001c3fd56201db71babc894a18d63706895
2017-02-02 09:43:10 +01:00
Craig Bryant b303044ebd Add Tempest tests for invalid IDs and fix potential 500 errors
Add tests that an invalid ID returns 404 for update, patch and delete
methods for alarms, alarm definitions and notification methods.  Some
of these tests already existed but this ensures a complete set of
tests exists for these cases.

Move the resource try catch block wrapper to the correct layer
so that it catches all potential Internal Server Errors and throws
the proper exception.

Change-Id: I07159d0eaed995518bb0c0e2fbf446dff65ec632
2017-01-26 09:59:08 -07:00
Craig Bryant 65aefd7772 Allow lower case for queries with state and severity
Add tests to validate. Change some tempest tests to validate.

Change-Id: I92bcf8fc8f1605dcf3a291b3fd224d930f96b1f0
2017-01-24 21:19:58 -07:00
Shinya Kawabata 4119917bb4 Change offset of list notification to integer instead of id
And add sortBy function to list notification of Hibernate ORM.

Change-Id: I112725c0e2ef6ceceb2d7be31ed36defa9d77d50
2017-01-17 09:52:11 +09:00
Jenkins 2e186162cd Merge "Fix list metric for other tenants" 2017-01-13 00:05:10 +00:00
Michael James Hoppal 5c69fcaa13 Add tests for invalid webhook and email addresses
This includes passing the type as not all upper case

Change-Id: I9d4690dc01bd3e911743f558cf2536222c944fcc
2017-01-10 14:30:22 -07:00
liyingjun f13d38a317 Fix list metric for other tenants
1. Use get_x_tenant_or_tenant_id instead of get_tenant_id in list
metrics api.
2. Add missing delegateAuthorizedRole config to devstack api-config.yml

Change-Id: I18c0dd340a4ac8b016e761d648d9f03923b070bc
Closes-bug: #1613997
2017-01-10 09:42:21 +08:00
liyingjun 43f4a029c9 Replace deprecated identity options for tempest
The admin_* options in identity group are deprecated:
https://github.com/openstack/tempest/blob/master/tempest/config.py#L92-L114

Change-Id: I9c82e9d8c1f7db088a4b99ee82d8b2b3840364d4
Closes-bug: #1649174
2017-01-09 19:14:19 +00:00
Craig Bryant 989c1df7cc Fix the Monasca API tempest tests
The Tempest Manager class must have changed and the service
argument apparently no longer exists. Instead, it was being set
as the scope which caused the catalog to not be retrieved

Change-Id: If934bac4e2cd833fe4e381c373218383354969ec
2017-01-05 16:38:02 -07:00
Jenkins 784ea2d3ab Merge "Stop adding ServiceAvailable group option" 2017-01-03 21:03:28 +00:00
Roland Hochmuth 88cbf6b44b Add support for InfluxDB 0.11.0 to 1.1.0 in the Python API
In InfluxDB version 0.11.0 the result set for SHOW SERIES changed. See

https://github.com/influxdata/influxdb/blob/master/CHANGELOG.md#v0110-2016-03-22

Modifed the code to be compatible with either the old or new result
set.

In InfluxDB version 1.0.0 the config file changed. See

https://github.com/influxdata/influxdb/blob/master/CHANGELOG.md#v100-2016-09-08

Modified the config file deployed by DevStack to be compatible with either the
old or new config file.

In some other InfluxDB release several database ops, such as CREATE
DATABASE, were modified from http GET to POST. Modified how databases
are created in the DevStack plugin.sh.

Change-Id: I33188f4e64150d2cb24c0a06979c06f03c803da4
2016-12-08 06:54:54 -07:00
Kaiyan Sheng db4e0d9118 Fix readme about how to run tempest tests in devstack
Change-Id: Ie7ebabb9dff704769235d5d872869f9b59ae32c2
2016-12-02 15:34:09 -07:00
Jenkins 5b768645d2 Merge "Change assertTrue(isinstance()) by optimal assert" 2016-11-11 22:05:58 +00:00
Ryan Brandt ed49d1062a Add group by multiple dimensions
Added influx group by for multiple dimensions
Added vertica group by for multiple dimensions
Added tempest tests for group by with one, multiple, and all dimensions

Change-Id: I69c27198ab180e17b7636bbd0f26fc1bd5292f3b
2016-11-02 09:48:56 -06:00
Ryan Brandt 5c4e209a81 Add python multiple metrics for measurement and statistics
Adjusted java influx code to override merge with group_by

Change-Id: I34ca2ae516e8945d92723a2165bef34e59d5053c
2016-10-25 14:07:18 -06:00
Jenkins 62f2380731 Merge "Remove 'fill(0)' and fix influx time offset" 2016-10-22 01:59:45 +00:00
Ryan Brandt 8b6e235a40 Add support for 'last' function
Added documentation for last function
Added python parsing for last function
Added tempest tests for last_value function

Change-Id: I4c35321e23e13596a2ef02e7e57306d5685c81ec
Depends-On: Ib5123ed035018757a50d9ebeb7335fbca48054f2
Implements: Blueprint last-value
2016-10-12 03:51:13 +00:00
Kaiyan Sheng f26c427b4b Add metrics/dimensions/names into monasca-api
This endpoint will return all the dimension names for a given metric
name.
Added dimension-names for influx in python api and java api
Added dimension-names for vertica in java api

Depends-On: Id981dafd00778a6d4a376b9ceab011231e94c0c6
Change-Id: I0192ccb9276ea94103a477bd2ad7d10f21e64d31
Implements: blueprint dimensions-api
2016-10-07 15:25:36 -06:00
Jenkins e7a7732446 Merge "Remove id from monasca metric name list" 2016-10-07 21:13:59 +00:00
pallavi 4a6c220115 Stop adding ServiceAvailable group option
Service available group already exists.Therefore we don't need to
register this group here again.

Change-Id: Ia02b23afebe0e41a197a34dccefb0a7f564a057f
Closes-Bug: #1621036
2016-10-07 07:23:06 +00:00
Kaiyan Sheng 55549ff54c Remove id from monasca metric name list
Since returned metric names are distinct, we can remove the id from
each element. Also change the returned metric name into alphabetical
order.

Change-Id: Id981dafd00778a6d4a376b9ceab011231e94c0c6
2016-10-05 14:32:22 -06:00
Jenkins e9894cb429 Merge "TrivialFix: Using assertEqual instead of assertEquals" 2016-10-05 13:03:27 +00:00