Skip to content

Commit

Permalink
Merge pull request #21021 from sebastian-philipp/dashboard-auth-qa-fix
Browse files Browse the repository at this point in the history
qa/tasks/mgr/dashboard: Fix login expires too soon

Reviewed-by: Ricardo Dias <rdias@suse.com>
  • Loading branch information
rjfd committed Mar 23, 2018
2 parents 9a031ba + d101b33 commit f21ed94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qa/tasks/mgr/dashboard/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
class AuthTest(DashboardTestCase):
def setUp(self):
self.reset_session()
self._ceph_cmd(['dashboard', 'set-session-expire', '2'])
self._ceph_cmd(['dashboard', 'set-login-credentials', 'admin', 'admin'])

def test_a_set_login_credentials(self):
Expand Down Expand Up @@ -60,13 +59,15 @@ def test_logout(self):
self.assertStatus(401)

def test_session_expire(self):
self._ceph_cmd(['dashboard', 'set-session-expire', '2'])
self._post("/api/auth", {'username': 'admin', 'password': 'admin'})
self.assertStatus(201)
self._get("/api/host")
self.assertStatus(200)
time.sleep(3)
self._get("/api/host")
self.assertStatus(401)
self._ceph_cmd(['dashboard', 'set-session-expire', '1200'])

def test_unauthorized(self):
self._get("/api/host")
Expand Down

0 comments on commit f21ed94

Please sign in to comment.