Skip to content

Commit

Permalink
qa/tasks/mgr/dashboard: Fix login expires too soon
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
  • Loading branch information
sebastian-philipp committed Mar 23, 2018
1 parent f0b780f commit 5308630
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qa/tasks/mgr/dashboard/test_auth.py
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 5308630

Please sign in to comment.