Skip to content

Commit

Permalink
misc: rename generator functions
Browse files Browse the repository at this point in the history
Rename generator functions as part of the rename mount tests to misc.

Signed-off-by: Sachin Prabhu <sp@spui.uk>
  • Loading branch information
spuiuk authored and anoopcs9 committed Jan 18, 2024
1 parent b6e8405 commit 6c0a4ee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions testcases/misc/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def setup_mount(
raise Exception(f"Teardown failed: {str(e)}")


def generate_mount_check() -> typing.List[typing.Any]:
def gen_params() -> typing.List[typing.Any]:
ipaddr = test_info["public_interfaces"][0]
exported_sharenames = test_info.get("exported_sharenames", [])
arr = []
Expand All @@ -56,5 +56,5 @@ def generate_mount_check() -> typing.List[typing.Any]:
return arr


def generate_mount_check_premounted() -> typing.List[Path]:
def gen_params_premounted() -> typing.List[Path]:
return testhelper.get_premounted_shares(test_info)
6 changes: 3 additions & 3 deletions testcases/misc/test_dbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import typing
import random
from pathlib import Path
from .conftest import generate_mount_check, generate_mount_check_premounted
from .conftest import gen_params, gen_params_premounted


class Record:
Expand Down Expand Up @@ -101,13 +101,13 @@ def _run_dbm_consistency_checks(base_path: Path) -> None:
shutil.rmtree(base_path, ignore_errors=True)


@pytest.mark.parametrize("setup_mount", generate_mount_check(), indirect=True)
@pytest.mark.parametrize("setup_mount", gen_params(), indirect=True)
def test_dbm_consistency(setup_mount: Path) -> None:
base = setup_mount / "dbm-consistency"
_run_dbm_consistency_checks(base)


@pytest.mark.parametrize("test_dir", generate_mount_check_premounted())
@pytest.mark.parametrize("test_dir", gen_params_premounted())
def test_dbm_consistency_premounted(test_dir: Path) -> None:
base = test_dir / "dbm-consistency"
_run_dbm_consistency_checks(base)
6 changes: 3 additions & 3 deletions testcases/misc/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import testhelper
import random
from pathlib import Path
from .conftest import generate_mount_check, generate_mount_check_premounted
from .conftest import gen_params, gen_params_premounted


class DataPath:
Expand Down Expand Up @@ -134,11 +134,11 @@ def _perform_io_consistency_check(directory: Path) -> None:
_check_io_consistency(directory)


@pytest.mark.parametrize("setup_mount", generate_mount_check(), indirect=True)
@pytest.mark.parametrize("setup_mount", gen_params(), indirect=True)
def test_check_io_consistency(setup_mount: Path) -> None:
_perform_io_consistency_check(setup_mount)


@pytest.mark.parametrize("test_dir", generate_mount_check_premounted())
@pytest.mark.parametrize("test_dir", gen_params_premounted())
def test_check_io_consistency_premounted(test_dir: Path) -> None:
_perform_io_consistency_check(test_dir)
6 changes: 3 additions & 3 deletions testcases/misc/test_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import threading
import testhelper
from pathlib import Path
from .conftest import generate_mount_check, generate_mount_check_premounted
from .conftest import gen_params, gen_params_premounted


def _perform_file_operations(
Expand Down Expand Up @@ -51,11 +51,11 @@ def _run_stress_tests(directory: Path) -> None:
)


@pytest.mark.parametrize("setup_mount", generate_mount_check(), indirect=True)
@pytest.mark.parametrize("setup_mount", gen_params(), indirect=True)
def test_check_mnt_stress(setup_mount: Path) -> None:
_run_stress_tests(setup_mount)


@pytest.mark.parametrize("test_dir", generate_mount_check_premounted())
@pytest.mark.parametrize("test_dir", gen_params_premounted())
def test_check_mnt_stress_premounted(test_dir: Path) -> None:
_run_stress_tests(test_dir)

0 comments on commit 6c0a4ee

Please sign in to comment.