diff --git a/test/integration/command/user_test.py b/test/integration/command/user_test.py index c9563198af7..c3be4abed76 100644 --- a/test/integration/command/user_test.py +++ b/test/integration/command/user_test.py @@ -406,6 +406,10 @@ def test_remote_auth_server_expire_token_secret(self): "user", "pass", "user", "pass", "user", "pass"]) c.run("remote auth *") + assert "Remote 'default' needs authentication, obtaining credentials" in c.out + assert "user: myuser" in c.out + c.run("remote auth *") + assert "Remote 'default' needs authentication, obtaining credentials" not in c.out assert "user: myuser" in c.out # Invalidate server secret server.test_server.ra.api_v2.credentials_manager.secret = "potato" @@ -436,3 +440,15 @@ def test_remote_auth_server_expire_token(self): time.sleep(3) c.run("remote auth *") assert "error: Too many failed login attempts, bye!" in c.out + + def test_auth_after_logout(self): + server = TestServer(users={"myuser": "password"}) + c = TestClient(servers={"default": server}, inputs=["myuser", "password"]*2) + c.run("remote auth *") + assert "Remote 'default' needs authentication, obtaining credentials" in c.out + assert "user: myuser" in c.out + c.run("remote logout *") + assert "Changed user of remote 'default' from 'myuser' (authenticated) to 'None'" in c.out + c.run("remote auth *") + assert "Remote 'default' needs authentication, obtaining credentials" in c.out + assert "user: myuser" in c.out