Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kamilg/speed up tf #1576

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 36 additions & 32 deletions test/functional/tests/cli/test_zero_metadata_command.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file belongs to some other PR ;)

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import time
from datetime import timedelta

import time
import pytest

from datetime import timedelta

from api.cas import casadm, cli_messages, cli
from api.cas.cache_config import CacheMode, CleaningPolicy
from core.test_run import TestRun
Expand All @@ -24,15 +25,16 @@
@pytest.mark.require_disk("core", DiskTypeLowerThan("cache"))
def test_zero_metadata_negative_cases():
"""
title: Test for '--zero-metadata' negative cases.
description: |
Test for '--zero-metadata' scenarios with expected failures.
pass_criteria:
- Zeroing metadata without '--force' failed when run on cache.
- Zeroing metadata with '--force' failed when run on cache.
- Zeroing metadata failed when run on system drive.
- Load cache command failed after successfully zeroing metadata on the cache device.
title: Test for '--zero-metadata' negative cases.
description: |
Test for '--zero-metadata' scenarios with expected failures.
pass_criteria:
- Zeroing metadata without '--force' failed when run on cache.
- Zeroing metadata with '--force' failed when run on cache.
- Zeroing metadata failed when run on system drive.
- Load cache command failed after successfully zeroing metadata on the cache device.
"""

with TestRun.step("Prepare cache and core devices."):
cache_dev, core_dev, cache_disk = prepare_devices()

Expand Down Expand Up @@ -86,14 +88,15 @@ def test_zero_metadata_negative_cases():
@pytest.mark.parametrizex("filesystem", Filesystem)
def test_zero_metadata_filesystem(filesystem):
"""
title: Test for '--zero-metadata' and filesystem.
description: |
Test for '--zero-metadata' on drive with filesystem.
pass_criteria:
- Zeroing metadata on device with filesystem failed and not removed filesystem.
- Zeroing metadata on mounted device failed.
title: Test for '--zero-metadata' and filesystem.
description: |
Test for '--zero-metadata' on drive with filesystem.
pass_criteria:
- Zeroing metadata on device with filesystem failed and not removed filesystem.
- Zeroing metadata on mounted device failed.
"""
mount_point = "/mnt"

with TestRun.step("Prepare devices."):
cache_dev, core_disk, cache_disk = prepare_devices()

Expand Down Expand Up @@ -131,15 +134,16 @@ def test_zero_metadata_filesystem(filesystem):
@pytest.mark.require_disk("core", DiskTypeLowerThan("cache"))
def test_zero_metadata_dirty_data():
"""
title: Test for '--zero-metadata' and dirty data scenario.
description: |
Test for '--zero-metadata' with and without 'force' option if there are dirty data
on cache.
pass_criteria:
- Zeroing metadata without force failed on cache with dirty data.
- Zeroing metadata with force ran successfully on cache with dirty data.
- Cache started successfully after zeroing metadata on cache with dirty data.
title: Test for '--zero-metadata' and dirty data scenario.
description: |
Test for '--zero-metadata' with and without 'force' option if there are dirty data
on cache.
pass_criteria:
- Zeroing metadata without force failed on cache with dirty data.
- Zeroing metadata with force ran successfully on cache with dirty data.
- Cache started successfully after zeroing metadata on cache with dirty data.
"""

with TestRun.step("Prepare cache and core devices."):
cache_dev, core_disk, cache_disk = prepare_devices()

Expand Down Expand Up @@ -196,14 +200,14 @@ def test_zero_metadata_dirty_data():
@pytest.mark.require_disk("core", DiskTypeLowerThan("cache"))
def test_zero_metadata_dirty_shutdown():
"""
title: Test for '--zero-metadata' and dirty shutdown scenario.
description: |
Test for '--zero-metadata' with and without 'force' option on cache which had been dirty
shut down before.
pass_criteria:
- Zeroing metadata without force failed on cache after dirty shutdown.
- Zeroing metadata with force ran successfully on cache after dirty shutdown.
- Cache started successfully after dirty shutdown and zeroing metadata on cache.
title: Test for '--zero-metadata' and dirty shutdown scenario.
description: |
Test for '--zero-metadata' with and without 'force' option on cache which had been dirty
shut down before.
pass_criteria:
- Zeroing metadata without force failed on cache after dirty shutdown.
- Zeroing metadata with force ran successfully on cache after dirty shutdown.
- Cache started successfully after dirty shutdown and zeroing metadata on cache.
"""
with TestRun.step("Prepare cache and core devices."):
cache_dev, core_disk, cache_disk = prepare_devices()
Expand Down
Loading