Commit dc21ad4c authored by Andrew Walker's avatar Andrew Walker
Browse files

Expand API key testing

Root level API key should be able to start / stop services and
enable / disable services.
No related merge requests found
Showing with 11 additions and 0 deletions
+11 -0
......@@ -39,6 +39,17 @@ def test_root_api_key_websocket(request):
assert results['result'] is True, f'out: {results["output"]}, err: {results["stderr"]}'
assert 'uptime' in str(results['stdout'])
with client(auth=None) as c:
assert c.call("auth.login_with_api_key", key)
# root-level API key should be able to start / stop services
c.call("service.start", "cifs")
c.call("service.stop", "cifs")
# root-level API key should be able to enable / disable services
c.call("service.update", "cifs", {"enable": True})
c.call("service.update", "cifs", {"enable": False})
def test_allowed_api_key_websocket(request):
"""We should be able to call a method with API key that allows that call using Websocket."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment