Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_pvc_snapshot make it pass with non-default namespace #11076

Open
DanielOsypenko opened this issue Dec 22, 2024 · 0 comments
Open

test_pvc_snapshot make it pass with non-default namespace #11076

DanielOsypenko opened this issue Dec 22, 2024 · 0 comments

Comments

@DanielOsypenko
Copy link
Contributor

We need to correct all tests referring to these two files:
ocs_ci/templates/CSI/rbd/snapshotclass.yaml
ocs_ci/templates/CSI/cephfs/snapshotclass.yaml

These tests should dynamically adjust fields:

clusterID
csi.storage.k8s.io/snapshotter-secret-name
csi.storage.k8s.io/snapshotter-secret-namespace

Error stack trace

[2024-11-25T22:01:10.391Z] teardown_factory = <function teardown_factory_fixture.<locals>.factory at 0x7fb714f08f70>
[2024-11-25T22:01:10.391Z] 
[2024-11-25T22:01:10.391Z]     def test_pvc_snapshot(self, interface_iterate, teardown_factory):
[2024-11-25T22:01:10.391Z]         """
[2024-11-25T22:01:10.391Z]         1. Create PVC, POD's
[2024-11-25T22:01:10.391Z]         2. Create own volumesnapshotclass
[2024-11-25T22:01:10.391Z]         3. Take a snapshot of PVC from created snapshotclass
[2024-11-25T22:01:10.391Z]         4. Delete the volumesnapshotclass used to create the above volume snapshot
[2024-11-25T22:01:10.391Z]         5. Check the status of volume snapshot
[2024-11-25T22:01:10.391Z]     
[2024-11-25T22:01:10.391Z]         """
[2024-11-25T22:01:10.391Z]     
[2024-11-25T22:01:10.391Z]         # Create own snapshotclass
[2024-11-25T22:01:10.391Z]         snapclass_obj = self.create_snapshotclass(interface=self.interface)
[2024-11-25T22:01:10.391Z]         teardown_factory(snapclass_obj)
[2024-11-25T22:01:10.391Z]     
[2024-11-25T22:01:10.391Z]         # Take a snapshot from created snapshotclass
[2024-11-25T22:01:10.391Z]         snap_yaml = (
[2024-11-25T22:01:10.391Z]             constants.CSI_CEPHFS_SNAPSHOT_YAML
[2024-11-25T22:01:10.391Z]             if self.interface == constants.CEPHFILESYSTEM
[2024-11-25T22:01:10.391Z]             else constants.CSI_RBD_SNAPSHOT_YAML
[2024-11-25T22:01:10.391Z]         )
[2024-11-25T22:01:10.391Z]         snap_name = helpers.create_unique_resource_name("test", "snapshot")
[2024-11-25T22:01:10.391Z]         snap_obj = pvc.create_pvc_snapshot(
[2024-11-25T22:01:10.391Z]             self.pvc_obj.name,
[2024-11-25T22:01:10.391Z]             snap_yaml,
[2024-11-25T22:01:10.391Z]             snap_name,
[2024-11-25T22:01:10.391Z]             self.pvc_obj.namespace,
[2024-11-25T22:01:10.391Z]             snapclass_obj.name,
[2024-11-25T22:01:10.391Z]         )
[2024-11-25T22:01:10.391Z] >       snap_obj.ocp.wait_for_resource(
[2024-11-25T22:01:10.391Z]             condition="true",
[2024-11-25T22:01:10.391Z]             resource_name=snap_obj.name,
[2024-11-25T22:01:10.391Z]             column=constants.STATUS_READYTOUSE,
[2024-11-25T22:01:10.391Z]             timeout=60,
[2024-11-25T22:01:10.391Z]         )
[2024-11-25T22:01:10.391Z] 
[2024-11-25T22:01:10.391Z] �[1m�[31mtests/functional/pv/pvc_snapshot/test_pvc_snapshot_when_snapshotclass_deleted.py�[0m:114: 
[2024-11-25T22:01:10.391Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2024-11-25T22:01:10.391Z] �[1m�[31mocs_ci/ocs/ocp.py�[0m:873: in wait_for_resource
[2024-11-25T22:01:10.391Z]     raise (ex)
[2024-11-25T22:01:10.391Z] �[1m�[31mocs_ci/ocs/ocp.py�[0m:764: in wait_for_resource
[2024-11-25T22:01:10.391Z]     for sample in TimeoutSampler(
[2024-11-25T22:01:10.391Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2024-11-25T22:01:10.391Z] 
[2024-11-25T22:01:10.391Z] self = <ocs_ci.utility.utils.TimeoutSampler object at 0x7fb70e199280>
[2024-11-25T22:01:10.391Z] 
[2024-11-25T22:01:10.391Z]     def __iter__(self):
[2024-11-25T22:01:10.391Z]         if self.start_time is None:
[2024-11-25T22:01:10.391Z]             self.start_time = time.time()
[2024-11-25T22:01:10.391Z]         while True:
[2024-11-25T22:01:10.391Z]             self.last_sample_time = time.time()
[2024-11-25T22:01:10.391Z]             if self.timeout <= (self.last_sample_time - self.start_time):
[2024-11-25T22:01:10.391Z] >               raise self.timeout_exc_cls(*self.timeout_exc_args)
[2024-11-25T22:01:10.391Z] �[1m�[31mE               ocs_ci.ocs.exceptions.TimeoutExpiredError: Timed out after 60s running get("snapshot-test-08b63a5648624e72b39d69eb68", True, None)�[0m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant