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 to automate RHSTOR 4474: On-premise deployments of ODF, where we have 5 or more nodes,racks or rooms add the ability to configure 5 MONs #9980

Closed
wants to merge 22 commits into from

Conversation

pintojoy
Copy link
Contributor

No description provided.

… have 5 or more nodes,racks or rooms add the ability to configure 5 MONs

Signed-off-by: pintojoy <[email protected]>
pintojoy added 2 commits June 25, 2024 11:47
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Comment on lines 54 to 83
def assign_dummy_racks(self):
"""
Assign node labels to given nodes based on given rack lists.

"""
overwrite = True
if len(self.nodes) % len(self.racks) != 0:
msg = "number of nodes is not divisible by number of racks"
log.error(msg)
raise ValueError(msg)
node_h = ocp.OCP(kind="node")
for node, rack in zip(self.nodes, self.racks):
log.info("labeling node %s with %s=%s", node, constants.RACK_LABEL, rack)
oc_cmd = f"label node {node} {constants.RACK_LABEL}={rack}"
if overwrite:
oc_cmd += " --overwrite"
node_h.exec_oc_cmd(command=oc_cmd)

def are_rack_labels_present(self):
"""
Check that there are no nodes without rack labels.

Returns:
Bool: True if all nodes have a rack label, False otherwise.
"""
node_h = ocp.OCP(kind="node")
nodes_labeled = node_h.get(selector=constants.RACK_LABEL)
node_names = [n["metadata"]["name"] for n in nodes_labeled["items"]]
log.info("nodes with '%s' rack label: %s", constants.RACK_LABEL, node_names)
return len(nodes_labeled["items"]) == len(get_worker_nodes())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this function moved to some library file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These functions are test specific as we are increasing failure domain count by assigning dummy racks. Moving it to library file might create more confusion.

Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

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

Unknown PR validation on existing cluster

Cluster Name: jopinto-5mon16
Cluster Configuration: conf/deployment/vsphere/upi_1az_rhcos_vsan_3m_6w.yaml
PR Test Suite:
PR Test Path:
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job state: ABORTED.

@pintojoy pintojoy requested a review from a team as a code owner July 9, 2024 06:06
pintojoy added 5 commits July 9, 2024 17:05
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
@pintojoy
Copy link
Contributor Author

Verification log for test_node_maintenance_post_five_mon_update: https://url.corp.redhat.com/e0a260c
Verification log for test_scale_mons_in_cluster_to_five: https://url.corp.redhat.com/a018a96

@pintojoy
Copy link
Contributor Author

Verification log for test_mon_restart_post_five_mon_update:https://url.corp.redhat.com/4f74b63

@pintojoy pintojoy dismissed stale reviews from ramkiperiy and ypersky1980 via 4b78fd6 July 17, 2024 06:05
@openshift-ci openshift-ci bot removed the lgtm label Jul 17, 2024
ramkiperiy
ramkiperiy previously approved these changes Jul 17, 2024
Copy link
Contributor

@ramkiperiy ramkiperiy left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -394,6 +400,23 @@ def mon_change_count(self, new_count):
logger.info(f"Mon count changed to {new_count}")
self.cluster.reload()

def update_mon_count_to_five(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest adding the param new_count=5 to the function signature. That way, the default value will still be 5, but we will have the option to test with another mon count value. The function signature should change to update_mon_count(new_count=5) in this case.

Comment on lines +118 to +121
self.racks = [
"rack{}".format(i % (len(self.nodes) // 2))
for i in range(len(self.nodes))
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment or a log message explaining what this code does. Alternatively, you can divide it into more lines to make it clearer.

Comment on lines 179 to 182
assert self.storagecluster_obj.patch(
params=params_neg,
format_type="merge",
), log.error("Mon count should not be updated value other than 3 and 5")
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I am wrong, but I think this should be assert not self.storagecluster_obj.patch( since we expect the patch to return False. Or should we perform a different check here?

jilju
jilju previously approved these changes Sep 9, 2024
@pintojoy pintojoy dismissed stale reviews from jilju and ramkiperiy via 45b973d September 9, 2024 08:58
@openshift-ci openshift-ci bot removed the lgtm label Sep 9, 2024
Copy link

openshift-ci bot commented Sep 9, 2024

New changes are detected. LGTM label has been removed.

Copy link

openshift-ci bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pintojoy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

2 similar comments
Copy link

openshift-ci bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pintojoy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pintojoy

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Joy John Pinto <[email protected]>
Signed-off-by: Joy John Pinto <[email protected]>
Copy link

github-actions bot commented Dec 8, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the lifecycle/stale No recent activity label Dec 8, 2024
Copy link

github-actions bot commented Jan 7, 2025

This pull request has been automatically closed due to inactivity. Please re-open if these changes are still required.

@github-actions github-actions bot closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale No recent activity needs-rebase size/L PR that changes 100-499 lines Verified Mark when PR was verified and log provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants