Commit Graph

59 Commits

Author SHA1 Message Date
John Mulligan
e03331e7c4 qa/test_nfs: fix test failure when cluster does not exist
The patches that add object formatting / decorators to the nfs module
also made error handling more generic when accessing an nfs cluster and
now returns a nonzero exit code. A test was after the PR adding the
object format support that only checked an error message.
Update the test to match the new nfs module behavior as well as fixing a
typo.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-01-12 15:43:54 -05:00
John Mulligan
57e94dd502 cephfs/test_nfs: adapt _test_list_cluster to expect JSON output
Previously, the '... nfs cluster ls' command emitted newline separated
list of cluster names. For consistency with other module commands
reporting via JSON the cluster ls mgr function now emits JSON. Update
the test to match the new behavior of the module.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2023-01-12 13:44:11 -05:00
dparmar18
b91aff831d qa/test_nfs: added testcase test_non_existent_cluster
Fixes: https://tracker.ceph.com/issues/58138
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
2022-12-22 19:44:17 +05:30
Redouane Kachach
992d63849b
mgr/cephadm: check for events key before accessing it
Fixes: https://tracker.ceph.com/issues/55808

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2022-06-29 17:13:48 +02:00
Ramana Raja
d7904e78d1 cephfs/test_nfs: Add test for dynamic update export
Add test to verify that the NFS servers don't restart when the
access type of a CephFS NFS export is updated.

And check the NFS servers are restarted when the pseudo path of
a CephFS NFS export is updated.

Signed-off-by: Ramana Raja <rraja@redhat.com>
2022-03-15 18:27:10 -04:00
Ramana Raja
3c22f6eb71 cephfs/test_nfs: fix _write_to_read_only_export()
... to fail the test if write to read only export succeeded.

Signed-off-by: Ramana Raja <rraja@redhat.com>
2022-03-13 20:14:50 -04:00
Matan Breizman
44ad552093 qa/tasks/cephfs: increase timeout in test_nfs.py
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2022-02-15 10:47:43 +00:00
Sage Weil
fa4ee0f3c6 qa/tasks/cephfs/test_nfs: use keyword args
Signed-off-by: Sage Weil <sage@newdream.net>
2021-11-02 17:06:58 -04:00
Sage Weil
d7acc16860 qa/tasks/cephfs/test_nfs: wait for fs to come up before exporting
Signed-off-by: Sage Weil <sage@newdream.net>
2021-10-28 13:28:35 -04:00
Sage Weil
d41b60404d qa/tasks/cephfs/test_nfs: define NFS_POOL_NAME
We can't import from mgr_module.py from here, sadly.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-07-14 16:20:11 -04:00
Sage Weil
1e6fd912f6 qa/tasks/cephfs/test_nfs: retry mount a few times
It may take a moment for a ganesha to (re)configure itself with a new
export.  If a mount fails, retry a couple times.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-07-14 16:20:11 -04:00
Sage Weil
82e939d89c mgr/nfs: change nfs pool to .nfs
This is a new pool that we can migrate all past NFS configuration to,
simplifying the migration process (and also allowing us to pick a
.-prefixed name).

Signed-off-by: Sage Weil <sage@newdream.net>
2021-07-14 16:20:11 -04:00
Patrick Donnelly
e2b39f6c8c
qa: avoid using sudo for regular test artifacts
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-07-01 10:56:10 -07:00
Sage Weil
8788af5663 qa/tasks/cephfs/test_nfs: fiddle with sudo
- no sudo for 'ceph' commands
- explicit sudo for _sys_cmd (things like 'rados' don't need sudo!)

Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-26 08:47:06 -04:00
Sage Weil
10786a6380 mgr/nfs: move user create/delete into helper
- Do user create or delete via a helper
- Defer until after we have validated the Export (on create or update)
- Support updates to user_id, which is needed to keep the naming consistent
and to also support changing the bucket, since the user_id is derived
from that.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-25 19:13:09 -04:00
Sage Weil
6fb9f0a391 qa/tasks/cephfs/test_nfs: test new export via apply
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-21 14:13:15 -04:00
Sage Weil
a2679b3884 mgr/nfs: fix tests
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-21 14:13:15 -04:00
Sage Weil
2400937ce2 mgr/nfs: 'nfs export get' -> 'nfs export info'
This is a breaking change, but aligns the CLI verbs with the rest of ceph.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-21 14:13:15 -04:00
Sage Weil
b276adbd47 mgr/nfs: more revisions based on review
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-21 14:13:15 -04:00
Sage Weil
473097a36f mgr/nfs/export: fix tests
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-21 14:13:15 -04:00
Sage Weil
9b1372dc38 mgr/nfs: name nfs cephfs client key 'nfs.{cluster_id}.{export_id}'
Better than '{cluster_id}{export_id}', which is confusing and ambiguous.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-17 16:18:06 -04:00
Sage Weil
b18427da4b Merge PR #41509 into master
* refs/pull/41509/head:
	common/cmdparse: fix CephBool validation for tell commands
	mgr/nfs: fix 'nfs export create' argument order
	common/cmdparse: emit proper json
	mon/MonCommands: add -- seperator to example
	qa/tasks/cephfs/test_nfs: fix export create test
	mgr: make mgr commands compat with pre-quincy mon
	doc/_ext/ceph_commands: handle non-positional args in docs
	mgr: fix reweight-by-utilization cephbool flag
	mon/MonCommands: convert some CephChoices to CephBool
	mgr/k8sevents: fix help strings
	pybind/mgr/mgr_module: fix help desc formatting
	mgr/orchestrator: clean up 'orch {daemon add,apply} rgw' args
	mgr/orchestrator: add end_positional to a few methods
	mgr/orchestrator: reformat a few methods
	pybind/ceph_argparse: stop parsing when we run out of positional args
	pybind/ceph_argparse: remove dead code
	pybind/mgr/mgr_module: infer non-positional args
	pybind/mgr/mgr_module: add separator for non-positional args
	command/cmdparse: use -- to separate positional from non-positional args
	pybind/ceph_argparse: adjust help text for non-positional args
	pybind/ceph_argparse: track a 'positional' property on cli args

Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-06-07 10:02:52 -04:00
Sage Weil
8683cccd06 qa/tasks/cephfs/test_nfs: fix export create test
Everything after --readonly is non-positional.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-04 16:56:17 -04:00
Sage Weil
218eec938d qa/tasks/cephfs/test_nfs: fix info test
Signed-off-by: Sage Weil <sage@newdream.net>
2021-05-25 10:15:45 -04:00
Sage Weil
ad0a62dc9d mgr/nfs: delete -> rm for CLI
The rest of the CLI uses 'rm' in place of 'remove' or 'delete', so let's
deprecate 'delete' and add 'rm'.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-05-20 18:38:18 -04:00
Varsha Rao
94644d1e5f qa/tasks/nfs: add test to check if cmds fail on not passing required arguments
Signed-off-by: Varsha Rao <varao@redhat.com>
2021-05-14 21:03:50 +05:30
Varsha Rao
2a99da961a mgr/nfs: Don't enable nfs module by default
Signed-off-by: Varsha Rao <varao@redhat.com>
2021-04-22 11:38:30 +05:30
Michael Fritch
e9b2c38354
mgr/volumes/nfs: drop type param during cluster create
PR #37600 introduced support for both `cephfs` and `rgw` exports
to be configured using a single nfs-ganesha cluster

Fixes: https://tracker.ceph.com/issues/50369
Signed-off-by: Michael Fritch <mfritch@suse.com>
2021-04-14 18:21:36 -06:00
Varsha Rao
0928858db0 qa/tasks/cephfs/nfs: Add tests for updating fs exports
Signed-off-by: Varsha Rao <varao@redhat.com>
2021-03-04 15:18:07 +05:30
Varsha Rao
24b70c5186 mgr/volumes/nfs: remove 'ganesha-' prefix from cluster id
Orchestrator defines service name as "<service_type>.<service_id>". The ganesha
common config object name in orchestrator is "conf-<service_name>". Volume's
nfs plugin deploys nfs-ganesha clusters with 'ganesha' prefixed to cluster id
and common config object.  It can cause unecessary issues in rook and cephadm.
So let's remove the prefix.

Fixes: https://tracker.ceph.com/issues/48514
Signed-off-by: Varsha Rao <varao@redhat.com>
2021-01-08 12:35:53 +05:30
Varsha Rao
4c83f93f83 qa/cephfs/nfs: Add test for readonly export
Fixes: https://tracker.ceph.com/issues/48622
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-12-22 11:47:38 +00:00
Varsha Rao
db50dd29c3 qa/tasks/cephfs/nfs: Check if host ip is in cluster info output
Along with host IP, sometimes Docker container IP's shows up in 'hostname -I'
output. Since this output is variable. Just check if host IP is present in the
cluster info output.

Fixes: https://tracker.ceph.com/issues/48491
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-12-09 16:52:50 +00:00
Varsha Rao
97959d249a qa/tasks/cephfs/nfs: Check ganesha daemon status after restarting mgr
Fixes: https://tracker.ceph.com/issues/47591
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-10-06 22:56:05 +05:30
Rishabh Dave
aa08a38b61 qa/cephfs: add a note to test_nfs.py
A note that tells that test_nfs.py is not yet compatible with
vstart_runner.py.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2020-09-16 22:10:42 +05:30
Varsha Rao
f56a83f806 qa/tasks/nfs: Test mounting of export created with nfs command
Fixes: https://tracker.ceph.com/issues/46989
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-24 17:04:45 +05:30
Varsha Rao
5d6742b6b4 qa/tasks/nfs: Add helper method to check nfs cluster status
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-24 17:04:40 +05:30
Varsha Rao
e94a250cb0 qa/tasks/nfs: Cleanup created filesystem
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-24 17:00:42 +05:30
Varsha Rao
91e89a4df5 qa/tasks/nfs: Remove unused port status function and 'stdin' keyword argument
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-24 17:00:42 +05:30
Varsha Rao
5c4e659067 qa/tasks/nfs: Instead of 'orch ls' use 'orch ps'
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-20 15:18:31 +00:00
Varsha Rao
049afe5a7e qa/tasks/nfs: Delete nfs cluster after exports are created
Fixes: https://tracker.ceph.com/issues/47009
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-20 14:27:25 +00:00
Varsha Rao
bba2d66176 qa/tasks/cephfs/nfs: Add tests for cluster config set and reset
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-08-10 10:54:31 +00:00
Varsha Rao
801047f6cb qa/tasks/nfs:Add test for relative and just '/' pseudo path
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-07-23 13:03:38 +05:30
Varsha Rao
93aa5e4012 qa/tasks/test_nfs: Add test for cluster info
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-07-07 10:50:22 +05:30
Varsha Rao
d7396fdc0f qa/tasks/test_nfs: Add todo note for cluster update test
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
5f506e3969 qa/tasks/cephfs/test_nfs: Add test for get and list detailed export
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
1aa2a660bd qa/tasks/cephfs/test_nfs: Add test for export user id
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
dfa3ab4349 qa/tasks/cephfs/test_nfs: Add description for each test
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
eab60b5fad qa/tasks/cephfs: Add tests for export create with non-existing fsname and cluster id
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
285ab1b4ae qa/tasks/cephfs: Add tests for invalid cluster id, export type and modify list cluster
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30
Varsha Rao
9418b42b29 qa/tasks/cephfs: Add test for listing exports
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-06-30 23:17:38 +05:30