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

Create new test file for testing resize OSD #9583

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

yitzhak12
Copy link
Contributor

@yitzhak12 yitzhak12 commented Mar 28, 2024

The PR implements the basic test scenario of the resize osd feature. For more details about the feature, see https://issues.redhat.com/browse/RHSTOR-5251, and for the test details, see the test plan spreadsheet: https://docs.google.com/spreadsheets/d/1wCSwMk_L4SikzZ2UarUH1-VCXyGkHs-ZNdDEtWPG7f4/edit#gid=105186681&range=B8.
In the test, we will perform the following:

  • Prepare all the relevant data before the resizing(Save the old pods, PVCs, PVs, create pods and PVCs and run IO, save the file md5sum).
  • Resize the osd by multiplying 2(This will be done by patching the storagecluster storage param).
  • Check that the resources are in the expected state and that the new size is reflected in the resources and Ceph. Also, check that the md5sum of the files didn't change after the resize osd.
  • Check the cluster and Ceph health

@yitzhak12 yitzhak12 requested a review from a team as a code owner March 28, 2024 18:16
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines label Mar 28, 2024
@pull-request-size pull-request-size bot added size/XL and removed size/L PR that changes 100-499 lines labels Apr 3, 2024
@yitzhak12 yitzhak12 changed the title Test resize OSD Create new test file for testing resize OSD Apr 4, 2024
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.

PR validation on existing cluster

Cluster Name: ikave-aws416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job PASSED.

@yitzhak12 yitzhak12 force-pushed the test-resize-osd branch 2 times, most recently from 5ba4964 to ba8c2f9 Compare April 4, 2024 14:32
@yitzhak12 yitzhak12 added the Verified Mark when PR was verified and log provided label Apr 4, 2024
@yitzhak12 yitzhak12 force-pushed the test-resize-osd branch 2 times, most recently from 6b1af11 to e3b904b Compare April 7, 2024 14:48
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.

PR validation on existing cluster

Cluster Name: ikave-aws416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job PASSED.

Copy link
Contributor

@fbalak fbalak left a comment

Choose a reason for hiding this comment

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

The functionality looks good but I have 2 suggestions:

  • New *post_resize_osd functions shouldn't be in cluster.py module in my opinion. It would be better to have a new module (e.g. osd_resize.py) that would contain those checks and resize functionality. Some of those functions use storagecluster cr but their functionality is focused on osds and resizing.

  • It is better to raise an Exception in module function instead of assert. Asserts should be used in tests but functions that could be reused on multiple places should raise an Exception that can be handled (e.g. negative scenario where you want it to fail).

@yitzhak12
Copy link
Contributor Author

Thanks @fbalak. I will modify the code accordingly.

- Create new Plarion test case
- Create new file for the resize osd functions
- Raise excpetion intead of assert in the relevant two functions

Signed-off-by: Itzhak Kave <[email protected]>
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.

PR validation on existing cluster

Cluster Name: ikave-ibm416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job FAILED (installation failed, tests not executed).

@ebenahar ebenahar added the Test Case A test case PR label Apr 10, 2024
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.

PR validation on existing cluster

Cluster Name: ikave-ibm416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job PASSED.


logger.info(
f"Check that the number of the new OSD pods are exactly {old_osd_pods_count}"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we also add a validation that the Running OSD pod names are different than old_osd_pods names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ocs_ci/ocs/resources/osd_resize.py Show resolved Hide resolved
ocs_ci/ocs/resources/osd_resize.py Show resolved Hide resolved
ocs_ci/ocs/resources/osd_resize.py Show resolved Hide resolved
bool: True in case if changes are applied. False otherwise

"""
sc = get_storage_cluster()
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 check that the new requested size is greater than the existing OSD size.
And should we add a test case of tyring to resize to a smaller size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

do you plan to add it in a follow up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have implemented the osd size check.
I will add the negative test in another PR. I need to check first manually what is the behavior

… validation check for the 'resize_osd' function

Signed-off-by: Itzhak Kave <[email protected]>
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.

PR validation on existing cluster

Cluster Name: ikave-ibm416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job UNSTABLE (some or all tests failed).

ebenahar
ebenahar previously approved these changes Apr 14, 2024
Signed-off-by: Itzhak Kave <[email protected]>
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.

PR validation on existing cluster

Cluster Name: ikave-aws416
Cluster Configuration:
PR Test Suite: tier1
PR Test Path: tests/functional/z_cluster/cluster_expansion/test_resize_osd.py
Additional Test Params:
OCP VERSION: 4.16
OCS VERSION: 4.16
tested against branch: master

Job PASSED.

@openshift-ci openshift-ci bot added the lgtm label Apr 14, 2024
Copy link

openshift-ci bot commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ebenahar, fbalak, yitzhak12

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

@ebenahar ebenahar merged commit 250a228 into red-hat-storage:master Apr 15, 2024
6 of 7 checks passed
@petr-balogh
Copy link
Member

If this PR is going to be cherry-picked we need to include fix from Vijay:
#9678

As this code braking the add capacity test:

>       device_sets_required = int(osd_size_capacity_requested / osd_size_existing)
E       TypeError: unsupported operand type(s) for /: 'str' and 'str'

ocs_ci/ocs/resources/storage_cluster.py:1470: TypeError

@yitzhak12 FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm size/XL Squad/Brown Test Case A test case PR Verified Mark when PR was verified and log provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants