Skip to content

reef: qa/cephfs: improvements for name generators in test_volumes.py - #54729

Merged
vshankar merged 8 commits into
ceph:reeffrom
rishabh-d-dave:wip-63688-reef
Apr 2, 2024
Merged

vshankar merged 8 commits into
ceph:reeffrom
rishabh-d-dave:wip-63688-reef

Conversation

@rishabh-d-dave

@rishabh-d-dave rishabh-d-dave commented Nov 30, 2023 •

Copy link
Copy Markdown
Contributor

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing a invocation of _generate_random_... introduced by #54207. (Please rebase.)

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move tests for "ceph fs volume rename" command to a new class. This
makes it possible to run this group of tests in a single command.

This provides a convenient way to execute these tests which is necessary
after the changes has been made to the code for the "ceph fs volume
rename" command.

Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit e268908)

Conflicts:
	qa/tasks/cephfs/test_volumes.py
	test_rename_when_fs_is_online() is not present on Quincy branch,
	unlike main branch
Generate a name that is shorter and easier to remember.

Also, write a simpler, faster & better helper method for generating
unique names. This method will also have shorter and more concise name,
so this will be easier to type and easier to read.

Fixes: https://tracker.ceph.com/issues/63680
Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit ad96e91)

Conflicts:
	qa/tasks/cephfs/test_volumes.py
	Unlike main branch, on Quincy branch test methods
	test_rename_when_clients_arent_refused(),
	test_rename_when_fs_is_online(),
	test_periodic_async_work() and
	test_subvolume_group_rm_when_its_not_empty() are absent.
Writing guest keyring to CWD's file named "keyring" will over-write
build/keyring on developer's machine which will make the cluster
inoperatable and also fail the test.

Fixes: https://tracker.ceph.com/issues/63506
Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 974c4f9)
Fix warnings printed by the command "flake8 --select=F,E9
--exclude=venv,.tox src/pybind/mgr/volumes/".

While working with mgr/vol, syntax errors are not printed anywhere. Any
attempt to run vstart.sh after such faulty patch causes vstart.sh to go
in a infinite loop. And running "ceph fs volume" command prints "no such
command exists". This doesn't tell the actual issue and causes
confusion.

When flake8 is run, the issue is not immediately apparent due to so many
warnings. Therefore, fix these warnings so that it becomes easier to
spot such critical issues here onwards.

Note: mypy uses comments like "#type: Dict" for type checking and
therefore counts 'from typechecking import Dict' as not unsued. But
flake8 doesn't recognize type hints embedded in comment. Therfore,
switch to actually using type hints instead of adding type hints to
comments.

Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 95dac20)
It's not obvious where the clone creation is performed. It's especially
obfuscated because we call the function/method for cloning indirectly.
Therefore, add comments where necessary and mark it with heavy rating.

Same goes for all other "subvolume snapshot clone" operations.

Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 2e0b4ae)
Instead of writing like this  -

  if abcd1.abcd2(abcd3) and abcd4 == abcd5
	print('efgh6')
  if abcd7.abcd8(abcd9) and abcd4 == abcd5
	print('efgh10')

Write like this because it easier to read, especially in case of the
patch where condition under is really long -

  if abcd4 == abcd5:
    if abcd1.abcd2(abcd3):
	print('abcd4')
    if abcd5.abcd8(abcd9):
	print('abcd5')

Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit e0034e5)
Method "open_clone_subvolume_pair()" returns subvolumes, yet return
value is named as clone_volume. Rectify this mistake.

Signed-off-by: Rishabh Dave <[email protected]>
(cherry picked from commit 060de1d)
_generate_random_group_name() and _generate_random_subvolume_name() were
deleted in one of the commit from this series of commits. And PR ceph#54207
adds calls to these helper methods. This wasn't the case for the main
branch version of this series of commits. This is why this issue is
being fixed in Reef branch directly through a fresh/new commit instead
of backporting a commit.

Signed-off-by: Rishabh Dave <[email protected]>
@rishabh-d-dave

rishabh-d-dave commented Mar 22, 2024 •

Copy link
Copy Markdown
Contributor Author

@ljflores

Copy link
Copy Markdown
Member

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test make check

@ljflores

ljflores commented Apr 1, 2024

Copy link
Copy Markdown
Member

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants