diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 9682476923..2d55b06a7a 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -29,7 +29,7 @@ jobs: checks-with-ci-repo: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies for Fedora @@ -51,7 +51,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Check out ci repo run: git clone https://github.com/stratis-storage/ci.git - name: Run comparisons of version specs with available Fedora packages diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index c0042703e4..99bc34ab7e 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: @@ -40,43 +40,43 @@ jobs: matrix: include: - task: make -f Makefile clippy - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: clippy - task: PROFILEDIR=debug make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile stratis-dumpmetadata - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile docs-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile test - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: >- TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev steps: - uses: actions/checkout@v3 @@ -107,11 +107,11 @@ jobs: matrix: include: - task: RUST_LOG=stratisd=debug make -f Makefile test-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev --ipc=host steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e7e2ff937..392ae483a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: @@ -40,14 +40,14 @@ jobs: matrix: include: - task: make -f Makefile fmt-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: rustfmt - task: make -f Makefile check-typos - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev steps: - uses: actions/checkout@v3 @@ -83,9 +83,9 @@ jobs: TANG_URL=tang RUST_LOG=stratisd=debug make -f Makefile test-clevis-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT runs-on: ubuntu-22.04 container: image: ${{ matrix.image }} @@ -93,7 +93,7 @@ jobs: services: tang: # yamllint disable rule:line-length - image: ghcr.io/stratis-storage/stratisd/tang:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: ghcr.io/stratis-storage/stratisd/tang:38 credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -184,7 +184,7 @@ jobs: stratis-min-cli-checks: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged --userns=host --ipc=host -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1 steps: - uses: actions/checkout@v3 @@ -217,7 +217,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Run stratisd-min cli tests run: make test-stratisd-min - name: Run stratis-min cli tests @@ -226,7 +226,7 @@ jobs: shell-checks: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies @@ -241,7 +241,7 @@ jobs: python-based-tests: runs-on: ubuntu-22.04 container: - image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev steps: - uses: actions/checkout@v3 @@ -267,7 +267,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: components: cargo - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN - name: Build stratisd run: PROFILEDIR=debug make -f Makefile build-all - name: Install stratisd diff --git a/.github/workflows/support.yml b/.github/workflows/support.yml index f40009bd9d..19cbcaaa1d 100644 --- a/.github/workflows/support.yml +++ b/.github/workflows/support.yml @@ -8,6 +8,9 @@ on: branches: - patch-3.6.0 paths: + - ".packit.yaml" + - "plans/**" + - "tests-fmf/**" - "**/*.yml" - "tests/**" - "!tests/**/README.*" @@ -15,6 +18,9 @@ on: branches: - patch-3.6.0 paths: + - ".packit.yaml" + - "plans/**" + - "tests-fmf/**" - "**/*.yml" - "tests/**" - "!tests/**/README.*" @@ -49,7 +55,7 @@ jobs: task: make -f Makefile yamllint tmtlint working-directory: . runs-on: ubuntu-22.04 - container: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT + container: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT steps: - uses: actions/checkout@v3 - name: Install dependencies diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 57778d63fd..20eacd3b44 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -13,7 +13,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' pull_request: branches: - patch-3.6.0 @@ -24,7 +24,7 @@ on: - 'tests/**' - '.packit.yaml' - 'plans/**' - - 'test/**' + - 'tests-fmf/**' workflow_dispatch: @@ -40,34 +40,34 @@ jobs: matrix: include: - task: make -f Makefile clippy - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: clippy - task: PROFILEDIR=debug make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: PROFILEDIR=debug make -f Makefile stratis-dumpmetadata - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile docs-ci - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile test - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-min - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo - task: make -f Makefile build-no-ipc - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: @@ -105,7 +105,7 @@ jobs: matrix: include: - task: RUST_LOG=stratisd=debug make -f Makefile test-loop - toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + toolchain: 1.74.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN components: cargo runs-on: ubuntu-22.04 container: diff --git a/.packit.yaml b/.packit.yaml index bb3d31e1c4..cf30df4a2f 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -30,28 +30,28 @@ jobs: - job: copr_build trigger: pull_request targets: - - fedora-rawhide + - fedora-all - job: tests identifier: local trigger: pull_request targets: - - fedora-rawhide + - fedora-all # run Cockpit storage tests, see plans/ with `cockpit == yes` - job: tests identifier: cockpit trigger: pull_request - notifications: - failure_comment: - message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check." targets: - - fedora-development + - fedora-development + notifications: + failure_comment: + message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check." tf_extra_params: - environments: - - artifacts: - - type: repository-file - id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo - tmt: - context: - plan: "cockpit" + environments: + - artifacts: + - type: repository-file + id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo + tmt: + context: + plan: "cockpit" diff --git a/CHANGES.txt b/CHANGES.txt index 59f5e2d964..26a4c867a5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,26 @@ +stratisd 3.6.3 +============== +Recommended Rust toolchain version: 1.74.0 +Recommended development platform for Python development: Fedora 39 + +- Cherry-picked commits: + * Fix clippy 1.74 errors + * packit.yaml: fix indentation + * support.yml: trigger on packit and tmt changes + * Fix up excludes for tests-fmf + * Re-indent .packit.yaml + * github actions: update recommended Rust to 1.74.0 + * Tidy up targets key + * Use fedora-all for our tests + * Advance current development environment to Fedora 39 + * Leave tang container as F38 + * Apply formatting changes from black 23.7.0 + * Remove obsolete parameter + * Unconditionally add nrext64=0 to inode options + * Check the mkfs.xfs version + * Use semver crate to compare versions + + stratisd 3.6.2 ============== Recommended Rust toolchain version: 1.73.0 diff --git a/Cargo.lock b/Cargo.lock index d3554b3ce1..1406bc0aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1269,7 +1269,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stratisd" -version = "3.6.2" +version = "3.6.3" dependencies = [ "assert_cmd", "assert_matches", @@ -1305,6 +1305,7 @@ dependencies = [ "rand", "regex", "retry", + "semver", "serde", "serde_derive", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 8bf774527d..57ac93887c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stratisd" -version = "3.6.2" +version = "3.6.3" authors = ["Stratis Developers "] edition = "2021" rust-version = "1.71.1" # LOWEST SUPPORTED RUST TOOLCHAIN @@ -175,6 +175,10 @@ version = "1.3.1" default-features = false optional = true +[dependencies.semver] +version = "1.0.0" +optional = true + [dependencies.serde] version = "1.0.185" optional = true @@ -256,6 +260,7 @@ engine = [ "rand", "regex", "retry", + "semver", "serde", "serde_derive", "serde_json", diff --git a/src/engine/strat_engine/backstore/crypt/shared.rs b/src/engine/strat_engine/backstore/crypt/shared.rs index 0ff10103f2..bc79ee158c 100644 --- a/src/engine/strat_engine/backstore/crypt/shared.rs +++ b/src/engine/strat_engine/backstore/crypt/shared.rs @@ -559,8 +559,8 @@ fn tang_dispatch(json: &Value) -> StratisResult { })?; let mut key = keys .iter() + .find(|&obj| obj.get("key_ops") == Some(&Value::Array(vec![Value::from("verify")]))) .cloned() - .find(|obj| obj.get("key_ops") == Some(&Value::Array(vec![Value::from("verify")]))) .ok_or_else(|| { StratisError::Msg("Verification key not found in clevis metadata".to_string()) })?; diff --git a/src/engine/strat_engine/cmd.rs b/src/engine/strat_engine/cmd.rs index 764548fb09..5a5e6241ae 100644 --- a/src/engine/strat_engine/cmd.rs +++ b/src/engine/strat_engine/cmd.rs @@ -25,6 +25,7 @@ use std::{ use either::Either; use libc::c_uint; use libcryptsetup_rs::SafeMemHandle; +use semver::{Version, VersionReq}; use serde_json::Value; use devicemapper::{MetaBlocks, Sectors}; @@ -232,13 +233,70 @@ fn get_clevis_executable(name: &str) -> StratisResult { } } +// Return the mkfs.xfs version reported by the "-V" option as a string. +fn get_mkfs_xfs_version() -> StratisResult { + let mut command = Command::new(get_executable(MKFS_XFS).as_os_str()) + .arg("-V") + .stdout(Stdio::piped()) + .spawn()?; + command.wait()?; + + let mut output = String::new(); + let is_ok = command.wait()?.code() == Some(0); + command + .stdout + .ok_or_else(|| { + StratisError::Msg("Could not read string value from xfs.mkfs output".to_string()) + })? + .read_to_string(&mut output)?; + + if is_ok { + output + .trim() + .strip_prefix("mkfs.xfs version ") + .ok_or_else(|| { + StratisError::Msg("Could not parse version string from mkfs.xfs output".to_string()) + }) + .map(|v| v.to_string()) + } else { + Err(StratisError::Msg( + "\"mkfs.xfs -V\" returned an error".to_string(), + )) + } +} + /// Create a filesystem on devnode. If uuid specified, set the UUID of the -/// filesystem on creation. If 'noalign', set the noalign option. -/// NOTE: It used to be desirable to set the noalign option when creating the -/// MDV, because it was very small; since then the size of the MDV has been -/// increased, and it is no longer necessary to pass the noalign option when -/// creating the MDV. -pub fn create_fs(devnode: &Path, uuid: Option, noalign: bool) -> StratisResult<()> { +/// filesystem on creation. +pub fn create_fs(devnode: &Path, uuid: Option) -> StratisResult<()> { + // If the version can not be obtained, which is unlikely, assume that the + // version of mkfs.xfs is new enough to use the nrext64 option. This will + // become more and more true with time. If the version is not high enough, + // this will be obvious when the command-line invocation fails. + // The nrext64 option became available in xfsprogs 5.19.0-rc0 and the + // larger extent counter size began to be used by default in xfsprogs + // 6.5.0. This code sets the option when the xfsprogs version is at least + // 6.0.0, i.e., slightly after it was introduced and a deal before it + // became the default. + let use_nrext64_option = match get_mkfs_xfs_version().and_then(|v| { + v.parse::() + .map_err(|_| { + StratisError::Msg(format!( + "Unable to parse version number from version string {v}" + )) + }) + .map(|v| { + VersionReq::parse(">=6.0.0") + .expect("req string is valid") + .matches(&v) + }) + }) { + Ok(val) => val, + Err(err) => { + warn!("Unable to read version of mkfs.xfs: {err}; guessing that mkfs.xfs version is high enough to support nrext64 option"); + true + } + }; + let mut command = Command::new(get_executable(MKFS_XFS).as_os_str()); command.arg("-f"); command.arg("-q"); @@ -248,10 +306,17 @@ pub fn create_fs(devnode: &Path, uuid: Option, noalign: bool) -> St command.arg("-m"); command.arg(format!("uuid={uuid}")); } - if noalign { - command.arg("-d"); - command.arg("noalign"); + + // Use smaller size extent counters. Note that the size of the extent + // counters can be increased using an xfs_repair command, although this can + // be a costly operation. If a filesystem is created with the larger size + // extent counters, which is the default for mkfs.xfs >= 6.0.0, then it + // will be unmountable on kernels which do not support the larger size. + if use_nrext64_option { + command.arg("-i"); + command.arg("nrext64=0"); } + execute_cmd(&mut command) } diff --git a/src/engine/strat_engine/liminal/identify.rs b/src/engine/strat_engine/liminal/identify.rs index 938fc8b74b..ca6acb08d9 100644 --- a/src/engine/strat_engine/liminal/identify.rs +++ b/src/engine/strat_engine/liminal/identify.rs @@ -699,7 +699,7 @@ mod tests { } for path in paths { - create_fs(path, None, false).unwrap(); + create_fs(path, None).unwrap(); let device_path = DevicePath::new(path).expect("our test path"); assert_eq!( block_device_apply(&device_path, process_stratis_device) diff --git a/src/engine/strat_engine/thinpool/filesystem.rs b/src/engine/strat_engine/thinpool/filesystem.rs index 8248336c65..a93fd9dab5 100644 --- a/src/engine/strat_engine/thinpool/filesystem.rs +++ b/src/engine/strat_engine/thinpool/filesystem.rs @@ -88,7 +88,7 @@ impl StratFilesystem { let mut thin_dev = ThinDev::new(get_dm(), &dm_name, Some(&dm_uuid), size, thinpool_dev, id)?; - if let Err(err) = create_fs(&thin_dev.devnode(), Some(StratisUuid::Fs(fs_uuid)), false) { + if let Err(err) = create_fs(&thin_dev.devnode(), Some(StratisUuid::Fs(fs_uuid))) { if let Err(err2) = retry_with_index(Fixed::from_millis(100).take(4), |i| { trace!( "Cleanup new thin device after failed create_fs() attempt {}", diff --git a/src/engine/strat_engine/thinpool/mdv.rs b/src/engine/strat_engine/thinpool/mdv.rs index df27253f54..56687f950a 100644 --- a/src/engine/strat_engine/thinpool/mdv.rs +++ b/src/engine/strat_engine/thinpool/mdv.rs @@ -52,7 +52,7 @@ impl MetadataVol { /// Initialize a new Metadata Volume. pub fn initialize(pool_uuid: PoolUuid, dev: LinearDev) -> StratisResult { - create_fs(&dev.devnode(), Some(StratisUuid::Pool(pool_uuid)), false)?; + create_fs(&dev.devnode(), Some(StratisUuid::Pool(pool_uuid)))?; MetadataVol::setup(pool_uuid, dev) } diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index 60857dae01..df7f446cb7 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2603,7 +2603,7 @@ mod tests { let mut file = OpenOptions::new() .create(true) .write(true) - .open(&new_file) + .open(new_file) .unwrap(); let mut bytes_written = Bytes(0); // Write 400 * IEC::Mi diff --git a/tests/client-dbus/tests/udev/_loopback.py b/tests/client-dbus/tests/udev/_loopback.py index b05c61f686..94e0a27cca 100644 --- a/tests/client-dbus/tests/udev/_loopback.py +++ b/tests/client-dbus/tests/udev/_loopback.py @@ -207,7 +207,7 @@ def destroy_devices(self): Detach loopbacks and remove backing files :return: """ - for (device, backing_file) in self.devices.values(): + for device, backing_file in self.devices.values(): if device is not None: subprocess.check_call([_LOSETUP_BIN, "-d", device]) os.remove(backing_file) diff --git a/tests/client-dbus/tests/udev/_utils.py b/tests/client-dbus/tests/udev/_utils.py index fed1114d59..88a5067f64 100644 --- a/tests/client-dbus/tests/udev/_utils.py +++ b/tests/client-dbus/tests/udev/_utils.py @@ -326,7 +326,7 @@ def __enter__(self): :raises RuntimeError: if setting a key in the keyring through stratisd fails """ - for (key_desc, key_data) in self._key_descs: + for key_desc, key_data in self._key_descs: with NamedTemporaryFile(mode="w") as temp_file: temp_file.write(key_data) temp_file.flush() @@ -349,7 +349,7 @@ def __enter__(self): def __exit__(self, exception_type, exception_value, traceback): try: - for (key_desc, _) in reversed(self._key_descs): + for key_desc, _ in reversed(self._key_descs): (_, return_code, message) = Manager.Methods.UnsetKey( get_object(TOP_OBJECT), {"key_desc": key_desc} ) diff --git a/tests/client-dbus/tests/udev/test_predict.py b/tests/client-dbus/tests/udev/test_predict.py index 347c7577bd..be8227447a 100644 --- a/tests/client-dbus/tests/udev/test_predict.py +++ b/tests/client-dbus/tests/udev/test_predict.py @@ -117,7 +117,11 @@ def _possibly_add_filesystems(pool_object_path, *, fs_specs=None): if not real: raise RuntimeError("Failed to get pool usage before creating filesystems.") - (_, return_code, message,) = Pool.Methods.CreateFilesystems( + ( + _, + return_code, + message, + ) = Pool.Methods.CreateFilesystems( pool_proxy, {"specs": map(lambda x: (x[0], (True, str(x[1].magnitude))), fs_specs)}, )