From 4491277ba776e3d1e201a0161201ff7200df31cb Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 5 Aug 2024 16:35:05 -0400 Subject: [PATCH] Use legacy pool for prediction tests Signed-off-by: mulhern --- .github/workflows/nightly.yml | 7 ++++++- src/bin/utils/cmds.rs | 6 ++++++ tests/client-dbus/tests/udev/test_predict.py | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 57e8104b3c..af5e387387 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -195,7 +195,9 @@ jobs: matrix: include: - toolchain: 1.80.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - - toolchain: 1.71.1 # LOWEST SUPPORTED RUST TOOLCHAIN + legacy: LEGACY_POOL=../../target/debug/stratis-legacy-pool + - toolchain: 1.80.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + legacy: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -239,12 +241,15 @@ jobs: run: sudo cp stratisd.conf /usr/share/dbus-1/system.d - name: Reload udev run: sudo udevadm control --reload + - name: Build test extras + run: PROFILEDIR=debug make -f Makefile build-test-extras - name: Tests using Rust ${{ matrix.toolchain }} run: > sudo make RUST_LOG=stratisd=debug STRATISD=/usr/libexec/stratisd STRATIS_PREDICT_USAGE=/usr/bin/stratis-predict-usage + ${{ matrix.legacy }} PYTHONPATH=./src predict-tests working-directory: ./tests/client-dbus diff --git a/src/bin/utils/cmds.rs b/src/bin/utils/cmds.rs index 3aed22a87d..37b1b36e1f 100644 --- a/src/bin/utils/cmds.rs +++ b/src/bin/utils/cmds.rs @@ -45,6 +45,12 @@ impl StratisPredictUsage { .subcommands(vec![ Command::new("pool") .about("Predicts the space usage when creating a Stratis pool.") + .arg(Arg::new("metadata-version") + .long("metadata-version") + .default_value("1") + .help("Stratis metadata version") + .value_parser(["1", "2"]) + ) .arg(Arg::new("encrypted") .long("encrypted") .action(ArgAction::SetTrue) diff --git a/tests/client-dbus/tests/udev/test_predict.py b/tests/client-dbus/tests/udev/test_predict.py index 87dab41b59..7e5e468f51 100644 --- a/tests/client-dbus/tests/udev/test_predict.py +++ b/tests/client-dbus/tests/udev/test_predict.py @@ -37,6 +37,7 @@ from stratisd_client_dbus._constants import TOP_OBJECT from ._utils import ( + _LEGACY_POOL, OptionalKeyServiceContextManager, ServiceContextManager, UdevTest, @@ -47,6 +48,7 @@ _STRATIS_PREDICT_USAGE = os.environ["STRATIS_PREDICT_USAGE"] # Filesystem size limit should be no more than three times actual size _FILESYSTEM_MULT_LIMIT = 3 +_METADATA_VERSION = 2 if _LEGACY_POOL is None else 1 def _call_predict_usage(encrypted, device_sizes, *, fs_specs=None, overprovision=True): @@ -62,6 +64,7 @@ def _call_predict_usage(encrypted, device_sizes, *, fs_specs=None, overprovision """ with subprocess.Popen( [_STRATIS_PREDICT_USAGE, "pool"] + + [f"--metadata-version={_METADATA_VERSION}"] + [f"--device-size={size}" for size in device_sizes] + ( []