210 Commits

Author SHA1 Message Date
Zuul
b85b9dc30c Merge "Move functional tests from watcher_tempest_plugin to watcherclient" 2025-03-19 00:59:02 +00:00
Chandan Kumar (raukadah)
e9fc2c8851 Move functional tests from watcher_tempest_plugin to watcherclient
Functional tests are meant to validate the openstack optimize cli
functionality. The code was kept in watcher-tempest-plugin repo.

Tempest plugin repo was meant to store tempest related api and
scenario tests, not functional tests. This patch moves the code
from watcher-tempest-plugin to watcherclient repo.

It also adds:
 - tox target for running functional tests
 - New zuul job based on devstack-tox-functional to run functional
   tests.

Note: Now functional tests are running via tox and OS_* variable.
That's why It also drops tempest credentials factory to get creds from
tempest.conf.

Related-bug: #2100741

Change-Id: Ibf25c9cd6b8cd6b228f759d7393af5fe6a357d7f
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
2025-03-12 10:14:04 +05:30
Zuul
edbc62c502 Merge "Python 3.12: do not use ssl.wrap_socket" 2025-01-09 23:09:40 +00:00
Zuul
2bd17ffadb Merge "If endpoint ends with 1 client removes it" 2025-01-09 23:05:34 +00:00
Zuul
2af23e860d Merge "Make watcherclient/shell.py reproducible" 2024-12-06 14:15:22 +00:00
Zuul
4317c283cc Merge "Get rid of distutils" 2024-12-06 13:28:17 +00:00
Mitya Eremeev
5359e7b4ec If endpoint ends with 1 client removes it
e.g. Watcher endpoint is "127.0.0.1:8081",
Watcher client sends http request to "127.0.0.1:808"

Closes-Bug: #2052779
Change-Id: I78631c8a13ff73a236f3bfadd7f4258b254b6113
2024-12-05 20:23:07 +03:00
Takashi Kajinami
be7ee7347a Get rid of distutils
... because it was already removed from Python 3.12 .

Change-Id: Ie809a48ce49d3fd6139c55109c9ed92b852ad41e
2024-10-02 23:24:03 +09:00
Takashi Kajinami
cd49282297 Bump hacking
hacking 3.0.x is quite old. Bump it to the current latest version.

Change-Id: I546d263ff091c47e5e97066499bc3711f4f760c6
2024-09-23 11:56:16 +09:00
Cyril Roelandt
79fe6b8fee Python 3.12: do not use ssl.wrap_socket
The ssl.wrap_socket method has been removed in 3.12.
SSLContext.wrap_socket should now be used.

Change-Id: I6e4f6848c07f7f9c1937ebde433a85ccfde7ba6a
2024-07-03 17:19:02 +02:00
Takashi Kajinami
33bcb8b04f Remove six
This library no longer supports python 2 thus usage of six is no longer
needed.

Change-Id: Idb5403b4ce049b4a739489c7bd42fbf694c894dd
2024-01-28 16:59:28 +09:00
Thomas Goirand
834ab29878 Make watcherclient/shell.py reproducible
Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
python-watcherclient could not be built reproducibly.

This is because the documentation generates automatic documentation for
the "main()" entrypoint method's arguments, one of which is "sys.argv".
During document generation this results in documentation examples like:

   def main(argv=['-b', 'html', 'doc/source',
      '«ABSOLUTE_BUILD_DIR»/debian/python-watcherclient-doc/usr/.../html']):

… etc. Patch attached that sets "None" instead but retains the existing
fallback logic.

 [0] https://reproducible-builds.org/

Please note that this was reported in the Debian tracker:
https://bugs.debian.org/960607

and that the fix was applied to the Debian package.

Change-Id: I502bb2d11d90ce4c46c14904a8c048ea824f11d5
2021-12-28 19:33:55 +01:00
Zuul
21f42884f1 Merge "Use unittest.mock instead of third party mock" 2020-05-07 06:59:31 +00:00
zhangbailin
8d3ce6c58d Remove future imports
These particular imports are no longer needed in a Python 3-only world.

Change-Id: Ifecdc3c35820977ad561cd2d78471d14b94ee65a
2020-04-30 09:58:27 +00:00
jacky06
92c15fa38a Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Idac937dd704ef11dfc33e197f7539e3f7a5feb92
2020-04-29 23:50:12 +08:00
Andreas Jaeger
2830afdc75 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: I6bd9fdee0ee275e4d9d3fcaf96c1512933ce35a6
2020-03-31 13:29:10 +02:00
licanwei
1f9194ced5 Support audit type event
Add a new EVENT type to audit type and change the microversion
to 1.4

Partially Implements: blueprint event-driven-optimization-based

Change-Id: Ia9608534d12f6877f9b93e88fa75fe9457c29347
2020-01-07 15:57:11 +08:00
licanwei
431319ee4d Watcherclient supports list data model API
Change-Id: I5527414b5e87253d87a4a26398ad5dcce1193e43
Related-Bug: #1854121
2019-12-02 14:41:32 +08:00
Eric Fried
0c7e306642 Fix python-openstackclient plugin doc build
A help string in a plugin command argument help string contained (a typo
and) some invalid sphinx-isms causing autoprogram-cliff building from
python-openstackclient to fail with:

.../python-openstackclient/doc/source/cli/plugin-commands/watcher.rst:30:Inline emphasis start-string without end-string.
and
<CreateAuditTemplate>:1:Unexpected indentation.

This commit fixes the (typo and) help string formatting.

Change-Id: Ifb668b9ada94b679672f3bab562410bf12f4ca64
2019-10-24 01:34:12 +00:00
chenke
297ca1dfc5 Implement watcher datamodel list in watcherclient
1. Add data_model.py and data_model_shell.py for accept and
process request.

2. Add relative unittest.

Partically Implements: blueprint show-datamodel-api

Change-Id: I5e080453acaedf7e20734d67922b64511dd5f7fd
2019-08-28 09:45:03 +08:00
licanwei
ea74a22b49 Fix _make_connection_url
After support uWSGI[1], Watcher endpoint changed from http://ip:port
to http://ip/infra-optim. method _make_connection_url in HTTPClient
class can't return the correct url. This patch fixed it.
[1]: https://review.opendev.org/#/c/666779/

Change-Id: I77e610cd6781b252327a49aa5cd5bc63d395bf91
Closes-Bug: #1837186
2019-07-19 17:17:19 +08:00
licanwei
dbbe7df1e2 Remove unused readme file
Change-Id: I87c6e6ce1bb6e253014d844a3a67b51cd6b11135
2019-05-30 15:34:32 +08:00
Zuul
be479feef9 Merge "Add force option" 2019-05-30 02:06:14 +00:00
Dantali0n
1aebe93477 remove unused cliutils.py file as osc_lib is used
Removes old cliutils.py file that contains methods provided by osc_lib
and remove prettytable dependency that was only required by cliutils.py

Depends-on: I8bc3330a456f8bb76a17c4277a094a64fe9be449
Change-Id: Ib9eedafb211c205ff8b7dd18a9fc87e1f0b2739f
2019-05-23 09:34:30 +02:00
licanwei
cde518be31 Add force option
Partially Implements: blueprint add-force-field-to-audit
Depends-on: Ib2d221ea9c994dea396c54cc8d2d32237025a1d4

Change-Id: I235bbd298b7fa8ad9d8b01a94d68376c8ac27e8d
2019-05-23 07:17:00 +00:00
Zuul
76a01b0c7c Merge "Add marker option for strategy in watcher-client" 2019-03-22 02:05:44 +00:00
chenke
e2082907ff Increase actionplan_shell.py unittest coverage from 70% to 97%
Change-Id: Iaca67b517c2caf4938dbf861bee3add0a41c18a2
2019-03-19 16:10:25 +08:00
Zuul
16ff74f54c Merge "Add marker option for goal" 2019-03-19 03:42:33 +00:00
Zuul
de9b8d124b Merge "Increase the unit test coverage of action_plan.py from 79% to 95%" 2019-03-19 03:42:32 +00:00
chenke
9b1e234e36 Increase the unit test coverage of action_plan.py from 79% to 95%
Change-Id: Ie33b00d690746609663492c63b8f778048a689f2
2019-03-18 11:19:57 +08:00
chenke
d0f2f10f5d Add marker option for strategy in watcher-client
Change-Id: I40ab57889c5402fe5b69d28a3372e7a0a14592f8
2019-03-18 01:12:17 +00:00
zhurong
8342e64051 Remove the functional test
Depends-On: https://review.openstack.org/643247
Change-Id: I5723575d44dccf81779959c1cae43e2cab2abc9b
2019-03-15 03:50:20 +00:00
chenke
2c29c49f24 Add marker option for goal
Change-Id: I27f06019e731633349389781545fe8c3c036d723
2019-03-13 21:23:36 +08:00
Zuul
9d9c5fe3be Merge "DEFAULT_VER should be '1.latest'" 2019-02-01 09:30:20 +00:00
licanwei
e4ee4ff03c DEFAULT_VER should be '1.latest'
Change-Id: I359838db9ee8427812215833f379a84463c8dbfb
2019-01-26 14:10:20 +08:00
licanwei
ca6190c3a1 Use openstack common CLI
Change-Id: Ia013cafe7dfa3a54c86ff44e57f98d64b15b6a86
2019-01-25 09:40:38 +08:00
ZhijunWei
4a1b6eaf81 Update hacking version
1. update the hacking to latest, due to[1]
2. fix pep8 failed

[1]: https://github.com/openstack/python-watcherclient/blob/master/HACKING.rst

Change-Id: I02891ca17e2655b9567cc56b5c2c0b4fb6a96446
2019-01-17 14:20:33 +00:00
Zuul
9d1d5e2cae Merge "Pass API microversion to Client class" 2019-01-14 08:57:24 +00:00
licanwei
3e734b177d update audit start/end time help
Change-Id: I47232f671eacd9a6b8923d4ee588c4413f65d015
2018-12-24 13:55:09 +08:00
Alexander Chadin
df57eb800d Pass API microversion to Client class
Change-Id: If6ac21330cb6c8303f62eec6ee5082f523ff73a1
2018-12-17 17:30:01 +03:00
Zuul
ab22110f7b Merge "Revert "Pass actual API version to Client class"" 2018-12-14 12:13:20 +00:00
Alexander Chadin
bdd99d60f3 Revert "Pass actual API version to Client class"
This reverts commit e391d53c2f08d573f01cc24b6c1406c0fbee2015.

Change-Id: I87c18b2e0d2b291f1de446cc6d8fc39a63fba589
2018-12-14 10:47:49 +00:00
Zuul
8ce78f8c1f Merge "Fix obsolete version of osc" 2018-12-07 11:21:16 +00:00
Alexander Chadin
ffc50c5001 Fix obsolete version of osc
This patch set adds a link to actual API version for OSC.

Closes-Bug: #1807180
Change-Id: I622bfec99c2e6fd9f69293aaa04c3184215af0d3
2018-12-06 18:03:30 +03:00
licanwei
98e09044c1 Add continuous audit functional test
Change-Id: Ibee323f7c894ae9ead2ea872561e0e7e79320017
2018-11-30 10:11:33 +08:00
Zuul
112e372239 Merge "Pass actual API version to Client class" 2018-11-20 02:00:44 +00:00
Zuul
c5b4db7fc1 Merge "Refactor the getid method base.py" 2018-11-19 09:01:44 +00:00
wanghui
94f6864bf0 Refactor the getid method base.py
Refer to a merged commit.
https://review.openstack.org/#/c/588983/

Change-Id: I9765543c288370cfcdaaa930b2839e28b51a9380
2018-11-09 20:11:16 +08:00
Alexander Chadin
e391d53c2f Pass actual API version to Client class
Change-Id: Ie5f563c6982239ad7a99af06f704e2d931d164be
2018-11-08 17:39:22 +03:00
licanwei
b7928eb155 Replace latest with explicit version
Change-Id: I8aae4595f7ca9dae7ed36705b1311070a531523f
Closes-Bug: #1802217
2018-11-08 16:59:38 +08:00