Skip to content

TestVaultZvolTrimReclaimsBlocks always fails on EVE-KVM: /persist/vault is a ZFS dataset, not ext4-on-zvol #6471

Description

@eriknordmark

TestVaultZvolTrimReclaimsBlocks fails on its first assertion under the default parameters of the suite it belongs to, because on EVE-KVM /persist/vault is a plain ZFS dataset rather than ext4 on a zvol, and fstrim has nothing to discard.

The failure is at evetest/tests/storage/vault_trim_test.go:98, the baseline cleanup fstrim, before the test writes any data:

vault_trim_test.go:98: TEST FAILURE:
    baseline cleanup fstrim failed
    ...
    fstrim: /persist/vault: the discard operation is not supported

Why

SetupDefaultVault in pkg/pillar/vault/handler_zfs.go branches on base.IsHVTypeKube():

  • kubevirt: CreateZvolVault(...) — ext4 on a ZFS zvol, so fstrim has a DISCARD path to the zvol and the test's premise holds.
  • KVM: zfs.CreateDataset(types.SealedDataset) — a plain ZFS dataset mounted at /persist/vault. There is no ext4 layer, so fstrim fails exactly as above.

TestStorageSuite declares HYPERVISOR with default kvm, so the test takes the second branch every time it runs as part of its suite.

The test's doc comment states the opposite rationale:

Requires a ZFS node; the underlying bug was found on EVE-K (Longhorn replica churn), but the mechanism is purely a ZFS/fstrim concern and applies equally to EVE-KVM, so the hypervisor is a parameter rather than hard-coded.

The fstrim mechanism is indeed generic, but the ext4-on-zvol layout it depends on is not — it exists only on the EVE-k path.

The device also had no TPM (WithTPM unset), so the !etpm.IsTpmEnabled() branch above is the one taken. I have not traced whether the TPM-enabled path (h.setupVault()) produces a dataset or a zvol under KVM, so this report covers the TPM-less case only.

Reproduction

make evetest NAME=TestStorageSuite

Reproduced on three separate EVE images built from master f94089001 and two integration branches based on it, all -kvm-amd64. Identical subtest, identical assertion, identical error, 120-123 s each. The other 6 subtests in the suite pass on all three.

Why it has not been noticed

The test arrived with #6105, an EVE-k fix, where it does pass. grep finds no reference to TestStorageSuite or TestVaultZvolTrimReclaimsBlocks under .github/workflows/, so no CI job runs it.

Possible resolutions

  • Skip under a non-kubevirt hypervisor, alongside the existing precedent in tests/diag/diag_test.go and tests/apps/purge_replaces_vmirs_test.go for hypervisor-inapplicable tests.
  • Or hard-code WithHypervisor: evetest.HypervisorKubevirt and drop the HYPERVISOR parameter, matching where the test can actually run.

Either way the doc comment's claim about EVE-KVM needs correcting, since it is the reason the parameter is there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions