generated from canonical/is-charms-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ceph k8s-info integration * add ceph integration test
- Loading branch information
Showing
7 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
name: integration-test-ceph | ||
description: |- | ||
Used to deploy or refresh within an integration test model | ||
series: jammy | ||
applications: | ||
k8s: | ||
charm: k8s | ||
channel: latest/edge | ||
constraints: cores=2 mem=8G root-disk=16G | ||
num_units: 1 | ||
k8s-worker: | ||
charm: k8s-worker | ||
channel: latest/edge | ||
constraints: cores=2 mem=8G root-disk=16G | ||
num_units: 1 | ||
ceph-csi: | ||
charm: ceph-csi | ||
channel: latest/stable | ||
options: | ||
provisioner-replicas: 1 | ||
ceph-mon: | ||
charm: ceph-mon | ||
channel: quincy/stable | ||
constraints: cores=2 mem=4G root-disk=16G | ||
num_units: 1 | ||
options: | ||
monitor-count: 1 | ||
expected-osd-count: 1 | ||
ceph-osd: | ||
charm: ceph-osd | ||
channel: quincy/stable | ||
constraints: cores=2 mem=4G root-disk=16G | ||
num_units: 1 | ||
storage: | ||
osd-devices: 1G,2 | ||
osd-journals: 1G,1 | ||
relations: | ||
- [k8s, k8s-worker:cluster] | ||
- [ceph-csi, k8s:ceph-k8s-info] | ||
- [ceph-csi, ceph-mon:client] | ||
- [ceph-mon, ceph-osd:mon] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
# pylint: disable=duplicate-code | ||
"""Integration tests.""" | ||
|
||
import pytest | ||
from juju import model, unit | ||
|
||
# This pytest mark configures the test environment to use the Canonical Kubernetes | ||
# bundle with ceph, for all the test within this module. | ||
pytestmark = [ | ||
pytest.mark.bundle_file("test-bundle-ceph.yaml"), | ||
pytest.mark.ignore_blocked, | ||
] | ||
|
||
|
||
@pytest.mark.abort_on_fail | ||
async def test_ceph_sc(kubernetes_cluster: model.Model): | ||
"""Test that a ceph storage class is available.""" | ||
k8s: unit.Unit = kubernetes_cluster.applications["k8s"].units[0] | ||
event = await k8s.run("k8s kubectl get sc -o=jsonpath='{.items[*].provisioner}'") | ||
result = await event.wait() | ||
stdout = result.results["stdout"] | ||
assert "rbd.csi.ceph.com" in stdout, f"No ceph provisioner found in: {stdout}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters