Skip to content

Commit

Permalink
verify csi users and caps in external mode (#5717)
Browse files Browse the repository at this point in the history
Adding verification of csi users "client.csi-cephfs-node", "client.csi-cephfs-provisioner",
"client.csi-rbd-node" and "client.csi-rbd-provisioner" and caps.
From ODF 4.10, osd blocklist caps are added to csi users

Signed-off-by: vavuthu <vavuthu@redhat.com>
  • Loading branch information
vavuthu authored Apr 14, 2022
1 parent e6978d4 commit 8788656
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ocs_ci/ocs/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@
# External cluster username
EXTERNAL_CLUSTER_USER = "client.healthchecker"
EXTERNAL_CLUSTER_OBJECT_STORE_USER = "rgw-admin-ops-user"

# External cluster CSI users
ceph_csi_users = [
"client.csi-cephfs-node",
"client.csi-cephfs-provisioner",
"client.csi-rbd-node",
"client.csi-rbd-provisioner",
]

# Hpcs related defaults
#
# To be used for adding additional hpcs connections
Expand Down
17 changes: 17 additions & 0 deletions ocs_ci/ocs/resources/storage_cluster.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
StorageCluster related functionalities
"""
import copy
import logging
import tempfile
import yaml
Expand Down Expand Up @@ -345,6 +346,22 @@ def ocs_install_verification(
# TODO: Verify ceph osd tree output have osd listed as ssd
# TODO: Verify ceph osd tree output have zone or rack based on AZ

# verify caps for external cluster
log.info("Verify CSI users and caps for external cluster")
if config.DEPLOYMENT["external_mode"] and ocs_version >= version.VERSION_4_10:
ceph_csi_users = copy.deepcopy(defaults.ceph_csi_users)
ceph_auth_data = ct_pod.exec_cmd_on_pod("ceph auth ls -f json")
for each in ceph_auth_data["auth_dump"]:
if each["entity"] in defaults.ceph_csi_users:
assert (
"osd blocklist" in each["caps"]["mon"]
), f"osd blocklist caps are not present for user {each['entity']}"
ceph_csi_users.remove(each["entity"])
assert (
not ceph_csi_users
), f"CSI users {ceph_csi_users} not created in external cluster"
log.debug("All CSI users exists and have expected caps")

# Verify CSI snapshotter sidecar container is not present
# if the OCS version is < 4.6
if ocs_version < version.VERSION_4_6:
Expand Down

0 comments on commit 8788656

Please sign in to comment.