Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-71188

Fix test_vm_starting_status_metrics to work with dynamic provisioners

XMLWordPrintable

    • Quality / Stability / Reliability
    • 0.42
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • None

      Problem

      The test tests/observability/metrics/test_vms_metrics.py::TestVMStatusLastTransitionMetrics::test_vm_starting_status_metrics uses a PVC with pvlabel selector to keep a VM stuck in starting state:

      @pytest.fixture()
      def pvc_for_vm_in_starting_state(namespace):
      with PersistentVolumeClaim(
      name="vm-in-starting-state-pvc",
      namespace=namespace.name,
      accessmodes=PersistentVolumeClaim.AccessMode.RWX,
      size="1Gi",
      pvlabel="non-existent-pv", # ❌ Not supported by dynamic provisioners
      ) as pvc:
      yield pvc
      

      Issue: Dynamic provisioners do not support the claimSelector field (pvlabel), causing the test to fail in most modern OpenShift environments. The test only works with hostpath-csi-basic which is not an official valid storage Class: https://github.com/kubernetes-csi/csi-driver-host-path?tab=readme-ov-file#warning-this-driver-is-just-a-demo-implementation-and-is-used-for-ci-testing-this-has-many-fake-implementations-and-other-non-standard-best-practices-and-should-not-be-used-as-an-example-of-how-to-write-a-real-driver

      Solution

      It is required to look for a different way to keep a VM in starting status that can work with a dinamic provider, like for example the ones used by the storageClass ocs-storagecluster-ceph-rbd-virtualization.

      If that is not possible, the test should be forced to run only with hostpath-csi-basic.

              rlobillo Ramón Lobillo
              rlobillo Ramón Lobillo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: