-
Notifications
You must be signed in to change notification settings - Fork 170
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
Conversation
… have 5 or more nodes,racks or rooms add the ability to configure 5 MONs Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
There was a problem hiding this 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.
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]>
Signed-off-by: pintojoy <[email protected]>
Signed-off-by: pintojoy <[email protected]>
Verification log for test_node_maintenance_post_five_mon_update: https://url.corp.redhat.com/e0a260c |
Verification log for test_mon_restart_post_five_mon_update:https://url.corp.redhat.com/4f74b63 |
…at change Signed-off-by: pintojoy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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. |
ocs_ci/ocs/cluster.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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.
self.racks = [ | ||
"rack{}".format(i % (len(self.nodes) // 2)) | ||
for i in range(len(self.nodes)) | ||
] |
There was a problem hiding this comment.
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.
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") |
There was a problem hiding this comment.
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?
New changes are detected. LGTM label has been removed. |
[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 |
2 similar comments
[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 |
[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 |
Signed-off-by: Joy John Pinto <[email protected]>
Signed-off-by: Joy John Pinto <[email protected]>
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. |
This pull request has been automatically closed due to inactivity. Please re-open if these changes are still required. |
No description provided.