Skip to content

Conversation

rushikeshjadhav
Copy link
Contributor

@rushikeshjadhav rushikeshjadhav commented Jul 8, 2025

Incorporating image-format fixture into following SR types for storage tests

  • ext
  • lvm
  • xfs
  • zfs
  • largeblock

@rushikeshjadhav rushikeshjadhav marked this pull request as draft July 8, 2025 12:26
@rushikeshjadhav rushikeshjadhav requested a review from Nambrok July 10, 2025 12:21
@rushikeshjadhav rushikeshjadhav force-pushed the storage-qcow2 branch 2 times, most recently from 1d35ab2 to da6c5d5 Compare September 18, 2025 17:35
@rushikeshjadhav rushikeshjadhav marked this pull request as ready for review September 18, 2025 17:41
@glehmann glehmann self-requested a review September 30, 2025 13:06
Comment on lines 26 to 29
sr = host.sr_create('zfs-vol', "ZFS-local-SR-test", {
'device': '/dev/' + sr_disk_wiped,
'preferred-image-formats': image_format
}, verify=True)
Copy link
Member

@Wescoeur Wescoeur Sep 30, 2025

Choose a reason for hiding this comment

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

Did you test it @rushikeshjadhav ? We don't support QCOW2 with ZFS vol driver (SMAPIv3 plugin).
So we must not add image_format for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, although the test passes, its volume is not of qcow2 format. Will remove it and add additional checks for qcow2 VDI validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added additional check for qcow2 VDI validation as well with test_vdi_image_format.

@rushikeshjadhav rushikeshjadhav force-pushed the storage-qcow2 branch 3 times, most recently from 38db6d5 to 79264c0 Compare October 1, 2025 14:32
@rushikeshjadhav rushikeshjadhav marked this pull request as draft October 1, 2025 14:37
def ext_sr(host: Host, unused_512B_disks: dict[Host, list[Host.BlockDeviceInfo]]) -> Generator[SR]:
def ext_sr(host: Host,
unused_512B_disks: dict[Host, list[Host.BlockDeviceInfo]],
image_format) -> Generator[SR]:
Copy link
Member

Choose a reason for hiding this comment

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

Could you add the type on image_format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, added here and other possible places.

@rushikeshjadhav rushikeshjadhav marked this pull request as ready for review October 2, 2025 12:35
@glehmann
Copy link
Member

glehmann commented Oct 2, 2025

The CI workflow is not run on the PR. We should run it before merging.

@glehmann
Copy link
Member

glehmann commented Oct 2, 2025

There are a few problems to fix:

❯ mypy --install-types --non-interactive lib/ conftest.py pkgfixtures.py tests/
  pyright lib/ conftest.py pkgfixtures.py
  ruff check lib/ tests/
  flake8
tests/install/test.py:88: error: Value of type "object" is not indexable  [index]
tests/install/test.py:342: error: Value of type "object" is not indexable  [index]
Found 2 errors in 1 file (checked 191 source files)
WARNING: there is a new pyright version available (v1.1.402 -> v1.1.406).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`

0 errors, 0 warnings, 0 informations
All checks passed!
./tests/storage/largeblock/conftest.py:17:19: E128 continuation line under-indented for visual indent

@glehmann
Copy link
Member

glehmann commented Oct 2, 2025

@rushikeshjadhav the CI should run when using a branch directly in this repository.

Copy link
Member

@stormi stormi left a comment

Choose a reason for hiding this comment

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

Automatically installing packages that support qcow2 could have been a good idea, but here it might cause more friction than it avoids.

def check_qcow2_installed(host):
if host.file_exists(QCOW2_REPO_FILE):
raise Exception(
f'{QCOW2_REPO_FILE} is already installed on host {host}. This should not be the case.'
Copy link
Member

Choose a reason for hiding this comment

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

I see where this comes from, but that doesn't work here. We want to keep the ability to install any packages on the test hosts, and the test must not tell us what to do here. It's different from the xostor case which is already a production feature and is tested using what's in the dedicated test repositories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was in an effort to keep the test standalone and work on unmodified host. We can remove it if it does not go inline with the test framework. Removing it would mean, the test would work even in case of manual preinstalled qcow2.

Copy link
Member

Choose a reason for hiding this comment

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

I discussed it with others and, yes, we prefer that the test just assumes that qcow2 is available if we ask for qcow2 tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now removed.

def remove_qcow2(host):
logging.info(f"Cleaning up qcow2 packages from host {host}...")
host.remove_xcpng_repo(QCOW2_REPO)
host.yum_downgrade(["sm", "sm-fairlock", "blktap"])
Copy link
Member

@stormi stormi Oct 2, 2025

Choose a reason for hiding this comment

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

This is going to leave the hosts in a state that is not necessarily the initial state. You don't know if the contents enabled repositories match what we decided to install on the hosts to run the tests on it.

In addition to this, all this code will soon have to be deleted, once qcow2 packages are moved to the main testing repositories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, restoring yum saved state would be better in such case.

Once the qcow2 packages are moved to the main testing repo, we’ll still need to install them during tests or manually pre-tests, right? Or is the plan to merge the packages so that no separate installation of qcow2-related packages is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned earlier, it is assumed that qcow2 is installed and no specific package management is expected from the test, so removing this as well.

@rushikeshjadhav
Copy link
Contributor Author

@rushikeshjadhav the CI should run when using a branch directly in this repository.

I have pushed to https://github.com/xcp-ng/xcp-ng-tests/tree/storage-qcow2, will check on CI.

… format

Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com>
… format

Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com>
… format

Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com>
… format

Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com>
…cow2 vdi image format

Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com>
@rushikeshjadhav
Copy link
Contributor Author

@rushikeshjadhav the CI should run when using a branch directly in this repository.

I have pushed to https://github.com/xcp-ng/xcp-ng-tests/tree/storage-qcow2, will check on CI.

This is found to be working. Kindly see @Wescoeur @Nambrok if it can be merged.

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.

6 participants