Skip to content

CP-311612/CP-311613: make quicktests work if local storage is SMAPIv3#6908

Merged
edwintorok merged 2 commits intoxapi-project:masterfrom
edwintorok:private/edvint/quicktest-smapiv3
Mar 4, 2026
Merged

CP-311612/CP-311613: make quicktests work if local storage is SMAPIv3#6908
edwintorok merged 2 commits intoxapi-project:masterfrom
edwintorok:private/edvint/quicktest-smapiv3

Conversation

@edwintorok
Copy link
Copy Markdown
Member

Want to run quicktest on wider range of hardware, and some of them have a SMAPIv3 local SR, which identified some bugs in the quicktest.

Before:

┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL]        cbt          0   vdi_data_destroy_test on SR [Local storage].  │
└──────────────────────────────────────────────────────────────────────────────┘
Enabling CBT on original VDI
ASSERT VDI.enable_cbt failed
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
Snapshotting original VDI with CBT enabled
ASSERT VDI.snapshot failed, cbt_enabled field didn't carry over
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
Disabling CBT on original VDI
ASSERT VDI.disable_cbt failed
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
Snapshotting original VDI with CBT disabled
ASSERT VDI.snapshot failed, cbt_enabled field didn't carry over
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
ASSERT VDI field cbt_enabled should be the same
ASSERT VDI field is_a_snapshot should be the same
ASSERT VDI field location should be the same
ASSERT VDI field managed should be the same
ASSERT VDI field name_description should be the same
ASSERT VDI field name_label should be the same
ASSERT VDI field snapshot_of should be the same
ASSERT VDI field snapshot_time should be the same
ASSERT VDI field virtual_size should be the same
Destroying snapshot VDI data
ASSERT VDI.data_destroy failed to update VDI.type
ASSERT VDI snapshot cbt_enabled field erroneously set to false
[exception] Not_found
            Raised at Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 39, characters 6-15
            Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 186, characters 17-23
            Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
│ [FAIL]        Quicktest_vdi_ops_data_integrity         12   VDI delta ex...  │
└──────────────────────────────────────────────────────────────────────────────┘
$ xe vdi-export uuid=60d45001-30c6-43a6-8cef-15667f2bf094 filename=/tmp/quicktest_export_60d45001-30c6-43a6-8cef-15667f2bf094 format=vhd base=984b7036-a9c1-40e6-9d55-dee56865c34a
ASSERT CLI failed: exit code=1 output=[] log=[The server failed to handle your request, due to an internal error. The given message may give details useful for debugging the problem.
message: Failure("Cannot compute differences on non-VHD images")
]
FAIL CLI failed: exit code=1 output=[] log=[The server failed to handle your request, due to an internal error. The given message may give details useful for debugging the problem.
message: Failure("Cannot compute differences on non-VHD images")
]
Raised at Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 39, characters 6-15
Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 186, characters 17-23
Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35

After:

./quicktest.exe -default-sr -run-only cbt
qcheck random seed: 971045138
Choosing template with name: Other install media
Choosing template with name: Other install media
Testing `Quicktests'.
This run has ID `VH4PCGGU'.

  [OK]          cbt          0   vdi_data_destroy_test on SR [Local storage].
  [OK]          cbt          1   vdi_clone_copy_test on SR [Local storage].
./quicktest.exe -default-sr -run-only Quicktest_vdi_ops_data_integrity
qcheck random seed: 333465499
Choosing template with name: Other install media
Choosing template with name: Other install media
Testing `Quicktests'.
This run has ID `QVNOMOLZ'.

  [OK]          Quicktest_vdi_ops_data_integrity          0   VDI.copy: small empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          1   VDI.copy: small random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          2   VDI.copy: small full VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          3   VDI.copy: ~2GiB empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          4   VDI.copy: ~2GiB random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          5   VDI export/import to/from raw file: small empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          6   VDI export/import to/from raw file: small random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          7   VDI export/import to/from raw file: small full VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          8   VDI export/import to/from VHD file: small empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity          9   VDI export/import to/from VHD file: small random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         10   VDI export/import to/from VHD file: small full VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         11   VDI export/import to/from TAR file: small empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         12   VDI export/import to/from TAR file: small random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         13   VDI export/import to/from TAR file: small full VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         14   VDI export/import to/from QCOW file: small empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         15   VDI export/import to/from QCOW file: small random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         16   VDI export/import to/from QCOW file: small full VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         17   VDI delta export/import to/from QCOW file: delta between empty & empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         18   VDI delta export/import to/from QCOW file: delta between random & empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         19   VDI delta export/import to/from QCOW file: delta between random & random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         20   VDI delta export/import to/from QCOW file: delta between full and empty VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         21   VDI delta export/import to/from QCOW file: delta between full and random VDI on SR [Local storage].
  [OK]          Quicktest_vdi_ops_data_integrity         22   VDI delta export/import to/from QCOW file: delta between full and full VDI on SR [Local storage].

Full test results in `~/_build/_tests/Quicktests'.
Test Successful in 226.332s. 23 tests run.

This seems to be a SMAPIv1 specific implementation detail (content_id in
VDI.other-config), that is missing on SMAPIv3 SRs.

The rest of the test works on SMAPIv3, so skip just this step.

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
VHD export takes various shortcuts, and delta export only works if the source is also VHD.
Otherwise it fails with:
`Failure("Cannot compute differences on non-VHD images")`

If the source is already qcow2, like for SMAPIv3, then this is not (yet)
expected to work, so skip those tests on SMAPIv3 for now.

Note that regular export works, it is just the delta export that fails (specifying `base=`
in `xe vdi-export`).

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
@edwintorok edwintorok force-pushed the private/edvint/quicktest-smapiv3 branch from 4307165 to 8ac4476 Compare February 12, 2026 14:29
Qt_filter.SR.(all |> allowed_operations [`vdi_create; `vdi_destroy] |> not_iso)

let supported_srs test_case =
let supported_srs ?(f = Fun.id) test_case =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is f the best name? Is this some filter or selector?

@psafont
Copy link
Copy Markdown
Member

psafont commented Feb 19, 2026

Can this be backported to 26.1?

@lindig
Copy link
Copy Markdown
Contributor

lindig commented Mar 2, 2026

@edwintorok merge this?

@edwintorok edwintorok added this pull request to the merge queue Mar 4, 2026
Merged via the queue into xapi-project:master with commit 8257d10 Mar 4, 2026
28 checks passed
@edwintorok edwintorok deleted the private/edvint/quicktest-smapiv3 branch March 13, 2026 15:32
github-merge-queue bot pushed a commit that referenced this pull request Mar 20, 2026
…M branch (#6959)

Backport #6908 to the LCM
branch.
These latent bugs have existed in the tests for a long time, but
previously our test system (XenRT) picked machines randomly, so it
would've been unlikely to pick a machine which has a local 4K SR
(SMAPIv3 instead of SMAPIv1), and even if it did, the test would
seemingly pass on a rerun (because another machine would get picked).
We are now explicitly running the test multiple times on different
hardware categories, and some of those tests are now failing 100% of the
time.
last-genius added a commit to last-genius/xen-api that referenced this pull request Apr 9, 2026
Sort of a follow-up to xapi-project#6908, which filtered out SRs that only offer QCOW2
backing files. This commit allows running delta tests on SRs that offer both
QCOW2 and VHD backing files (with QCOW2 as the default).

Not specifying the format on SRs with default image format=qcow2 breaks
delta tests for VHD (since they require two vhd images to calculate
differences between).

Force the format in VDI.create through sm-config instead. The sm-config
parameter is ignored if it's not supported (i.e. on XenServer VHD-only
SMAPIv1 SRs).

Force format=vhd for max_vdi_size tests as well, since they're only exporting
to vhd (and testing its max size), this speeds up the tests.

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
last-genius added a commit to xcp-ng/xen-api that referenced this pull request Apr 9, 2026
Sort of a follow-up to xapi-project#6908, which filtered out SRs that only offer QCOW2
backing files. This commit allows running delta tests on SRs that offer both
QCOW2 and VHD backing files (with QCOW2 as the default).

Not specifying the format on SRs with default image format=qcow2 breaks
delta tests for VHD (since they require two vhd images to calculate
differences between).

Force the format in VDI.create through sm-config instead. The sm-config
parameter is ignored if it's not supported (i.e. on XenServer VHD-only
SMAPIv1 SRs).

Force format=vhd for max_vdi_size tests as well, since they're only exporting
to vhd (and testing its max size), this speeds up the tests.

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
last-genius added a commit to last-genius/xen-api that referenced this pull request Apr 9, 2026
Sort of a follow-up to xapi-project#6908, which filtered out SRs that only offer QCOW2
backing files. This commit allows running delta tests on SRs that offer both
QCOW2 and VHD backing files (with QCOW2 as the default).

Not specifying the format on SRs with default image format=qcow2 breaks
delta tests for VHD (since they require two vhd images to calculate
differences between).

Force the format in VDI.create through sm-config instead. The sm-config
parameter is ignored if it's not supported (i.e. on XenServer VHD-only
SMAPIv1 SRs).

Force format=vhd for max_vdi_size tests as well, since they're only exporting
to vhd (and testing its max size), this speeds up the tests.

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
github-merge-queue bot pushed a commit that referenced this pull request Apr 9, 2026
Sort of a follow-up to #6908, which filtered out SRs that only offer
QCOW2 backing files. This commit allows running delta tests on SRs that
offer both QCOW2 and VHD backing files (with QCOW2 as the default).

Not specifying the format on SRs with default image format=qcow2 breaks
delta tests for VHD (since they require two vhd images to calculate
differences between).

Force the format in VDI.create through sm-config instead. The sm-config
parameter is ignored if it's not supported (i.e. on XenServer VHD-only
SMAPIv1 SRs).

Force format=vhd for max_vdi_size tests as well, since they're only
exporting to vhd (and testing its max size), this speeds up the tests.
last-genius added a commit to last-genius/xen-api that referenced this pull request Apr 9, 2026
Sort of a follow-up to xapi-project#6908, which filtered out SRs that only offer QCOW2
backing files. This commit allows running delta tests on SRs that offer both
QCOW2 and VHD backing files (with QCOW2 as the default).

Not specifying the format on SRs with default image format=qcow2 breaks
delta tests for VHD (since they require two vhd images to calculate
differences between).

Force the format in VDI.create through sm-config instead. The sm-config
parameter is ignored if it's not supported (i.e. on XenServer VHD-only
SMAPIv1 SRs).

Force format=vhd for max_vdi_size tests as well, since they're only exporting
to vhd (and testing its max size), this speeds up the tests.

Cherry-picked from c3ac00b

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants