test(services): try moving to the same device

This commit is contained in:
Houkime 2023-10-11 17:33:03 +00:00
parent c83b1a3442
commit aa287d9cf3
2 changed files with 30 additions and 36 deletions

View file

@ -1,11 +1,6 @@
{ {
"api": { "api": {"token": "TEST_TOKEN", "enableSwagger": false},
"token": "TEST_TOKEN", "bitwarden": {"enable": true},
"enableSwagger": false
},
"bitwarden": {
"enable": true
},
"databasePassword": "PASSWORD", "databasePassword": "PASSWORD",
"domain": "test.tld", "domain": "test.tld",
"hashedMasterPassword": "HASHED_PASSWORD", "hashedMasterPassword": "HASHED_PASSWORD",
@ -19,38 +14,19 @@
"ssh": { "ssh": {
"enable": true, "enable": true,
"passwordAuthentication": true, "passwordAuthentication": true,
"rootKeys": [ "rootKeys": ["ssh-ed25519 KEY test@pc"]
"ssh-ed25519 KEY test@pc"
]
}, },
"username": "tester", "username": "tester",
"gitea": { "gitea": {"enable": true},
"enable": true "ocserv": {"enable": true},
}, "pleroma": {"enable": true},
"ocserv": { "jitsi": {"enable": true},
"enable": true "autoUpgrade": {"enable": true, "allowReboot": true},
}, "useBinds": true,
"pleroma": {
"enable": true
},
"jitsi": {
"enable": true
},
"autoUpgrade": {
"enable": true,
"allowReboot": true
},
"timezone": "Europe/Moscow", "timezone": "Europe/Moscow",
"sshKeys": [ "sshKeys": ["ssh-rsa KEY test@pc"],
"ssh-rsa KEY test@pc" "dns": {"provider": "CLOUDFLARE", "apiKey": "TOKEN"},
], "server": {"provider": "HETZNER"},
"dns": {
"provider": "CLOUDFLARE",
"apiKey": "TOKEN"
},
"server": {
"provider": "HETZNER"
},
"backup": { "backup": {
"provider": "BACKBLAZE", "provider": "BACKBLAZE",
"accountId": "ID", "accountId": "ID",

View file

@ -5,6 +5,7 @@ from selfprivacy_api.graphql.mutations.services_mutations import ServicesMutatio
import selfprivacy_api.services as service_module import selfprivacy_api.services as service_module
from selfprivacy_api.services.service import Service, ServiceStatus from selfprivacy_api.services.service import Service, ServiceStatus
from selfprivacy_api.services.test_service import DummyService from selfprivacy_api.services.test_service import DummyService
from selfprivacy_api.utils.block_devices import BlockDevices
import tests.test_graphql.test_api_backup import tests.test_graphql.test_api_backup
from tests.test_common import raw_dummy_service, dummy_service from tests.test_common import raw_dummy_service, dummy_service
@ -468,3 +469,20 @@ def test_move_no_such_volume(authorized_client, only_dummy_service):
# is there a meaning in returning the service in this? # is there a meaning in returning the service in this?
assert data["service"] is not None assert data["service"] is not None
assert data["job"] is None assert data["job"] is None
def test_move_same_volume(authorized_client, dummy_service):
# dummy_service = only_dummy_service
# we need a drive that actually exists
root_volume = BlockDevices().get_root_block_device()
dummy_service.set_simulated_moves(False)
dummy_service.set_drive(root_volume.name)
mutation_response = api_move(authorized_client, dummy_service, root_volume.name)
data = get_data(mutation_response)["services"]["moveService"]
assert_errorcode(data, 400)
# is there a meaning in returning the service in this?
assert data["service"] is not None
assert data["job"] is not None