Commit Graph

326 Commits

Author SHA1 Message Date
Jos Collin
1bdd75f999
qa/tasks: tests for ls
tests for:
* fs subvolume ls
* 'fs subvolume ls' for non-existent default group
* fs subvolumegroup ls
* 'fs subvolumegroup ls' for not-existent /volume
* fs subvolume snapshot ls
* fs subvolumegroup snapshot ls

Fixes: https://tracker.ceph.com/issues/41842
Signed-off-by: Jos Collin <jcollin@redhat.com>
2019-10-08 11:53:46 +05:30
Ramana Raja
0bfcace85e
Merge pull request #30407 from joscollin/wip-B41841-yes-really-mean-it
mgr/volumes: protection for `fs volume rm` command
2019-10-01 13:05:33 +05:30
Jos Collin
f1b9e90d7f
qa/tasks: add/update tests for --yes-i-really-mean-it
Fixes: https://tracker.ceph.com/issues/41841
Signed-off-by: Jos Collin <jcollin@redhat.com>
2019-09-27 15:17:34 +05:30
Patrick Donnelly
719cb3f5b4
Merge PR #30297 into master
* refs/pull/30297/head:
	test_cephfs_shell: add note on how to run this testsuite
	cephfs-shell: rewrite help text for put and get commands

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-09-26 22:34:28 -07:00
Jeff Layton
57f91d1550 qa: have kclient tests use new mount.ceph functionality
Now that the mount helper has the ability to discover mon addrs and
can scrape secrets from the keyring, take advantage of it and simplify
the KernelMount class.

Fixes: https://tracker.ceph.com/issues/41892
Signed-off-by: Jeff Layton <jlayton@redhat.com>
2019-09-20 06:50:43 -04:00
Rishabh Dave
d165b98554 test_cephfs_shell: add note on how to run this testsuite
Inform that exporting path to cephfs-shell is needed beforehand.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-17 17:24:30 +05:30
Patrick Donnelly
81d1a162c5
Merge PR #30058 into master
* refs/pull/30058/head:
	qa/tasks: test for prevent negative subvolume size
	mgr/volumes: prevent negative subvolume size

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2019-09-16 11:43:19 -07:00
Patrick Donnelly
9e59ba40c3
Merge PR #28560 into master
* refs/pull/28560/head:
	cephfs-shell: handle du's arguments elsewhere outside do_du()
	cephfs-shell: reuse code
	cephfs-shell: rewrite call to perror in do_du
	pybind/cephfs: define variable for hexcode used in stat()
	test_cephfs_shell: test cephfs-shell command at invocation
	cephfs-shell: refactor do_du()
	cephfs-shell: option -r is not for reverse
	cephfs-shell: extend to_bytes()
	test_cephfs_shell: test du with no args
	test_cephfs_shell: test du with multiple paths in args
	test_cephfs_shell: test behaviour of "du -r"
	test_cephfs_shell: test du's output for softlinks
	qa/cephfs: add convenience method lstat()
	qa/cephfs: add option to make stat() unfollow symlinks
	test_cephfs_shell: test du's output for hardlinks
	test_cephfs_shell: test du's output for directories
	test_cephfs_shell: test du's output for regular files
	test_cephfs_shell: add a method to get command output
	test_cephfs_shell: allow cmd as list too
	test_cephfs_shell: rename and rewrite _cephfs_shell()
	test_cephfs_shell: copy humanize() from cephfs-shell
	cephfs-shell: print disk usage for non-directory files too
	pybind/cephfs: add method that stats symlinks without following
	cephfs-shell: Fix 'du' command error

Reviewed-by: Varsha Rao <varao@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-09-13 12:39:39 -07:00
Jos Collin
9c6be95861
qa/tasks: test for prevent negative subvolume size
Fixes: https://tracker.ceph.com/issues/41617
Signed-off-by: Jos Collin <jcollin@redhat.com>
2019-09-13 16:21:38 +05:30
Rishabh Dave
f9b4d790e5 test_cephfs_shell: test cephfs-shell command at invocation
Verify that "cephfs-shell -c ceph.conf <cephfs-shell-cmd>" works as
expected.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:42 +05:30
Rishabh Dave
79c9d91b9a test_cephfs_shell: test du with no args
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:39 +05:30
Rishabh Dave
54562691ee test_cephfs_shell: test du with multiple paths in args
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:34 +05:30
Rishabh Dave
08c7e2862b test_cephfs_shell: test behaviour of "du -r"
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:31 +05:30
Rishabh Dave
7f7aed5506 test_cephfs_shell: test du's output for softlinks
Test that CephFS shell command du prints output for softlinks as
expected

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:27 +05:30
Rishabh Dave
a8a159cc40 qa/cephfs: add convenience method lstat()
It's more convenient lstat(path) than stat(path, follow_symlink=False).

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:27 +05:30
Rishabh Dave
4a5f7a42e5 qa/cephfs: add option to make stat() unfollow symlinks
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:14 +05:30
Rishabh Dave
877a79d8cf test_cephfs_shell: test du's output for hardlinks
Test that CephFS shell command du prints output for directories as
expected.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:11 +05:30
Rishabh Dave
7062dd6164 test_cephfs_shell: test du's output for directories
Test that CephFS shell command du prints output for directories as
expected.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:08 +05:30
Rishabh Dave
370c97678d test_cephfs_shell: test du's output for regular files
Test that CephFS shell command du prints an output for regular files
correctly.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:45:04 +05:30
Rishabh Dave
d3f895f44a test_cephfs_shell: add a method to get command output
Let run_cephfs_shell_cmd() return the object instead of output in string
format so that stderr, return value, etc. of the command executed
remain available. And add a new method that returns only output of the
CephFS shell command executed.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:44:59 +05:30
Rishabh Dave
f0723d200c test_cephfs_shell: allow cmd as list too
Convert cmd to string if it is passed as list to
run_cephfs_shell_cmd(). Allowing cmd to be list would be nice since
elsewhere, in tests, command to be executed must be a list of arguments
rather than string of arguments separated by spaces.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:44:39 +05:30
Rishabh Dave
e6f3bf8ccd test_cephfs_shell: rename and rewrite _cephfs_shell()
Rename _cephfs_shell() to run_cephfs_shell_cmd() and add a default
client for run_cephfs_shell_cmd() since most of tests in this
testsuite will need only one client.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:44:35 +05:30
Rishabh Dave
e5f30052f9 test_cephfs_shell: copy humanize() from cephfs-shell
Copy the method named humanize from cephfs-shell so that output can be
compared. Unfortunately, importing this method isn't possible since the
dash in "cephfs-shell" leads to an syntax error.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-09-13 10:43:55 +05:30
Patrick Donnelly
ea026df1e3
qa: update json format from session listing
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-09-12 22:09:17 -07:00
Patrick Donnelly
2db3dfdd8a
Merge PR #29760 into master
* refs/pull/29760/head:
	mgr/volumes: cleanup FS subvolume or subvolume group path
	mgr/volumes: give useful error message

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-08-24 21:31:58 -07:00
Ramana Raja
ecf53a3527 mgr/volumes: cleanup FS subvolume or subvolume group path
... on best effort basis when FS subvolume or subvolumegroup create
command fails.

Fixes: https://tracker.ceph.com/issues/41371
Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-08-22 00:46:22 +05:30
Ramana Raja
cbe48308e9 mgr/volumes: give useful error message
... when creating FS subvolume or subvolume group with invalid
data pool layout.

Fixes: https://tracker.ceph.com/issues/41337
Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-08-22 00:46:20 +05:30
Venky Shankar
465a3adc6c test: extend scrub control test to validate mds task status
Signed-off-by: Venky Shankar <vshankar@redhat.com>
2019-08-06 02:33:09 -04:00
Patrick Donnelly
9e106f1422
Merge PR #29104 into master
* refs/pull/29104/head:
	qa/cephfs: test case for timeout config of individual session
	mds: add command that config individual client session

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-31 12:06:39 -07:00
Patrick Donnelly
a6066f4214
Merge PR #29355 into master
* refs/pull/29355/head:
	mgr/volumes: set uid/gid of FS client's mount as 0/0

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-31 11:33:36 -07:00
Patrick Donnelly
602e5f6eb4
qa: sleep briefly after resetting kclient
Continuation of 6b83f43ba0.

Fixes: https://tracker.ceph.com/issues/40999
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-29 14:08:17 -07:00
Yan, Zheng
4b28a4a756 qa/cephfs: test case for timeout config of individual session
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
2019-07-29 14:42:41 +08:00
Ramana Raja
033d9e743a mgr/volumes: set uid/gid of FS client's mount as 0/0
... to allow creating subvolumes/subvolume groups within a filesystem.

Fixes: http://tracker.ceph.com/issues/40927
Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-07-27 19:48:06 +05:30
Patrick Donnelly
6b83f43ba0
qa: wait for kernel client death
After sending the reboot command, we need to wait briefly for it to be
rebooted so that the kernel client doesn't voluntarily give up its Fb
cap.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-26 15:34:17 -07:00
Patrick Donnelly
b75544be86
qa: use hard_reset to reboot kclient
power_off may allow the mounts to gracefully unmount. We don't want this if the
kclient is stuck or we desire the client to "disappear" and come back.

Fixes: http://tracker.ceph.com/issues/37681
Depends-on: https://github.com/ceph/teuthology/pull/1296
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-26 15:34:00 -07:00
Patrick Donnelly
02eace72e2
Merge PR #28793 into master
* refs/pull/28793/head:
	qa/cephfs: make run_shell() accept args as str too
	qa/vstart_runner.py: ignores when source and destination are same
	test_cephfs_shell: add a test for cd with arguments
	test_cephfs_shell: add a test for cd with no arguments
	test_cephfs_shell: group test methods
	test_cephfs_shell: add a new method to return script output
	test_cephfs_shell: allow running CephFS shell script
	cephfs-shell: cd with no args shouldn't print an error message

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-26 15:15:19 -07:00
Patrick Donnelly
200e3fb5cc
Merge PR #29336 into master
* refs/pull/29336/head:
	qa: wait for MDS to come back after removing it

Reviewed-by: Jos Collin <jcollin@redhat.com>
2019-07-26 15:09:14 -07:00
Patrick Donnelly
2adf929f80
Merge PR #29103 into master
* refs/pull/29103/head:
	mgr/volumes: add `ceph fs subvolumegroup getpath` command

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-25 16:12:31 -07:00
Patrick Donnelly
19c724c1d6
qa: wait for MDS to come back after removing it
Fixes: http://tracker.ceph.com/issues/40967
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-25 14:42:34 -07:00
Rishabh Dave
a83ea849d7 qa/cephfs: make run_shell() accept args as str too
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:50 +05:30
Rishabh Dave
d94a42dc1b test_cephfs_shell: add a test for cd with arguments
Add a method to test that the cd command changes the current working
directory to the path passed as an argument to it.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:50 +05:30
Rishabh Dave
dee9ec1650 test_cephfs_shell: add a test for cd with no arguments
Add a method to test that the cd command changes the current working
directory to root when no argument is passed.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:50 +05:30
Rishabh Dave
70f22f69b5 test_cephfs_shell: group test methods
Move tests into different classes created on the basis of a shell
functionality within the testsuite. This arrangement allows running
tests related to only one functionality at a time.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:50 +05:30
Rishabh Dave
2a98e9cb31 test_cephfs_shell: add a new method to return script output
Add a new method that runs the given CephFS shell script on the given
mount and returns the output with whitespace removed.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:28 +05:30
Rishabh Dave
fef0180c93 test_cephfs_shell: allow running CephFS shell script
Add a method to test_cephfs_shell.py that allows running CephFS shell
script using option "-b" of cephfs-shell.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-25 10:51:11 +05:30
Patrick Donnelly
932ea37ca3
Merge PR #22645 into master
* refs/pull/22645/head:
	qa/tests: test if unresponsive MDS client with no caps is evicted directly
	qa/tests: add a method to signal a MDS client
	qa/cephfs: memoize FUSE client pid

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-22 16:24:53 -07:00
Rishabh Dave
80152465b5 qa/tests: test if unresponsive MDS client with no caps is evicted directly
Test if an unresponsive MDS client session holding no caps is evicted
directly at session_autoclose without being marked as stale at
session_timeout.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-20 09:04:50 +05:30
Rishabh Dave
4b77624070 test_sessionmap: use sudo_write_file() from teuthology.misc
Instead of defining a method to write files within the testsuite, use
sudo_write_file() from teuthology.misc.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2019-07-19 10:05:18 +05:30
Patrick Donnelly
64059d6479
Merge PR #28692 into master
* refs/pull/28692/head:
	test_volume_client: add positive test for ceph_volume_client method
	test_volume_client: rename test_put_object_versioned()
	test_volume_client: rewrite test_put_object_versioned
	test_volume_client: use sudo_write_file() form teuthology
	test_volume_client: make test_object_versioned py3 compatible

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2019-07-18 14:03:50 -07:00
Ramana Raja
4ac6c2acc2 mgr/volumes: add ceph fs subvolumegroup getpath command
... to return the path of a FS subvolume group.

Fixes: http://tracker.ceph.com/issues/40617

Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-07-18 15:54:05 +05:30