Skip to content

Commit

Permalink
Move submariner_version parameter to ocp version specific files
Browse files Browse the repository at this point in the history
Validation for serviceexports

Addressed few review comments

Signed-off-by: Shylesh Kumar Mohan <[email protected]>
  • Loading branch information
shylesh committed Nov 2, 2023
1 parent 2bc663a commit c5f35dc
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ higher priority).
* `nb_nfs_mount` - NFS mount point used specifically for testing noobaa db NFS mount test
* `custom_default_storageclass_names` - Set to true if custom storageclass names use instead of default one.
* `storageclassnames` - Under this key, custom storage class names for `cephFilesystems`, `cephObjectStores`, `cephBlockPools`, `cephNonResilientPools`, `nfs` and for `encryption` are defined.
* `submariner_source` - Source from which we take submariner build, ex: upstream, downstream, downstream_unreleased
* `submariner_source` - Source from which we take submariner build, ex: upstream, downstream
* `submariner_release_type` - Released OR Unreleased submariner build
* `enable_globalnet` - enable or disable globalnet for submariner, default: true
* `submariner_unreleased_channel` - submariner channel for unreleased downstream build
Expand Down
3 changes: 1 addition & 2 deletions conf/ocsci/submariner_downstream_unreleased.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ENV_DATA:
submariner_source: "downstream"
submariner_release_type: "unreleased"
submariner_version: "0.16.0"
submariner_unreleased_channel: "stable-0.16"
submariner_unreleased_channel: ""
enable_globalnet: true
5 changes: 4 additions & 1 deletion ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ def do_deploy_ocs(self):
ocs_install_verification(ocs_registry_image=ocs_registry_image)
# if we have Globalnet enabled in case of submariner with RDR
# we need to add a flag to storagecluster
if config.ENV_DATA.get("enable_globalnet", None):
if (
config.ENV_DATA.get("enable_globalnet", True)
and config.MULTICLUSTER["multicluster_mode"] == "regional-dr"
):
for cluster in get_non_acm_cluster_config():
config.switch_ctx(cluster.MULTICLUSTER["multicluster_index"])
storage_cluster_name = config.ENV_DATA["storage_cluster_name"]
Expand Down
1 change: 1 addition & 0 deletions ocs_ci/framework/conf/ocp_version/ocp-4.13-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ ENV_DATA:
vm_template: "rhcos-413.92.202305021736-0-vmware.x86_64"
acm_hub_channel: release-2.8
acm_version: "2.8"
submariner_version: "0.15.0"
1 change: 1 addition & 0 deletions ocs_ci/framework/conf/ocp_version/ocp-4.13-ga-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ ENV_DATA:
vm_template: "rhcos-4.13.0-x86_64-vmware.x86_64"
acm_hub_channel: release-2.8
acm_version: "2.8"
submariner_version: "0.15.0""
1 change: 1 addition & 0 deletions ocs_ci/framework/conf/ocp_version/ocp-4.14-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ ENV_DATA:
vm_template: "rhcos-414.92.202303281555-0-vmware.x86_64"
acm_hub_channel: release-2.9
acm_version: "2.9"
submariner_version: "0.16.0"
8 changes: 7 additions & 1 deletion ocs_ci/ocs/acm/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,15 @@ def submariner_unreleased_downstream_info(self):
self.do_send_keys(
self.page_nav["submariner-custom-source"], "submariner-catalogsource"
)
submariner_unreleased_channel = (
config.ENV_DATA["submariner_unreleased_channel"]
if config.ENV_DATA["submariner_unreleased_channel"]
else config.ENV_DATA["submariner_version"].rpartition(".")[0]
)
channel_name = "stable-" + submariner_unreleased_channel
self.do_send_keys(
self.page_nav["submariner-custom-channel"],
config.ENV_DATA["submariner_unreleased_channel"],
channel_name,
)

def submariner_validation_ui(self):
Expand Down
32 changes: 32 additions & 0 deletions ocs_ci/ocs/resources/storage_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,13 @@ def ocs_install_verification(
verify_storage_device_class(device_class)
verify_device_class_in_osd_tree(ct_pod, device_class)

# RDR with globalnet submariner
if (
config.ENV_DATA.get("enable_globalnet", True)
and config.MULTICLUSTER["multicluster_mode"] == "regional-dr"
):
validate_serviceexport()


def mcg_only_install_verification(ocs_registry_image=None):
"""
Expand Down Expand Up @@ -2535,3 +2542,28 @@ def patch_storage_cluster_for_custom_storage_class(
else:
log.error(f"Invalid action: '{action}'")
return False


def validate_serviceexport():
"""
validate the serviceexport resource
Number of osds and mons should match
"""
serviceexport = OCP(
kind="ServiceExport", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE
)
osd_count = 0
mon_count = 0
for ent in serviceexport.get().get("items"):
if "osd" in ent["metadata"]["name"]:
osd_count += 1
elif "mon" in ent["metadata"]["name"]:
mon_count += 1
assert (
osd_count == get_osd_count()
), f"osd serviceexport count mismatch {osd_count} != {get_osd_count()} "

assert mon_count == len(
get_mon_pods()
), f"Mon serviceexport count mismatch {mon_count} != {len(get_mon_pods())}"

0 comments on commit c5f35dc

Please sign in to comment.