Commit Graph

29 Commits

Author SHA1 Message Date
Stephen Finucane 6bd15d6736 tests: Add warning fixture
Copied almost wholesale from Nova. We're going to use this as part of
the SQLAlchemy 2.0 preparation. We enable those warnings and clean up
the tox file in preparation.

Change-Id: I869d9b110264d69301bf43ae579a4749adeba4f6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-02 08:16:31 +00:00
Stephen Finucane 8a69520298 tests: Use base test case everywhere
Change-Id: I53725f43b3967db829c8d6bdb078cf0704eb9b33
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-02 08:16:26 +00:00
Andreas Jaeger 11a19f2ea8 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: Ibc3b00aca7332f12b58893213acfc88749b74aa1
2020-04-14 20:09:03 +02:00
Michal Arbet 2a283bf34a Fix freezer-api's src_file to path_to_backup
Freezer-api is not working as it is expected, returning NULL value
for src_file option in freezer_action's json returned from API.

In other words when user define action via freezer client and define
valid and WORKING action JSON with option path_to_backup
(src_file is not supported by freezer-agent anymore).

In DB we can see backup_metadata is filled correctly,
freezer-scheduler/freezer-agent working correctly as they are reading
backup_metadata. Problem is that API is still returning json with
src_file set tu NULL because src_file is not present in backup_metada,
therefore is not filled in src_file column in action table.

Src_file option was changed to path_to_backup in freezer git repository
below, but API was never changed, this patch is fixing this behaviour.

Freezer's change :
c7f71ff70b

Doc changes in freezer:
https://review.opendev.org/#/c/705003/

Change-Id: I9e74910bd0ff4ad18b830c26ce90770b0dfa107b
2020-01-31 11:45:39 +01:00
gecong1973 57835be529 Add client search unit test for sql
The patch add client search unit testcase for sqlalchemy

Change-Id: I53bceb89e54ea3c60e3e088af3c65863b4fd35c3
2018-11-19 01:16:00 -08:00
gengchc2 25376c4133 Add session search unit test for sqlalchemy
The patch add search unit test

Change-Id: If33e167428033997d2315990ca455c072bc51d0d
2018-11-19 03:02:57 +00:00
gengchc2 3aa1b1dc12 Add job search unit test for sqlalchemy
The patch add search unit test

Change-Id: Ica563467d859995dfeedaaa6061150780e092626
2018-11-19 02:53:59 +00:00
gengchc2 8f4a306f3b Add job replace unit test for sqlalchemy
The patch add replace test case for sqlalchemy

Change-Id: Ic0e0b6466e1dddc5be3b1e339572467e71df9a91
2018-11-18 18:20:40 -08:00
gengchc2 15ef8247f8 Add session replace unit test for sqlalchemy
The patch add replace test case for sqlalchemy

Change-Id: I311d620c76e21f4099f0778adc734fc909071b09
2018-11-18 18:20:25 -08:00
gecong1973 df2993f850 Add backup delete unit test for sql
The patch add backup delete unit test case for sqlalchemy

Change-Id: I17d91fe77ecac88f679989c4bd0730d313c835fb
2018-11-14 23:11:42 -08:00
gecong1973 e3b5353960 Add action search unit test
The patch add search unit test

Change-Id: Ib8e68919d63917b6ab6372f12bbe2b423d43fed4
2018-11-14 11:19:37 +00:00
gengchc2 08e22adfbb Add session update unit test for sqlalchemy
Change-Id: I8e664fd4487d7dfe15627a513e300006182a50fd
2018-11-14 09:38:31 +00:00
gengchc2 d9007cf473 Add job update unit test for sqlalchemy
Change-Id: I5e499c5ce17d2447dcaf8cf933d75492e625cac5
2018-11-14 08:31:13 +00:00
gecong1973 c084016dee Add action replace unit test for sql
The patch add replace test case for sqlalchemy

Change-Id: I78c648f6bbf8a05f8357dc9001e420fae74e307b
2018-11-13 19:45:24 -08:00
gecong1973 c0f34491e9 Add action update unit test for sql
The patch add action update unit test case

Change-Id: I42460db62bcee18877b4bcd01984bfaad2d31f5b
2018-11-13 17:08:59 -08:00
gecong1973 3ec01e779a Add backup unit test for sql
The patch add backup unit test for sqlalchemy

Change-Id: I6faeecc482c3d68fa3454c656f38023aa86416c9
2018-11-12 23:23:00 -08:00
gecong1973 18d0df67d1 Add client add and get unit test for sql
The patch add client add and get unit test for sqlalchemy

Change-Id: I21370d5ed90ade872fdf3299741e522a2e28f060
2018-11-12 19:14:24 -08:00
Cai Hui b76b4bcace Fix freezer_api.api.v2.sessions bug: doc.items() is not a iter object
1. Use iter() create a iter object
2. Add 'freezer_api.api.v2.sessions'  module's unit test cases.
3. Add 'project_id' key-value to 'fake_session_0/_1' dicts.

Change-Id: Icf32feefa6c49314d5ae17433f4b6e6d19c33027
Story: 2004070
Task: 27091
2018-10-12 03:54:21 -04:00
Cai Hui 1178086742 Add freezer_api.api.v2.jobs unit test cases
1. Add 'freezer_api.api.v2.jobs'  module's unit test cases.
2. Add 'project_id' key-value to 'fake_job_0' dict.

Change-Id: I80d7950f486e43ff126bdd4f102870154647dc69
2018-10-08 21:08:14 -04:00
Cai Hui ef24c928e0 Add freezer_api.api.v2.clients unit test cases
1. Add 'freezer_api.api.v2.clients'  module's unit test cases.
2. Add "project_id" key-value to 'fake_client_info_0'&'fake_client_info_1' dicts.

Change-Id: I61ed4dab13ff17b4612f3454b5b96a549530ba41
2018-10-06 23:44:30 -04:00
Cai Hui 4aa9702501 Add unit test cases of v2 interfaces: backup
1. Add 'backup' module's unit test cases of v2 interface
2.Add "project_id" key-value  to 'fake_data_0_wrapped_backup_metadata' dict.

Change-Id: I9432297db016fba69eb375a99decc0ee7f084b0d
2018-09-29 23:31:47 -04:00
Cai Hui 5fbb03d78f Add unit test cases of v2 interfaces: action.
1. Add unit test cases for v2 interface of 'action'.

2. Add "project_id" key-value  to 'fake_action_0' and 'fake_action_1' dicts, as  unit test datas.

Change-Id: Iabd48cacbd4c9c19c454f4dcf4d86cd5017ec0b9
2018-09-28 06:44:18 -04:00
Hieu LE ae388911e0 Implement policy in code - client (end)
This commit migrate all client policies into code [1] and
also remove policy.json usage file completely.

Like oslo.config, with oslo.policy, we can define all of
default rules in code base and only change some rules
via policy file. Another thing that we should use yaml
format instead of json format.

[1] https://governance.openstack.org/tc/goals/queens/policy-in-code.html
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>

Change-Id: I7c7fd83aa2516c053e38d7598cf79e63401f7519
2017-10-30 07:29:43 +00:00
Saad Zaher 7ec7d039bf Fix pylint checks
Change-Id: I8140a0b474d6a06e372683523cb5918059a03ae5
Partial-Bug: #1696455
2017-06-07 15:19:32 +00:00
Pengju Jiao 8ea79dd19b Add session scheduling information validation.
Change-Id: Ie704a3ee31a56a1fd86d331b3c5cc79795358506
Closes-Bug: #1587069
2016-12-09 20:04:15 +08:00
Ruslan Aliev cf95fa1e86 Add full pep8 check
This patch adds full pep8 check support. All code style problems
is fixed.

Closes-Bug: #1646103
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I1fce70a1b4e4c70379fc3876f85170b06a044059
2016-12-05 19:57:32 +04:00
Ruslan Aliev 4dc1077a6e Use UUID as backup_id parameter
Current backup_id field may contain unsupported
characters for HTTP requests. It causes problems with
/v1/backups/{backup_id} requests. Proposed solution:
use UUID as backup_id instead of
'container_hostname_backupname_timestamp_level' pattern
for define backup_id.

Change-Id: I38e2ed52ab375ea0705cdb88f82e5e66cef5cd39
Closes-Bug: #1645110
Closes-Bug: #1618030
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-28 15:10:03 +03:00
Saad Zaher ce09bbfa28 Implemented oslo.policy
Moving freezer-api to oslo.policy and modified freezer context
to be injected through paste configuration

Change-Id: I20b9ac48cf3419015ff54f6c57de5f00c8e6d5f2
Implements: blueprint switch-freezer-api-oslo-policy
2016-08-11 11:10:57 +00:00
Fausto Marzi 8d220b56a7 Switch to testr from pytest
Align to the other Openstack project and
use testr instead of pytest

Includes:
    - pylint and pep8 fixes.
    - py34 compliance
    - requirements updated
    - updated path to dsvm gate job

Change-Id: I10a5ea8d581029eba8f3ab5e016a1dd1919fa117
Depends-On: I4f9050cd551e87d2e398b6f94dc904154d0b1b13
2016-02-28 10:37:21 +00:00