Commit Graph

411 Commits

Author SHA1 Message Date
Lenz Grimmer
54d32ce144
Merge pull request #32680 from votdev/wip-force-pwd
mgr/dashboard: Enforce password change upon first login

Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2020-02-21 15:45:35 +00:00
Alfonso Martínez
7cbee4d725 mgr/dashboard: fix tasks.mgr.dashboard.test_rgw suite
Fixes: https://tracker.ceph.com/issues/44201
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
2020-02-20 10:47:38 +01:00
Sage Weil
7c9efa6bdf mgr/test_orchestrator: describe_service -> list_daemons
Signed-off-by: Sage Weil <sage@redhat.com>
2020-02-19 11:01:13 -06:00
Sage Weil
93d53c05b0 qa/tasks/mgr/dashboard/test_orchestrator: disable services test
We need to either fill out the list_daemons APIs in the dashboard and test
that, or redesign and reimplement the services abstractions in the
orchestration layer.  Until then, disable this test.

Signed-off-by: Sage Weil <sage@redhat.com>
2020-02-19 11:01:13 -06:00
Volker Theile
b37079a6fc mgr/dashboard: Enforce password change upon first login - Part 2
Introduce the following:
- A new layout component for the login pages.
- A new route called /login-change-password.
- A guard that checks if a user must change the password (ChangePasswordGuardService). If this is true, redirect to /login-change-password.
- Added LoginPasswordFormComponent (extends UserPasswordFormComponent) for the password form but (looks similar the login page).

Fixes: tracker.ceph.com/issues/24655

Signed-off-by: Volker Theile <vtheile@suse.com>
2020-02-19 15:54:42 +01:00
Tatjana Dehler
310f787687 mgr/dashboard: Enforce password change upon first login
Fixes: https://tracker.ceph.com/issues/24655
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2020-02-19 15:54:42 +01:00
Sebastian Wagner
ae5d2c6ab2
Merge pull request #32817 from sebastian-philipp/rename-orchestrator_cli-orchestrator
pybind/mgr: Rename orchestrator_cli to orchestrator

Reviewed-by: Sage Weil <sage@redhat.com>
2020-02-18 10:05:30 +01:00
Lenz Grimmer
9269f550b3
Merge pull request #33013 from s0nea/wip-dashboard-43912
mgr/dashboard: wait for PG unknown state to be cleared

Reviewed-by: Patrick Seidensal <pnawracay@suse.com>
2020-02-17 15:34:11 +00:00
Sebastian Wagner
f2c5472286 mgr/orchestrator_cli: rename to mgr/orchestrator
* Move `mgr/orchestrator.py` to `orchestrator/_interface.py`

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-17 10:24:01 +01:00
Kefu Chai
1d22ff29fb
Merge pull request #33347 from tchaikov/wip-orch-addr
mgr/orchestrator: "addr" is optional for constructing InventoryNode

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-15 22:16:50 +08:00
Kefu Chai
e470481d71
Merge pull request #33325 from tchaikov/wip-super-setup
qa/tasks: call super class's setUp()

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2020-02-15 18:46:51 +08:00
Kefu Chai
9000afb24b qa/tasks/mgr/orch: s/service ls/ps/
to fix the broken test of "test_load_data". it's a regression introduced
by aacc9a650f

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-15 18:41:18 +08:00
Kefu Chai
7d262db114 qa/tasks: call super class's setUp()
to address the regression introduced by
8729281121

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-15 12:39:08 +08:00
Kefu Chai
87172bcf63 mgr/dashboard: s/fsid/mirror_uuid/
to fix the broken rbd-mirror test. it's a regression introduced by
7b07e3c9dc

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-15 12:29:09 +08:00
Sage Weil
aacc9a650f mgr/orch: service ls -> ps, add DaemonDescription
- We keep ServiceDescription around unmodified (although it will need some
  cleanup later)
- We add DaemonDescription, and clean out the service-related ambiguities
- Add a new list_daemons() method for Orchestrator
- Add a new 'ceph orch ps' command
- In cephadm, drop get_services(), and implement list_daemons()
  - a million changes to make this work
- Adjust health alert and option names

Signed-off-by: Sage Weil <sage@redhat.com>
2020-02-12 11:14:17 -06:00
Sage Weil
95ecaad0d5 mgr/orch: split out daemon_action from service_action
Signed-off-by: Sage Weil <sage@redhat.com>
2020-02-12 11:14:17 -06:00
Kiefer Chang
9fd1743e1d
qa/tasks/mgr/dashboard/test_orchestrator: support addr attribute in inventory
The missing attribute `addr` causes error when loading dummy data.

Fixes: https://tracker.ceph.com/issues/44054
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
2020-02-11 23:08:29 +08:00
Sage Weil
20205e70c4 mgr/orch: 'ceph orchestrator ...' -> 'ceph orch ...'
Less typing for all!

Signed-off-by: Sage Weil <sage@redhat.com>
2020-02-09 15:39:57 -06:00
Tatjana Dehler
4515ab32fa
Merge pull request #32546 from votdev/issue_43089_passwd_cmplx_config
mgr/dashboard: Make password policy check configurable

Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2020-02-06 09:44:48 +01:00
Kefu Chai
062e0365ea qa/tasks: drop test_cephadm_orchestrator.py
this test will end with a failure like

```
2020-01-30T18:15:15.870 INFO:tasks.ceph.mgr.x.smithi042.stderr:Warning: Permanently added 'smithi042.front.sepia.ceph.com,172.21.15.42' (ECDSA) to the list of known hosts.
2020-01-30T18:15:15.925 INFO:tasks.ceph.mgr.x.smithi042.stderr:Permission denied, please try again.
2020-01-30T18:15:15.932 INFO:tasks.ceph.mgr.x.smithi042.stderr:Permission denied, please try again.
2020-01-30T18:15:15.939 INFO:tasks.ceph.mgr.x.smithi042.stderr:root@smithi042.front.sepia.ceph.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
```

because mgr is not able to establish an ssh connection to that host with "root".
please note, the teuthology worker is acting using the "ubuntu" account on the
test node, and by default, "root" does not have its pubkey. and actually
`qa/tasks/cephadm.py` does push the pubkey to all the managed hosts before
testing cephadm.

since `qa/tasks/cephadm.py` is a better test for cephadm, let's just
drop this one.

as suites/rados/cephadm already covers cephadm

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-06 09:53:17 +08:00
Kiefer Chang
c9b12e2b66
qa/tasks/mgr/test_orchestrator_cli: support multiple DriveGroups
create_osds interface in Orchestrator supports multiple named DriveGroups
since https://github.com/ceph/ceph/pull/32972. Adapt the changes in
the test.

Fixes: https://tracker.ceph.com/issues/43945
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
2020-02-04 14:31:21 +08:00
Tatjana Dehler
6ffb3e4097 mgr/dashboard: wait for PG unknown state to be cleared
Give the cluster some time to recover from the unknown
PG state before checking if the OSD is safe to destroy.

Fixes: https://tracker.ceph.com/issues/43912
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2020-02-03 11:58:10 +01:00
Volker Theile
3684d24a43 mgr/dashboard: Make password policy check configurable
Fixes: https://tracker.ceph.com/issues/43089

Signed-off-by: Volker Theile <vtheile@suse.com>
2020-01-31 11:28:17 +01:00
Sage Weil
81fc73b24e Merge PR #32788 into master
* refs/pull/32788/head:
	qa/tasks/mgr/dashboard: set pg_num to 32
	mgr/pg_autoscaler: default to pg_num[_min] = 32

Reviewed-by: Sage Weil <sage@redhat.com>
2020-01-24 08:32:13 -06:00
Neha
d6e720b29e qa/tasks/mgr/dashboard: set pg_num to 32
Signed-off-by: Neha Ojha <nojha@redhat.com>
2020-01-22 16:38:38 +00:00
Volker Theile
944490f34f mgr/dashboard: Clone an existing user role
Fixes: https://tracker.ceph.com/issues/43603

Signed-off-by: Volker Theile <vtheile@suse.com>
2020-01-21 14:51:56 +01:00
Laura Paduano
f22247fd28
Merge pull request #32032 from votdev/issue_43088_passwd_async_validator
mgr/dashboard: Process password complexity checks immediately

Reviewed-by: Lenz Grimmer <lgrimmer@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2020-01-14 11:15:10 +01:00
Kefu Chai
7210d7f951 qa/tasks/mgr: set mgr module option with --force
if mgr is not active, monitor will refuse to set any option consumed by
mgr modules.

the reason the tests pass somtimes is that, we have a racing here:

1. stop all mgr daemons
2. MgrMonitor gets updated and updates its mgr_module_options
accordingly.
3. in TestDashboard.setUp(), we reset the port number for dashboard
using "ceph config set mgr mgr/dashboard/y/ssl_server_port 7789"
4. restart all mgr daemons

but the 2nd step and 3rd step could race with each other, if the 2nd
step happens after 3rd step, the test passes. otherwise it fails.

in this change, "--force" is passed to the "ceph config set" command,
so ConfigMonitor can bypass the sanity test for the option, and just
set this option.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-01-10 13:28:34 +08:00
Kefu Chai
2fe9771842
Merge pull request #32575 from tchaikov/wip-43227
qa/tasks/mgr/dashboard: set pg_num to 16

Reviewed-by: Volker Theile <vtheile@suse.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
2020-01-09 23:23:15 +08:00
Kefu Chai
15a5ebdce2 qa/tasks/mgr/dashboard: set pg_num to 16
as the default pg_num is now 16 since 78bf9244, and the minimum pg_num
is also 16 in autoscaler since 78bf9244.

Fixes: https://tracker.ceph.com/issues/43227
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-01-09 20:54:56 +08:00
Tatjana Dehler
1c18ca31fd
Merge pull request #32234 from votdev/better_orch_exception
mgr/dashboard: Throw a more meaningful exception

Reviewed-by: Sebastian Wagner <swagner@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2020-01-09 13:41:43 +01:00
Tatjana Dehler
b9094f1e17 mgr/dashboard: fix failing user tests
Choose another future_date_1 date (9 days instead of 10) to
make sure the expiration date will be between future_date_1
and future_date_2. Otherwise the expiration date might be
equal to future_date_1.
Also wait for 10 seconds before the password refresh in
test_pwd_expiration_date_update to prevent date equality.

Fixes: https://tracker.ceph.com/issues/43431
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2020-01-07 11:56:52 +01:00
Kefu Chai
0150ac9daa
Merge pull request #32518 from tchaikov/wip-orchestrator-service-action-tests
qa/tasks/mgr/test_orchestrator_cli: fix service action tests

Reviewed-by: Thomas Bechtold <tbechtold@suse.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
2020-01-07 17:44:10 +08:00
Kefu Chai
ccfaf40491
Merge pull request #32428 from tchaikov/wip-qa-mgr-mon-update
qa/tasks/mgr/test_orchestrator_cli: fix "mon update" test

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2020-01-07 16:29:34 +08:00
Kefu Chai
4c98b3224e qa/tasks/mgr/test_orchestrator_cli: fix service action tests
in b77f0c74a5, "reload"
service[-instance] action was dropped. so replace "reload" with
"restart" in the related tests.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-01-07 16:00:04 +08:00
Volker Theile
bf567f4308 mgr/dashboard: Various fixes
* Remove scope and permission check from UserPasswordPolicy controller again, otherwise the Angular UI validator can't be executed for users without that privilege.
* Remobe obsolete QA test.

Signed-off-by: Volker Theile <vtheile@suse.com>
2020-01-02 11:06:58 +01:00
Tatjana Dehler
7015c2a82b mgr/dashboard: fix REST API test cases
1. Fix the test cases by using the 'assertJsonBody'
   method. The '_post' method doesn't return anything.
   That's why we need to use the 'assertJsonBody'
   method here instead of checking the fields directly.

2. Add the missing scope and permission definition of the
   'validate_password' resource. Otherwise the resource
   is not restricted and 'test_validate_password_invalid_permissions'
   will fail.

3. Re-word error messages. Change 'cannot' to 'must not'.

Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2020-01-02 10:49:37 +01:00
Volker Theile
01c4bcadf6 mgr/dashboard: Process password complexity checks immediately
- Add 'api/user/validate_password' endpoint to check if a
  password meets the password policy. A new controller has
  to be added for 'api/user' which has NO security scope,
  otherwise it wouldn't be possible for users without USER
  privileges to call the endpoint.
- Add Angular async validator to check if the entered password
  meets the policy.

Fixes: https://tracker.ceph.com/issues/43088

Signed-off-by: Volker Theile <vtheile@suse.com>
2020-01-02 10:49:37 +01:00
Kefu Chai
570f18f4c8 qa: add "path" to "device" output schema
"path" was added by 2c0fd7d868, so update
the test accordingly

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-27 00:25:51 +08:00
Kefu Chai
37fd93d67e qa/tasks/mgr/test_orchestrator_cli: fix "mon update" test
we need at least one of "hosts" and "label" since
1498170aaa

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-26 16:31:47 +08:00
Sage Weil
2b2c122fd8 qa/tasks/mgr/test_orchestrator_cli: fix device ls test
No more "$host:" formatting as of 594179f1aa

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-20 16:14:34 -06:00
Volker Theile
b7a40007ad mgr/dashboard: Use @raise_if_no_orchestrator
Signed-off-by: Volker Theile <vtheile@suse.com>
2019-12-16 12:44:59 +01:00
Lenz Grimmer
1143de2ff8
mgr/dashboard: CephFS quota management (#31811)
mgr/dashboard: CephFS quota management

Reviewed-by: Patrick Seidensal <pnawracay@suse.com>
Reviewed-by: Ricardo Marques <rimarques@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
2019-12-16 09:55:36 +00:00
Lenz Grimmer
efdcbcc6e1
mgr/dashboard: add password expiration date (#30939)
mgr/dashboard: add password expiration date

Reviewed-by: Ricardo Marques <rimarques@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
2019-12-16 09:49:16 +00:00
Stephan Müller
16bae1a3e3 mgr/dashboard: CephFS quota management
Now both CephFS quotas can be changed with a validation against the next
tree maximum in the file tree, that prevents setting the quotas in a way
that would not be usable.

Fixes: https://tracker.ceph.com/issues/38287
Signed-off-by: Stephan Müller <smueller@suse.com>
2019-12-13 15:15:34 +01:00
Tatjana Dehler
0221241909 mgr/dashboard: add password expiration date
Add a 'pwd_expiration_date' field to the User object to be able
to set password expiration date per user.

There are two options to set a password expiration date for a
user:

1. Set the 'USER_PWD_EXPIRATION_SPAN' setting. If defined
   the expiration date of the password will be calculated
   automatically based on the given value. It will also be
   updated automatically when the user changes the password.
2. Set an expiration date by setting the 'pwdExpirationDate'
   field when creating a user.

Add two more settings in addition: USER_PWD_EXPIRATION_WARNING_1
and USER_PWD_EXPIRATION_WARNING_2. These two settings are
defining the amount of days to notify the user that his password
will expiration soon.

It's not possible to set the 'pwd_expiration_date' field to a
date in the past.

If the password of a user is already expired he is no longer
allowed to log into the dashboard.

Fixes: https://tracker.ceph.com/issues/40329
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2019-12-13 08:53:05 +01:00
Thomas Bechtold
0127cd1e88 qa: Enable flake8 tox and fix failures
There were a couple of problems found by flake8 in the qa/
directory (most of them fixed now). Enabling flake8 during the usual
check runs hopefully avoids adding new issues in the future.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-12-12 10:21:01 +01:00
Sage Weil
cd1c05acbb mgr/ssh -> mgr/cephadm
Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-11 19:14:24 -06:00
Tatjana Dehler
6a988938ac qa/tasks/mgr/dashboard/test_health: update schema
Fixes: https://tracker.ceph.com/issues/43195
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2019-12-09 16:12:12 +01:00
Sage Weil
99eb52b68a mgr/orchestrator_cli: make rgw rm take realm+zone
And adjust test accordingly

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-07 23:41:36 -06:00