Commit Graph

232 Commits

Author SHA1 Message Date
Martin Chacon Piza 69bb2483ea Rename tenant_id with project_id
Since oslo.context=4.0.0 Feb 3, 2022  the deprecated argument
tenant was removed [1]

[1] f4cbe4c296

Change-Id: I710a19e14c795b4c74b7a772fbd80809c9777639
2022-04-02 22:33:54 +02:00
wangzihao a46fb59245 Remove six
Remove six Replace the following items with Python 3 style code.
- six.PY3
- six.moves.urllib.parse
- six.text_type

Story: 2008305
Task: 41363
Change-Id: I864492ffcd05edf8bb803bf9fbe6c599617e749b
2020-12-07 11:03:02 +08:00
Doug Szumski 4e5cab3fb8 Improve configurability of Tempest tests
Adds basic support for configuring various parts of the tests to
make it easier to use them in environments which are configured
differently to DevStack. Specifically in this case the motivation
is to run the Monasca Tempest tests in Kolla CI.

This should be a NOOP change for existing environments.

Change-Id: If6be3a4d54a7b10c3ff40f9ed34045c50ffc3bae
2020-07-30 09:46:33 +00:00
Zuul dee5cc6388 Merge "Update hacking for Python3" 2020-04-23 10:53:26 +00:00
Doug Szumski 764b024eb7 Remove non-zero period negative tests
By allowing all notification types to support periodic notifications
these tests are no longer required. After this feature has been merged,
some tests could be added back to prevent regressions in the new
behaviour.

Depends-On: https://review.opendev.org/719989
Change-Id: I18a27800b8c1b28ab224375b42c57ac6a0f7ae78
Story: 2006837
Task: 37421
2020-04-18 13:12:53 +02:00
Andreas Jaeger 1ddfa88fec Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

The tempest plugin is used on older branches as well.
We really only need hacking on master anyways,
where we no longer support python 2, so here we
make the requirement specific to python 3.

Change-Id: I39f95e4ce193c1435c4901825bed949cdaaba72e
2020-04-04 09:25:09 +02:00
Arseni Lipinski 6f2f401bd5 Change headers in requests to Kibana
This is related to changed behavior in newer Kibana versions.

Story: 2006376
Task: 36165

Change-Id: I2d25afe3ad4e29efa540381450ba71405f36ff5c
2020-01-17 16:26:11 +00:00
Adrian Czarnecki 0b4183c018 Fix test_should_reject_if_wrong_content_type test
Adjust test to proper handle response from new unified api when wrong content type

Change-Id: I4bcd3abdc188e58db758b6e3250954d6c4d3b254
2019-10-23 09:52:03 +00:00
Bharat Kunwar 9734af4fe8 Support time range to query dimension names/values
At present, dimensions are not scoped by time window, which makes
dimension related queries to large databases timeout because it searches
all of time instead of a time window specified on the grafana app.

This commit adds tempest tests to accompany the changes to the API
server and as such, depends on it.

Depends-On: https://review.opendev.org/#/c/670318/
Change-Id: Ibc5378deea51a18ed7dac857b26d770950b17620
Story: 2006204
Task: 35805
2019-07-29 13:45:20 +01:00
Zuul cc0581fcab Merge "Use unicode literals in test_metrics" 2019-07-10 18:54:34 +00:00
poothia 15857dfe91 Update hacking version to 1.1.x
This commit updates hacking version in test-requirements

Change-Id: If88575d4fdb16b2f5f4acc71f750414e4ce423fb
Story: 2004930
Task: 35690
2019-07-05 15:14:53 +05:30
Witek Bedyk ffd5317158 Use unicode literals in test_metrics
The change unifies the usage of text string literals in the package and
declares them as unicode. It simplifies comparing test values with
actual results across Python 2 and 3 deployments. It also fixes the bug
described in the user story.

Change-Id: I87c38faf41f7c1bff72d45d238a6f38751fad483
Story: 2005841
Task: 33613
2019-07-03 10:57:13 +02:00
zhulingjie f90c73911d Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I10f155c316dc77b69dcbbc387f3edf59ed84b5dd
2019-06-14 14:09:25 +00:00
Ethan Apodaca 46a97d9c52 Update alarms count tests
Updates alarms count test for multiple metric dimension values.

Change-Id: Idd2b5b66700a3c1234b22fad98020e31369f60f3
Story: 2005311
Task: 30278
2019-04-08 19:15:02 +00:00
Adrian Czarnecki f1d457fc79 Add tests for events
Story: 2004549
Task: 28302
Change-Id: Id505116637ac66de349962c9f804ddaa14601475
2019-03-04 12:46:09 +00:00
Zuul fa5f826138 Merge "Make rejectable_message_size configurable for log-api tests" 2019-02-26 14:16:38 +00:00
Thomas Bechtold 2bb88453ed Recognize config options from [service_available]
Currently, settings in [service_available] for Monasca in tempest.conf
do not have any effect. That can lead to the situation where the
monasca-tempest-plugin is installed but monasca is not configured
which results in all monasca tempest tests failing.
With this patch, setting:

- [service_available]monasca
- [service_available]logs
- [service_available]logs-search

to "False" will skip all available tests for monasca.
If only monasca-api is available (no monasca-log-api and/or
elasticsearch), [service_available]monasca can be set to "True" and
the other 2 options ("logs" and "logs-search") to "False" so only the
monasca-api tempest tests are executed.

Depends-On: https://review.openstack.org/634308
Change-Id: I1f0cbb95765ae5fc6dca0da7af8ab56d2daf9a7f
Story: 2004917
Task: 29277
2019-02-11 05:41:22 +00:00
Thomas Bechtold 2bbd16e46d Make rejectable_message_size configurable for log-api tests
When setting [service]max_log_size in the monasca-log-api
configuration to a value larger than the default (which is 1 MB
currently), the following tempest tests fail:

- monasca_tempest_tests.tests.log_api.test_constraints.\
  TestLogApiConstraints.test_should_reject_too_big_message
- monasca_tempest_tests.tests.log_api.test_constraints.\
  TestLogApiConstraints.test_should_reject_too_big_message_multiline

This happens because the tempest tests assume that the maximum log
size is 1 MB but that is not always the case because
[service]max_log_size can be increased to a larger value.

So add a new configuration option in tempest.conf under the
[monitoring] section to be able to set the maximum log size. This
option (called "log_api_max_log_size") should be set to the same value
than [service]max_log_size in the monasca-log-api configuration file.

Depends-On: https://review.openstack.org/#/c/634308/
Change-Id: I893c66fd640017e6cc94298207d771a3ac3b8053
Story: 2004944
Task: 29346
2019-02-06 10:04:52 +01:00
Thomas Bechtold aadc24ea03 Mark some basic tests as smoke tests
When running tempest with "tempest run -s", only tests that are tagged
as "smoke" tests are executed.
It's useful to also run a couple of monasca tests during a smoke run
to confirm that at least the basic functions are working.

Change-Id: Iffb4148fd93577809260e1e926f46c8c4cdcdcb9
Story: #2004700
Task: # 28721
2019-01-04 15:13:57 +01:00
Adrian Czarnecki f983593efb Make log test compatible with python3
Change-Id: If273926c84b5025e13e31a833599bf7252f1f8ee
2018-08-22 06:46:35 +00:00
Adrian Czarnecki 33bc7a08c0 Make metrics test compatible with python3
Story: 2000975
Task: 24396

Change-Id: I18094bed65d7de763d9bfd05ce2e7f4be5f2ee91
2018-08-08 12:24:07 +00:00
Zuul 41e082b214 Merge "Initialize alarm in test_alarm_metric_mixcase" 2018-07-11 13:14:24 +00:00
Adrian Czarnecki bfad66aebd Remove UNICODE_MESSAGES template
https://review.openstack.org/#/c/537328/ moves this
template to monasca-common

* add monasca-common dependency

Change-Id: I99307314a75b2cb49a75d9c83247ccaf339123a9
Story: 2001400
Task: 12525
2018-06-27 10:50:22 +00:00
Witold Bedyk 3478474a8a Initialize alarm in test_alarm_metric_mixcase
In some cases thresholding engine needs longer to evaluate the first
measurement and checking the alarm state returns UNDETERMINED. To make
the test safer, we send the first measurement to initialize the alarm.

Change-Id: Ib294952d29b5c1c464baa24978f4c18a257fe0bc
Story: 2001539
Task: 20046
2018-06-11 10:04:54 +02:00
bandorf 0517969ca9 Add test case f. alarms: metric name in mixed case
Change-Id: I5768267bd55bd1e2b5c154b5b7f788ceab390e9a
Story: 2001539
Task: 6351
2018-04-27 14:43:42 +00:00
Adrian Czarnecki f5ef89e62a Remove test for log_api/v2 version
Log api v2 is no longer supported.
Fix failing 'should_reject_if_body_is_empty' test.

Story: 2001400
Task: 14427
Change-Id: Ifdca09ca430415614956befc0744c52ad6b3a0a6
2018-04-27 13:44:10 +02:00
Amir Mofakhar 6d21f39445 Update pep8 checks
* set the maximum line length to 100
* cleaned up the codes for pep8

Change-Id: I5d62c9925b10b18c7c8e4ce93ef7c5d2ffec3f8e
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-04-12 11:43:49 +02:00
Adrian Czarnecki d874b00645 Revert "Remove UNICODE_MESSAGES template"
This reverts commit fc24ef0d1a.

Change-Id: I66f5a8f2511a1c7bc7d35b5dd6e270025ca4b2e1
2018-04-12 06:56:43 +00:00
Adrian Czarnecki fc24ef0d1a Remove UNICODE_MESSAGES template
https://review.openstack.org/#/c/537328/ moves this
template to monasca-common

Story: 2001400
Task: 12525
Change-Id: I6c06c9635ac0b038e01885a063c7a4701193eb4d
2018-04-09 12:11:52 +02:00
Adrian Czarnecki 3e72b5cedc Fix unicode tempest test
Change-Id: Ib3ff312fdf2a1d9d22f156ff27e6e1b6c7adcb88
2018-04-09 07:43:10 +00:00
Witold Bedyk 4ea57e0e89 Extend wait time after alarm definitions creation
Updated modules:

* monasca_tempest_tests.tests.api.test_alarm_transitions
* monasca_tempest_tests.tests.api.test_alarms_state_history_one_transition

Change-Id: If7eb73f7b5098c987f45b1b2e917a1ef99af167b
Story: 2001651
Task: 6676
2018-03-12 08:56:42 +01:00
Zuul bde9357bde Merge "Fix issue with failing metric tests" 2018-02-22 13:03:15 +00:00
bandorf 86d81ab79d Fix issue with failing metric tests
Retrieve measurement again, if returned without val f. dimension

Depends-on: https://review.openstack.org/542945
Story: 2001482
Task: 6203

Change-Id: I739612e96a2975bde12aea91f3f8dfcd6fb15342
2018-02-19 10:54:34 +01:00
Craig Bryant 43aa28492c Add sleep to let Thresh process alarm definitions
Tests are randomly failing with not alarms being created.
The metrics were sent immediately after the alarm definitions are
created so add a sleep of constants.ALARM_DEFINITION_CREATION_WAIT
to give Thresh a chance to process the new alarm definitions

Note that is currently, 1 second but will be increased to 3
seconds in https://review.openstack.org/#/c/543399

Change-Id: I9f944212dd97d94ab82b49021b454505646b1e03
Story: 2001533
Task:  6338
2018-02-13 09:07:04 +00:00
Witold Bedyk e2ac3a49b7 Extend sleep for alarm definition creation
* set constants.ALARM_DEFINITION_CREATION_WAIT = 3
* use it for test_alarm_last_function()

Change-Id: I98200950312eb7b6d7f9c0990dda5a1ae9d27a85
Story: 2001533
Task:  6337
2018-02-12 13:25:49 +01:00
Chandan Kumar d04d12bdf9 Synced tempest code from monasca-{api, log_api}
* Fix Metric Statistics period call, Statistics api failure when
  end time is not used from monasca-api and  Enable UWSGI support
  in monasca-log-api from monasca-log-api code synced.

Change-Id: I2ce2bd8238d44a451faeba9ddbfe27d900e9adef
2018-01-31 11:46:58 +05:30
Zuul 7acfc005d6 Merge "Merged monasca log api tempest plugin into monasca tempest plugin" 2018-01-25 07:52:23 +00:00
Chandan Kumar 679755376b Merged monasca log api tempest plugin into monasca tempest plugin
* monasca_log_api_tempest.tests -> monasca_tempest_tests.tests.log_api
* monasca_log_api_tempest.clients -> monasca_tempest_tests.clients.log_api
* monasca_log_api_tempest.services -> monasca_tempest_tests.services
* Anything starting with log_api contains monasca_log_api_tempest
  tempest plugin pieces.
* plugin.py and config.py is unified
* We can run monasca_log_api_tempest tests by pass following regex:
  monasca_tempest_tests.tests.log_api
* moved monasca_log_api/tests/base.UNICODE_MESSAGES to
  monasca_tempest_tests.tests.log_api.base.py
* Added devstack plugin to run tempest locally

Story: 2001400
Task: 6082

Change-Id: I44922da236967b5df798f36675828ce78b2e41d8
2018-01-24 12:35:42 +00:00
Zuul a725cdae12 Merge "Add test case for listing Statistics without end time" 2018-01-22 12:01:34 +00:00
Witold Bedyk f633a1ebaf Sync monasca-api tempest tests
Change-Id: I8f09a5b9c87d766044a4ad2c271e24cce73abd66
Story: 2001457
Task: 6204
2018-01-18 10:36:59 +01:00
James Gu 34d1ab192e Add test case for listing Statistics without end time
Statisics api fails when no end time is present with Casssandra.
Added a test case that queries statistics without specifying end time.

Change-Id: I627c4e461a755ae982dcd78cf22d754c33480b71
story: 2001461
task: 6176
2018-01-11 13:23:37 -08:00
Chandan Kumar 1247b3e976 Sync tempest code for cassandra support
* Ie60d668692e1f25f555dda2355f4e513d582736c Added the cassandra support
  it syncs the same in tempest plugin side.

* Copied flake8 ignores from monasca-api code base
  in order to avoid breakage.

Change-Id: I27ecc28e48da5a96e5e639026d212da3b6467646
Story: 2001400
Task:  6121
2017-12-21 13:09:55 +01:00
Witold Bedyk 9d2b047006 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 526790e2f4 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 2fdcb8dc92 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 05d724cca7 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 f0762216f4 Update the documentation link for doc migration
Change-Id: I3f52e5253fdc967cc9a4f99343bd6f21e5a143eb
2017-07-21 10:54:21 +08:00
Vu Cong Tuan 6f213c3927 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 d894d20099 Remove xrange for run both Python 2 and Python 3
Change-Id: Ibf1b45fe27f1943265cdc36e99b7a53263885eb2
2017-05-31 08:51:43 +02:00
Kaiyan Sheng cb3db853ee 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