Skip to content

Commit 28269d0

Browse files
PSMDB. Adjust PSMDB tests for PMM3
1 parent d013479 commit 28269d0

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

pmm_psmdb-pbm_setup/test/test.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424

2525
def test_pmm_services():
26-
req = requests.post(f"https://{pmm_server_url}/v1/inventory/Services/List", json={},
26+
req = requests.get(f"https://{pmm_server_url}/v1/inventory/services", json={},
2727
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
2828
print('\nGetting all mongodb services:')
2929
mongodb = req.json()['mongodb']
3030
print(mongodb)
3131
assert mongodb
32-
assert "service_id" in mongodb[0]['service_id']
32+
assert "service_id" in mongodb[0]
3333
for service in mongodb:
3434
assert "rs" or "mongos" in service['service_name']
3535
if not "mongos" in service['service_name']:
@@ -49,11 +49,11 @@ def test_pmm_add_location():
4949
'bucket_name': 'bcp'
5050
}
5151
}
52-
req = requests.post(f"https://{pmm_server_url}/v1/management/backup/Locations/Add", json=data,
52+
req = requests.post(f"https://{pmm_server_url}/v1/backups/locations", json=data,
5353
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
5454
print('\nAdding new location:')
5555
print(req.json())
56-
assert "location_id" in req.json()['location_id']
56+
assert "location_id" in req.json()
5757
pytest.location_id = req.json()['location_id']
5858

5959

@@ -64,21 +64,23 @@ def test_pmm_logical_backup():
6464
'name': 'test',
6565
'description': 'test',
6666
'retries': 0,
67-
'data_model': 'LOGICAL'
67+
'data_model': 'DATA_MODEL_LOGICAL'
6868
}
69-
req = requests.post(f"https://{pmm_server_url}/v1/management/backup/Backups/Start", json=data,
69+
70+
print(data)
71+
req = requests.post(f"https://{pmm_server_url}/v1/backups:start", json=data,
7072
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
7173
print('\nCreating logical backup:')
7274
print(req.json())
73-
assert "artifact_id" in req.json()['artifact_id']
75+
assert "artifact_id" in req.json()
7476
pytest.artifact_id = req.json()['artifact_id']
7577

7678

7779
def test_pmm_artifact():
7880
backup_complete = False
7981
for i in range(600):
8082
done = False
81-
req = requests.post(f"https://{pmm_server_url}/v1/management/backup/Artifacts/List", json={},
83+
req = requests.get(f"https://{pmm_server_url}/v1/backups/artifacts", json={},
8284
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
8385
assert req.json()['artifacts']
8486
for artifact in req.json()['artifacts']:
@@ -118,11 +120,11 @@ def test_pmm_start_restore():
118120
'service_id': pytest.service_id,
119121
'artifact_id': pytest.artifact_id
120122
}
121-
req = requests.post(f"https://{pmm_server_url}/v1/management/backup/Backups/Restore", json=data,
123+
req = requests.post(f"https://{pmm_server_url}/v1/backups/restores:start", json=data,
122124
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
123125
print('\nRestoring logical backup:')
124126
print(req.json())
125-
assert "restore_id" in req.json()['restore_id']
127+
assert "restore_id" in req.json()
126128
pytest.restore_id = req.json()['restore_id']
127129

128130

@@ -132,7 +134,7 @@ def test_pmm_restore():
132134
restore_complete = False
133135
for i in range(600):
134136
done = False
135-
req = requests.post(f"https://{pmm_server_url}/v1/management/backup/RestoreHistory/List", json={},
137+
req = requests.get(f"https://{pmm_server_url}/v1/backups/restores", json={},
136138
headers={"authorization": "Basic YWRtaW46cGFzc3dvcmQ="}, verify=False)
137139
assert req.json()['items']
138140
for item in req.json()['items']:

0 commit comments

Comments
 (0)