-
Notifications
You must be signed in to change notification settings - Fork 63
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] Add host to maintenance using flags #3678
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sayaleeraut 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 |
d150833
to
1fbfb60
Compare
Tox results - ===================================================================== 17 passed, 3 warnings in 0.69s ====================================================================== |
1fbfb60
to
2ef80b8
Compare
@@ -0,0 +1,90 @@ | |||
#=============================================================================================== | |||
#------------------------------------- | |||
#----- Smoke Test suite ------ |
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.
Smoke test suite ?
#------------------------------------- | ||
#----- Smoke Test suite ------ | ||
#------------------------------------- | ||
# Conf: conf/quincy/cephadm/tier-0.yaml |
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.
quincy ?
name: configure client | ||
|
||
# Testing stage | ||
- test: |
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.
Do we need separate cluster for this operation? Can't it added to any existing suite ?
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.
Okay, will add it to suites/reef/cephadm/tier0-cephadm.yaml
|
||
# Put the host into maintainence | ||
cmd = f"ceph orch host maintenance enter {instance_name} --force --yes-i-really-mean-it" | ||
out = cephadm.shell([cmd]) |
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.
Why cephadm.shell
? Add libraries for same operation
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.
Hey @vamahaja Using this "--yes-i-really-mean-it" flag we are forcing a host into maintenance and it not a recommended way to do it.
Not sure if it will be used in other test scenarios, please let me know if still this needs to converted to a lib.
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.
Done
) | ||
|
||
# Validate Cephadm logs for no OrchestratorError | ||
cmd = "ceph log last 3 cephadm" |
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.
same as above
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.
Done
51c33f0
to
7d60971
Compare
Tox results - py3: commands[1]> flake8 |
36a6e70
to
c3395fc
Compare
Signed-off-by: “sayalee” <saraut@redhat.com>
c3395fc
to
8dbe1ee
Compare
force (bool): Whether to append force with maintenance enter command | ||
yes-i-really-mean-it (bool) : Whether to append --yes-i-really-mean-it with maintenance enter command | ||
""" | ||
if operation == "enter": |
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.
Use cmd = f"{self.base_cmd} maintenance {operation} {hostname}
operation(str): enter/exit maintenance mode | ||
kw (dict): Key/value pairs that needs to be provided to the installer | ||
|
||
Supported keys: |
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.
**kw
is used for large no of parameters. For simplicity pass force
& yes_i_really_mean_it
parameters to method.
@@ -1,5 +1,8 @@ | |||
from cli import Cli | |||
from cli.utilities.utils import build_cmd_from_args | |||
from utility.log import Log | |||
|
|||
log = Log(__name__) |
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.
Unused variable
log.info(f"Status of the host is {host_status}") | ||
if status: | ||
return True if status.lower() == host_status else False | ||
elif "offline" in host_status: |
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.
offline
status will be specific condition. It can be handled by passing it through status.
""" | ||
log.debug(f"Passed host : {hostname} to be added into maintenance mode") | ||
iteration = 0 | ||
while iteration <= retry: |
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.
log.info(f"Host: {hostname}, not in maintenance mode. Pass") | ||
return True | ||
|
||
while iteration <= retry: |
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.
installer = ceph_cluster.get_nodes(role="installer")[0] | ||
|
||
# Create a pool | ||
out = orch_obj.create_pool(**pool_config) |
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.
Add method here to create osd pool - https://github.com/red-hat-storage/cephci/blob/master/cli/ceph/osd/pool.py
Description
Please include Automation development guidelines. Source of Test case - New Feature/Regression Test/Close loop of customer BZs
click to expand checklist