-
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
Changing deleting procedure for the ceph FS #10148
Open
shivamdurgbuns
wants to merge
4
commits into
red-hat-storage:master
Choose a base branch
from
shivamdurgbuns:issue/10084
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
moving test to new location
Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>
- Loading branch information
commit f021987c2b59d39e023f8fbf5172050c2702778b
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
tests/functional/pv/pv_services/test_cephfilesystem_creation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import logging | ||
import pytest | ||
|
||
from ocs_ci.helpers.helpers import ( | ||
create_ceph_file_system, | ||
) | ||
from ocs_ci.ocs.exceptions import CommandFailed | ||
from ocs_ci.framework.testlib import ManageTest | ||
from ocs_ci.framework.pytest_customization.marks import ( | ||
tier2, | ||
green_squad, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class TestCephFileSystemCreation(ManageTest): | ||
""" | ||
Testing Creation of a filesystem and checking its existence. | ||
Also checking if the same filesystem can't be created twice. | ||
""" | ||
|
||
@tier2 | ||
@green_squad | ||
@pytest.mark.polarion_id("OCS-5793") | ||
def test_Cephfilesystem_creation(self): | ||
""" | ||
Trying to create more cephfilesystem using the same name. | ||
Expected Result: It should not create the filesystem and throw error. | ||
""" | ||
logger.info("Starting test of Ceph Filesystem Creation") | ||
try: | ||
cephFS_obj = create_ceph_file_system( | ||
cephfs_name="test-ceph-fs", label={"use": "test"} | ||
) | ||
|
||
if cephFS_obj: | ||
logger.info("CephFile System Created. : test-ceph-fs") | ||
else: | ||
logger.error("Unable to create the Ceph File System") | ||
logger.info("Deleting the Cephf Filesystem") | ||
cephFS_obj.delete() | ||
logger.info("Creating CephFileSystem in the namespace") | ||
new_cephFS_obj = create_ceph_file_system( | ||
cephfs_name="test-ceph-fs", label={"use": "test"} | ||
) | ||
logger.info( | ||
f"Not able to create a new ceph fs using same name {new_cephFS_obj.name}" | ||
) | ||
|
||
except CommandFailed as e: | ||
if "Error from server (AlreadyExists)" in str(e): | ||
logger.info("Test success!") | ||
assert "Error from server (AlreadyExists)" in str(e) | ||
else: | ||
logger.error( | ||
f"Command Failed, while creating the ceph file system.\n{str(e)}" | ||
) | ||
raise CommandFailed |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
After cephFS_obj.delete(), I think we should add a check to wait for Pod removal before adding it again. Probably that's the leftover Pod being reported.
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.
@shivamdurgbuns Please verify that the cephfilesystem is actually deleted.
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 check it out