qa/cephfs: upgrade caps_helper.py#46994
Conversation
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check |
646775e to
e5e95c3
Compare
|
jenkins test make check |
|
jenkins test api |
|
Tested all 5 PRs that were carved out of "fs authorize" PR (PR #41779). Testing was successful - http://pulpito.front.sepia.ceph.com/rishabh-2022-07-07_17:45:28-fs-wip-rishabh-qa-cleanup-distro-default-smithi/ |
790307c to
997d7e5
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
d074b8a to
f477ebf
Compare
|
jenkins test windows |
|
This PR affects test_multifs_auth.py and test_admin.py. Both ran fine - test_multifs_auth.py: http://pulpito.front.sepia.ceph.com/rishabh-2022-07-20_15:01:02-fs-wip-rishabh-qa-caps-helper-upgrade-distro-default-smithi/ Ready for QA run now. |
This helper method prevents repeating code to write test files in test methods for caps. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Concerned method: caps_helper.CapsHelper.write_test_file() When CephFS mountpoint is changed inside a single test method, the test files created at root are neither accessible nor useful. Therefore, add an option to create the test files in the directory passed by the user. This also increases general flexibility of the concerned method. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Modify caps_helper.py such that calling code does't have to store returned values just to pass those values again to a method in caps_helper.py. This is a common pattern where write_test_files() return 3 values and all 3 passed as it is to run_cap_tests(). The easy way to do it is to upgrade caps_helper so that it can be used an object and not just as a class supplying helper methods. The return values will be stored by the object internally and thus resued. In case of testing multiple FSs inside a single test method, we'll now need multiple instances of this class to keep those values separate. And since CapsHelper is not just a class supplying helper methods anymore, it's being renamed to CapTester. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Simplify methods in CapsTester by adding a test set, which will be a list of tuples. The first element in tuple will be the mount object, the second will be the test file path and the third will be the test file data. Thus instead of having three independent class variables that are always used together now we have list of test sets making management of multiple test sets simpler. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Let's change the file data to include the file path, the CephFS name and the host FS and CephFS mountpoint so that the bugs where, let's say, "cephfs2" is mounted instead of "cephfs1" (where obviously both the CephFSs lie on the same Ceph cluster) is caught by the tests due to uniqueness of every test file's content. Signed-off-by: Rishabh Dave <ridave@redhat.com>
With this commit, the design of run_mon_cap_tests() is now aligned with rest of CapTester -- it's not meant to be inherited by test class anymore and it is to be called by using CapTester instance. This commit also changes working of this method. Now instead of obtaining FS names from Python objects representing FSs, it obtains those names from MON cap. This removes the need to pass the FS objects around. Signed-off-by: Rishabh Dave <ridave@redhat.com>
The intention is to make logs contain some information of what's being done by caps_helper.py regardless of which test/method is calling it. This should make logs more understandable and also add hints for future debugging. Signed-off-by: Rishabh Dave <ridave@redhat.com>
caps_helper.py since caps_helper.py has been heavily modified in previous commits. setup_fs_contents() is being deleted since it is not used anymore. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Upgrade test_admin.FsAuthorize to repair its compatibility with caps_helper.py since caps_hepler.py has been heavily modified in previous commits. Signed-off-by: Rishabh Dave <ridave@redhat.com>
test_single_path_rootsquash instead of using helper methods duplicates the code from those methods. This commit fixes that and also upgrade this method since caps_helper was upgraded in previous commits. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Remove setup_test_env() because removing this methods removes an extra layer of abstraction which makes tests more readable. Rename _create_client_and_keyring_file() to just _create_client() and reverse the order of parameters in remount_with_new_client() and set default value of cephfs_mntpt to '/'. Signed-off-by: Rishabh Dave <ridave@redhat.com>
f477ebf to
9bac23b
Compare
batrick
left a comment
There was a problem hiding this comment.
nit: qa/cephfs: add a helper method in caps_helper.py contains an unrelated method, seemingly (run_cap_tests)
Looks fine otherwise if your testing is good. I did not go through it in depth.
|
QA was successful - https://tracker.ceph.com/projects/cephfs/wiki/Main#2022-Aug-26.
|
|
|
Related PR - PR #41779. Commits on this PR originally were located on PR #41779. These have been moved to a separate PR for ease of review, testing, merging and, more importantly to get these commits merged sooner so that this code can be reused to write other PRs.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows