Since oslo.context=4.0.0 Feb 3, 2022 the deprecated argument
tenant was removed [1]
[1] f4cbe4c296
Change-Id: I710a19e14c795b4c74b7a772fbd80809c9777639
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
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
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
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
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
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
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
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
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
* set the maximum line length to 100
* cleaned up the codes for pep8
Change-Id: I5d62c9925b10b18c7c8e4ce93ef7c5d2ffec3f8e
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
Retrieve measurement again, if returned without val f. dimension
Depends-on: https://review.openstack.org/542945
Story: 2001482
Task: 6203
Change-Id: I739612e96a2975bde12aea91f3f8dfcd6fb15342
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
* set constants.ALARM_DEFINITION_CREATION_WAIT = 3
* use it for test_alarm_last_function()
Change-Id: I98200950312eb7b6d7f9c0990dda5a1ae9d27a85
Story: 2001533
Task: 6337
* 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
* 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
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
* 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
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
This will fix following error:
RuntimeError: resource_cleanup for TestAlarmsCount did not call
the super's resource_cleanup.
Change-Id: I700285eb0b0408678b93431bcc3de47e67f28e75
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
"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