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

Add test_provisioner_generic_ephemeral skeleton #1820

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions manager/integration/tests/test_provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ def test_provisioner_mount(client, core_api, storage_class, pvc, pod): # NOQA
assert volumes.data[0].state == "attached"


@pytest.mark.skip(reason="TODO")
def test_provisioner_generic_ephemeral():
"""
Test that a Longhorn generic ephemeral volume can be created, mounted,
unmounted, and deleted properly on the Kubernetes cluster.

1. Create a StorageClass and Pod with a generic ephemeral volume spec:
https://kubernetes.io/docs/concepts/storage/ephemeral-volumes
2. Verify:
- The Pod is running.
- The volume parameters match the StorageClass parameters.
- The volume.status.kubernetesStatus.workloadStatus reflects the
running Pod.
3. Write data to the volume using the Pod, read it back, and verify it.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add a test step attempting to write data in ephemeral volume?

Copy link
Contributor Author

@ejweber ejweber Mar 20, 2024

Choose a reason for hiding this comment

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

It definitely can't hurt, so I added it in an amend. For context, I wrote this skeleton to mirror test_provisioner_mount (directly above in the file), which does not. Importantly, we cannot follow the pattern of some other tests and read the data back from a different pod, because the life cycle of a generic ephemeral volume mirrors the life cycle of the pod it is created with.

pass


def test_provisioner_params(client, core_api, storage_class, pvc, pod): # NOQA
"""
Test that substituting different StorageClass parameters is reflected in
Expand Down