-
Notifications
You must be signed in to change notification settings - Fork 5
tests/storage/linstor: Add test for forgetting and introducing Linstor SR #279
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
base: master
Are you sure you want to change the base?
tests/storage/linstor: Add test for forgetting and introducing Linstor SR #279
Conversation
221d797
to
988e81e
Compare
988e81e
to
3c19d5a
Compare
7e8b277
to
75e8a4e
Compare
I had a look, nothing I'd need to comment on I think, so I leave it to the other reviewers. |
lib/host.py
Outdated
if isinstance(args, dict): | ||
command += [stringify(key, value) for key, value in args.items()] | ||
elif isinstance(args, list): | ||
command += [stringify(key, value) for key, value in args] |
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.
if isinstance(args, dict): | |
command += [stringify(key, value) for key, value in args.items()] | |
elif isinstance(args, list): | |
command += [stringify(key, value) for key, value in args] | |
resolved_args = None | |
if isinstance(args, list): | |
resolved_args = args | |
else: | |
resolved_args = args.items() | |
command += [stringify(key, value) for key, value in resolved_args] |
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
lib/sr.py
Outdated
return self.pool.master.xe('sr-param-get', {'uuid': self.uuid, 'param-name': param}) | ||
|
||
def type(self): | ||
return self.pool.master.xe('sr-param-get', {'uuid': self.uuid, 'param-name': 'type'}) |
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.
return self.pool.master.xe('sr-param-get', {'uuid': self.uuid, 'param-name': 'type'}) | |
return self.param_get('type') |
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.
Thanks
lib/sr.py
Outdated
@@ -147,6 +148,17 @@ def main_host(self): | |||
def content_type(self): | |||
return self.pool.master.xe('sr-param-get', {'uuid': self.uuid, 'param-name': 'content-type'}) |
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.
return self.pool.master.xe('sr-param-get', {'uuid': self.uuid, 'param-name': 'content-type'}) | |
return self.param_get('content-type') |
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
- Added support for handling both dictionary and list-based arguments. - Fixed command formatting for `config:key=value` scenarios. Signed-off-by: Rushikesh Jadhav <[email protected]>
- `param_get()`: Fetch a specific SR parameter. - `type()`: Retrieve SR type. - `introduce()`: Introduce SR. Signed-off-by: Rushikesh Jadhav <[email protected]>
…_introduce_sr` - Validates the ability to forget an SR and properly reintroduce it. - Ensures all PBD configurations are stored and restored correctly. - Checks that exceptions are raised when querying a forgotten SR. - Restores the SR and verifies successful reattachment of PBDs. Signed-off-by: Rushikesh Jadhav <[email protected]>
75e8a4e
to
1b97717
Compare
Added
test_forget_and_introduce_sr
intest_linstor_sr.py
to validate forgetting and reintroducing an SR, ensuring correct PBD restoration and proper exception handling.Updated SR class in
sr.py
with methods for retrieving parameters, getting type, forgetting, and introducing SR.