Commit Graph

47 Commits

Author SHA1 Message Date
Yongseok Oh
10fb8f1377 qa/cephfs: add bal_rank_mask test cases
Signed-off-by: Yongseok Oh <yongseok.oh@linecorp.com>
2022-10-13 01:39:34 +00:00
Rishabh Dave
e7b6c9d8c2
Merge pull request #46994 from rishabh-d-dave/qa-caps-helper-upgrade
qa/cephfs: upgrade caps_helper.py

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2022-08-26 18:43:52 +05:30
Venky Shankar
b17f0e5d1e
Merge pull request #46685 from Rethan/perf-limit-dump-loads-depth
mds/MDBalancer: add an arg to limit depth when dump loads for dirfrags

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2022-08-24 13:31:28 +05:30
Rishabh Dave
34e94e9ae5 qa/cephfs: refactor and upgrade test_single_path_rootsquash
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>
2022-07-21 17:53:16 +05:30
Rishabh Dave
dd9579a3a0 qa/cephfs: repair test_admin.FsAuthorize's compatibility
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>
2022-07-21 17:53:16 +05:30
Rishabh Dave
82b58e3667 qa/cephfs: allow checking for multiple error messages while...
while negative testing.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2022-07-20 13:11:31 +05:30
haoyixing
a8f138cd36 mds/MDBalancer: add an arg to limit depth when dump loads for dirfrags
Directory hierarchy may be deep for a large filesystem, dump loads would output
a lot and take a long time. So add an arg to limit depth when dump loads of dirfrags.

Fixes: https://tracker.ceph.com/issues/56058
Signed-off-by: haoyixing <haoyixing@kuaishou.com>
2022-06-27 09:27:18 +00:00
Nikhilkumar Shelke
0f4add67eb qa: verify command status if data or metadata pool already in use
Fixes: https://tracker.ceph.com/issues/54111
Signed-off-by: Nikhilkumar Shelke <nshelke@redhat.com>
2022-06-12 16:25:34 +05:30
Xiubo Li
bbc4f4461f qa: add test for dumpping subtrees
Fixes: https://tracker.ceph.com/issues/53726
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2022-01-05 17:58:53 +08:00
Rishabh Dave
485841b255 qa: import CommandFailedError from exceptions not run
Stop importing CommandFailedError from teuthology.orchestra.run, it is
actually defined in teuthology.exception.

Fixes: https://tracker.ceph.com/issues/51226
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-10-05 23:41:09 +05:30
Patrick Donnelly
295971b9c6 qa: add tests for compat manipulation and upgrade
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-30 16:28:54 -07:00
Patrick Donnelly
665b36de4e Merge PR #42349 into master
* refs/pull/42349/head:
	mon/MDSMonitor: propose if FSMap struct_v is too old
	mon/MDSMonitor: give a proper error message if FSMap struct_v is too old
	mds/FSMap: use DECODE_OLDEST to gate FSMap version
	qa: add tests for fs dump of epoch and trimming
	qa: add file system support for dumping epoch
	mon/MDSMonitor: return mon_mds_force_trim_to even if equal to current epoch
	mon: add debugging for trimming methods
	mon: fix debug spacing
	qa: add nofs upgrade suite

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2021-07-28 10:45:08 -07:00
Patrick Donnelly
5ddaa36d17 qa: add tests for fs dump of epoch and trimming
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-28 07:07:05 -07:00
Xiubo Li
c1cea71299 qa: use the pg autoscale mode to calcuate the pg_num
Setting the pg_num to 8 is too small that some osds maybe not covered by the
pools, some osds maybe overloaded. Remove the hardcodeing pg_num here and let
the pg autoscale mode to calculate it as needed, and at the same time set the
pg_num_min to 64 to avoid the pg_num to small.

If ec pool is used, for the test cases most datas will go to the ec pool and
the primary replicated pool will store a small amount of metadata for all the
files only, so set the target size ratio to 0.05 should be enough.

Fixes: https://tracker.ceph.com/issues/45434
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2021-07-27 09:48:56 +08:00
Ramana Raja
a0a8ba5087 mds: create file system with specific ID
File system will need to be recreated when monitor databases are lost
and rebuilt. Some applications (e.g., CSI) expect that the recovered
file system have the same ID as before. Allow creating a file system
with a specific ID to help in such scenarios. This can now be done by
the `fs new` command using the argument 'fscid' and 'force' flag.
Newer file systems will no longer have increasing IDs as a corollary.

Fixes: https://tracker.ceph.com/issues/51340
Signed-off-by: Ramana Raja <rraja@redhat.com>
2021-07-09 21:14:01 -04:00
Patrick Donnelly
a90da2d9c5
Merge PR #41385 into master
* refs/pull/41385/head:
	mon/FSCommands: add command to rename a file system
	qa/cephfs: split test_admin.TestAdminCommands
	mds: remove 'fs_name' from MDSRank

Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-06-22 19:34:01 -07:00
Ramana Raja
bd83fac803 mon/FSCommands: add command to rename a file system
The fs_name of the relevant MDSMap is set to the new name. Also,
the application tags of the data pools and the meta data pool of
the file system is set to the new name.

Fixes: https://tracker.ceph.com/issues/47276
Signed-off-by: Ramana Raja <rraja@redhat.com>
2021-06-17 13:59:08 -04:00
Rishabh Dave
c8e2db190c qa/cephfs: split test_admin.TestAdminCommands
Splitting TestAdminCommands makes it easier to exercise a particular
"ceph fs" subcommand. Also, rename class TestSubCmdFsAuthorize to
TestFsAuthorize.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-06-17 13:59:05 -04:00
Simon Gao
430d93222a qa : add a test for the cmd, dump cache
Signed-off-by: Simon Gao <simon29rock@gmail.com>
2021-05-23 14:43:02 +08:00
Patrick Donnelly
76ac006875
Merge PR #40431 into master
* refs/pull/40431/head:
	qa/cephfs: remove create_keyring_file from cephfs_test_case.py
	qa/cephfs: don't use sudo to write files in /tmp

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
2021-04-09 20:02:27 -07:00
Rishabh Dave
511434ac5a qa/cephfs: remove create_keyring_file from cephfs_test_case.py
Since teuthology.orchestra.remote.mktemp() can write a temporary file
and not just create it, create_keyring_file() is now redundant.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2021-04-08 12:11:00 +05:30
Kefu Chai
73925c488a
Merge pull request #39969 from batrick/i49684
qa: wait for daemons to come up via cephadm

Reviewed-by: Sage Weil <sage@redhat.com>
2021-03-28 20:01:32 +08:00
Patrick Donnelly
8e45af05c9
qa: remove get_lone_mds_id
This helps remove a dependence on the list of mds_daemons from
teuthology/cephadm.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-21 10:35:07 -07:00
Patrick Donnelly
fe85001de2
qa: remove shutdown lockdep not relevant to unit test
This is part of a fleet of commits trying to remove unnecessary mds_stop
calls in testing.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-21 10:35:06 -07:00
Patrick Donnelly
eccf961697
qa: add Filesystem.reset helper
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-21 10:35:06 -07:00
Venky Shankar
f276782803 test: pass peer uuid when adding cephfs mirror peers
Fixes: http://tracker.ceph.com/issues/49822
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2021-03-16 03:03:16 -04:00
Ramana Raja
22ed4f43d9 mds: allow fs authorize command to work
... on filesystems with '-' in their names.

Fixes: https://tracker.ceph.com/issues/49301
Signed-off-by: Ramana Raja <rraja@redhat.com>
2021-02-23 22:38:50 -05:00
Patrick Donnelly
780a1dd5ff
qa: add test for fs rm idempotency
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-01-12 07:24:33 -08:00
Patrick Donnelly
f70228e35a
qa: add test for reserved keyword feature
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-01-08 08:27:38 -08:00
Patrick Donnelly
0cb3bce3a8
qa: use no client for required client feature tests
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-01-07 13:30:46 -08:00
Patrick Donnelly
bc25bd70f2
qa: unmount all clients before deleting the file system
Otherwise we have unnecessary timeout waits.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2020-10-13 10:16:40 -07:00
Ramana Raja
525c0e699e qa/tasks/cephfs: fix fs authorize cmd args
... in test_admin.TestSubCmdFsAuthorize.setup_for_multiple_paths().

Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-09-25 15:54:12 +05:30
Ramana Raja
e1c5220780 mds: add root_squash mode in MDS auth caps
Implement a root_squash mode in MDS auth caps to deny operations for
clients with uid=0 or gid=0 that need write access. It's mainly to
prevent operations such as accidental `sudo rm -rf /path`.

The root squash mode can be enforced in one of the following ways in
the MDS caps,
  'allow rw root_squash'
  (across file systems)
          or
  'allow rw fsname=a root_squash'
  (on a file system)
          or
  'allow rw fsname=a path=/vol/group/subvol00 root_squash'
  (on a file system path)

Fixes: https://tracker.ceph.com/issues/42451
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-09-25 14:34:35 +05:30
Rishabh Dave
995c73639b qa/cephfs: add tests for "fs authorize" subcommand
Make caps FS-specific affects "fs authorize" subcommand. Let's add few
tests to verify its behaviour.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-11 18:04:23 +05:30
Rishabh Dave
04ed58fec2 qa/cephfs: modify delete_all_filesystems() in filesystem.py
Modify filesystem.Filesystem.delete_all_filesystems() method to make it
more succinct, move it to class MDSCluster instead and update every call
to it accordingly.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-10 23:56:59 +05:30
Patrick Donnelly
02813988a6
Merge PR #36394 into master
* refs/pull/36394/head:
	qa: add method run ceph cluster command with better interface
	cephfs: allow only "good" characters

Reviewed-by: Varsha Rao <varao@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-08-24 11:33:03 -07:00
Rishabh Dave
4022e2ba7d cephfs: allow only "good" characters
Allow only [A-Za-z0-9-_.] characters for FS, volume, subvolume and
subvolume group names and add test for the same.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-08-20 15:34:02 +05:30
Venky Shankar
e2c5abb85d test: add tests for ceph fs mirror family of commands
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2020-08-12 09:28:12 -04:00
Yan, Zheng
c4a335d7c6 mon: add 'ceph fs required_client_feature <fs_name> add/rm' command
Fixes: https://tracker.ceph.com/issues/43817
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2020-07-07 09:05:56 +08:00
Kefu Chai
21ad5bf2eb qa/tasks/cephfs: flake8 fixes
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-24 10:12:11 +08:00
Ramana Raja
d9f8f8e3d0 cephfs: allow pool names with '-' and '.'
... to be set as pool layouts for files and directories.

Fixes: https://tracker.ceph.com/issues/45521
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-05-19 13:34:49 +05:30
Gregory Farnum
da3904609f
Merge pull request #34561 from kotreshhr/ceph-fs-status-output
mgr/status: Fix "ceph fs status" json format writing to stderr

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2020-04-21 22:17:42 -07:00
Kotresh HR
138117f2f4 mgr/status: Fix "ceph fs status" json format writing to stderr
"ceph fs status" json format outputs to stderr instead of
stdout. This patch fixes the same.

Fixes: https://tracker.ceph.com/issues/44962
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2020-04-15 19:15:11 +05:30
Ramana Raja
2f45558eb8 mon/FSCommands: Fix 'fs new' command
After creating a filesystem using the 'fs new' command, the value
of the 'data' and 'metadata' key of the datapool and metadatapool's
application tag 'cephfs' should be the filesystem's name. This
didn't happen when the data or metadata pool's application metadata
'cephfs' was enabled before the pool was used in the 'fs new' command.
Fix this during the handling of the 'fs new' command by setting the
value of the key of the pool's application metadata 'cephfs' to the
filesystem's name even when the application metadata 'cephfs' is
already enabled or set.

Fixes: https://tracker.ceph.com/issues/43761
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-04-15 17:17:23 +05:30
Ramana Raja
3c49092322 mon/FSCommands: Fix 'add_data_pool' command
After making a RADOS pool a filesystem's data pool using the
'add_data_pool' command, the value of the 'data' key of the pool's
application metadata 'cephfs' should be the filesystem's name. This
didn't happen when the pool's application metadata 'cephfs' was
enabled before the pool was made the data pool. Fix this during the
handling of the 'add_data_pool' command by setting the value of
the 'data' key of the pool's application metadata 'cephfs' to the
filesystem's name even when the application metadata 'cephfs' is
already enabled or set.

Fixes: https://tracker.ceph.com/issues/43061
Signed-off-by: Ramana Raja <rraja@redhat.com>
2020-04-15 15:56:56 +05:30
Patrick Donnelly
bf0cf8e08b
qa: add tests for adding EC data pools
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-12-20 12:53:10 -08:00
Patrick Donnelly
9dc07d8096
qa: add tests for CephFS admin commands
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-10-30 11:44:26 -07:00