Skip to content

Commit

Permalink
Pull request #851: VFS-12602 fixed mixed storage sync tests
Browse files Browse the repository at this point in the history
Merge in VFS/onedata-acceptance from feature/VFS-12602-fix-acc-test-fix-mixed-storage-sync-tests to develop

* commit '4ee4fef6d4ff7686f993b273c76a15310f2f29c6':
  VFS-12602 fixed tests
  VFS-12602 fixed tests
  VFS-12602 added formating
  VFS-12602 fixed mixed storage sync tests
  • Loading branch information
Wojciech34 authored and Agnes5 committed Feb 3, 2025
2 parents bd72b39 + 4ee4fef commit 11cbbbd
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 34 deletions.
2 changes: 1 addition & 1 deletion tests/gui/steps/oneprovider/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def save_date_of_archive_creation(browser_id, tmp_memory, description):
r'(?P<files_count>\d+), size: "(?P<size>.*?)"'
)
)
@repeat_failed(timeout=WAIT_FRONTEND)
@repeat_failed(timeout=WAIT_BACKEND)
def assert_archive_full_state_status(
browser_id, tmp_memory, status, files_count, size, description
):
Expand Down
53 changes: 22 additions & 31 deletions tests/mixed/features/onepanel/storage_sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ Feature: Onepanel features regarding storage sync (e.g. import)
storage: "new_storage (import-enabled)"
size: 1000000
storage import:
continuous scan: true
continuous scan: false
max depth: 2
scan interval [s]: 1
detect modifications: true
detect deletions: false
And using <client2>, onepanel sees that import strategy configuration for "space1" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 2
Scan interval [s]: 1
Detect modifications: true
Detect deletions: false
And using <client1>, user1 sees that list of supporting providers for space named "space1" contains "oneprovider-1" in "onezone" Onezone service
Expand All @@ -57,15 +55,14 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- dir22
- file1.txt: 22222
And using <client2>, onepanel configures import parameters for "space1" in "oneprovider-1" Oneprovider panel service as follow:
continuous scan: true
continuous scan: false
max depth: 3
And using <client2>, onepanel sees that import strategy configuration for "space1" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 3
Scan interval [s]: 1
Detect modifications: true
Detect deletions: false
And user is idle for 5 seconds
And using <client2>, onepanel forces start of storage import scan for "space1" at "oneprovider-1" and waits till finished
Then using <client1>, user1 sees that content for "space1" in "oneprovider-1" Oneprovider service is as follow:
- dir2:
- dir21:
Expand All @@ -91,11 +88,11 @@ Feature: Onepanel features regarding storage sync (e.g. import)
storage: "new_storage (import-enabled)"
size: 1000000
storage import:
continuous scan: true
continuous scan: false
max depth: 2
detect deletions: false
And using <client2>, onepanel sees that import strategy configuration for "space3" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 2
Detect deletions: false
And using <client1>, user1 sees that list of supporting providers for space named "space3" contains "oneprovider-1" in "onezone" Onezone service
Expand All @@ -105,17 +102,15 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- dir22
- file1.txt: 22222
And using <client2>, onepanel configures import parameters for "space3" in "oneprovider-1" Oneprovider panel service as follow:
continuous scan: true
continuous scan: false
max depth: 3
scan interval [s]: 1
detect deletions: true
And using <client2>, onepanel sees that import strategy configuration for "space3" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 3
Scan interval [s]: 1
Detect modifications: true
Detect deletions: true
And user is idle for 5 seconds
And using <client2>, onepanel forces start of storage import scan for "space3" at "oneprovider-1" and waits till finished
Then using <client1>, user1 sees that content for "space3" in "oneprovider-1" Oneprovider service is as follow:
- dir2:
- dir21:
Expand All @@ -125,7 +120,7 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- file1.txt: 22222
And using docker, user removes dir2/dir21 from provider's storage mount point
And using docker, user removes dir2/file1.txt from provider's storage mount point
And user is idle for 20 seconds
And using <client2>, onepanel forces start of storage import scan for "space3" at "oneprovider-1" and waits till finished
And using <client1>, user1 sees that content for "space3" in "oneprovider-1" Oneprovider service is as follow:
- dir2: 1
And using <client1>, user1 sees that content for "space3" in "oneprovider-1" Oneprovider service is as follow:
Expand All @@ -149,10 +144,10 @@ Feature: Onepanel features regarding storage sync (e.g. import)
storage: "new_storage (import-enabled)"
size: 1000000
storage import:
continuous scan: true
continuous scan: false
max depth: 2
And using <client2>, onepanel sees that import strategy configuration for "space4" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 2
And using <client1>, user1 sees that list of supporting providers for space named "space4" contains "oneprovider-1" in "onezone" Onezone service
And using <client1>, user1 sees that content for "space4" in "oneprovider-1" Oneprovider service is as follow:
Expand All @@ -161,16 +156,14 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- dir22
- file1.txt: 22222
And using <client2>, onepanel configures import parameters for "space4" in "oneprovider-1" Oneprovider panel service as follow:
continuous scan: true
continuous scan: false
max depth: 3
scan interval [s]: 1
detect modifications: false
And using <client2>, onepanel sees that import strategy configuration for "space4" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 3
Scan interval [s]: 1
Detect modifications: false
And user is idle for 5 seconds
And using <client2>, onepanel forces start of storage import scan for "space4" at "oneprovider-1" and waits till finished
Then using <client1>, user1 sees that content for "space4" in "oneprovider-1" Oneprovider service is as follow:
- dir2:
- dir21:
Expand All @@ -196,10 +189,10 @@ Feature: Onepanel features regarding storage sync (e.g. import)
storage: "new_storage (import-enabled)"
size: 1000000
storage import:
continuous scan: true
continuous scan: false
max depth: 2
And using <client2>, onepanel sees that import strategy configuration for "space5" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 2
And using <client1>, user1 sees that list of supporting providers for space named "space5" contains "oneprovider-1" in "onezone" Onezone service
And using <client1>, user1 sees that content for "space5" in "oneprovider-1" Oneprovider service is as follow:
Expand All @@ -208,18 +201,16 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- dir22
- file1.txt: 22222
And using <client2>, onepanel configures import parameters for "space5" in "oneprovider-1" Oneprovider panel service as follow:
continuous scan: true
continuous scan: false
max depth: 3
scan interval [s]: 1
detect modifications: false
detect deletions: true
And using <client2>, onepanel sees that import strategy configuration for "space5" in "oneprovider-1" is as follow:
Continuous scan: true
Continuous scan: false
Max depth: 3
Scan interval [s]: 1
Detect modifications: false
Detect deletions: true
And user is idle for 10 seconds
And using <client2>, onepanel forces start of storage import scan for "space5" at "oneprovider-1" and waits till finished
Then using <client1>, user1 sees that content for "space5" in "oneprovider-1" Oneprovider service is as follow:
- dir2:
- dir21:
Expand All @@ -229,7 +220,7 @@ Feature: Onepanel features regarding storage sync (e.g. import)
- file1.txt: 22222
And using docker, user removes dir2/dir21 from provider's storage mount point
And using docker, user removes dir2/file1.txt from provider's storage mount point
And user is idle for 10 seconds
And using <client2>, onepanel forces start of storage import scan for "space5" at "oneprovider-1" and waits till finished
And using <client1>, user1 sees that content for "space5" in "oneprovider-1" Oneprovider service is as follow:
- dir2:
- dir22: 10
Expand Down
33 changes: 32 additions & 1 deletion tests/mixed/steps/onepanel_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
configure_sync_parameters_for_space_in_op_panel_gui,
copy_id_of_space_gui,
revoke_space_support_in_op_panel_using_gui,
run_scan_and_wait_till_finished,
support_space_in_op_panel_using_gui,
)
from tests.gui.meta_steps.oneprovider.data import assert_space_content_in_op_gui
Expand Down Expand Up @@ -71,7 +72,10 @@
)
from tests.mixed.utils.common import NoSuchClientException
from tests.utils.bdd_utils import parsers, wt
from tests.utils.entities_setup.spaces import force_start_storage_scan
from tests.utils.entities_setup.spaces import (
force_start_storage_scan,
wait_for_storage_scan_to_finish,
)
from tests.utils.utils import repeat_failed


Expand Down Expand Up @@ -929,3 +933,30 @@ def force_start_storage_import_scan(
):
space_id = spaces[space]
force_start_storage_scan(space_id, provider, hosts, onepanel_credentials)


@wt(
parsers.parse(
"using {client}, {user} forces start of storage import scan for "
'"{space}" at "{provider}" and waits till finished'
)
)
def force_start_and_wait_to_finish_storage_import_scan(
client,
user,
provider,
space,
spaces,
hosts,
onepanel_credentials,
selenium,
onepanel,
):
if client.lower() == "rest":
space_id = spaces[space]
force_start_storage_scan(space_id, provider, hosts, onepanel_credentials)
wait_for_storage_scan_to_finish(space_id, provider, hosts, onepanel_credentials)
elif client.lower() == "web gui":
run_scan_and_wait_till_finished(selenium, user, onepanel)
else:
raise NoSuchClientException(f"Client: {client} not found.")
15 changes: 14 additions & 1 deletion tests/utils/entities_setup/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import yaml

from tests import OZ_REST_PORT, PANEL_REST_PORT, OP_REST_PORT
from tests.gui.conftest import WAIT_FRONTEND
from tests.gui.conftest import WAIT_FRONTEND, WAIT_BACKEND
from tests.gui.steps.rest.shares import get_file_id_by_rest
from tests.gui.utils.generic import parse_seq
from tests.utils.bdd_utils import given, parsers
Expand Down Expand Up @@ -500,3 +500,16 @@ def force_start_storage_scan(space_id, provider, hosts, onepanel_credentials):
path=get_panel_rest_path('provider', 'spaces', space_id,
'storage-import', 'auto', 'force-start'),
auth=(onepanel_username, onepanel_password))


@repeat_failed(timeout=WAIT_BACKEND)
def wait_for_storage_scan_to_finish(space_id, provider, hosts, onepanel_credentials):
provider_hostname = hosts[provider]['hostname']
onepanel_username = onepanel_credentials.username
onepanel_password = onepanel_credentials.password
resp = http_get(ip=provider_hostname, port=PANEL_REST_PORT,
path=get_panel_rest_path('provider', 'spaces', space_id,
'storage-import', 'auto', 'info'),
auth=(onepanel_username, onepanel_password))
err_msg = f"status of storage scan is {resp.json()["status"]}"
assert resp.json()["status"] == "completed", err_msg

0 comments on commit 11cbbbd

Please sign in to comment.