summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_https.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-04-07 15:04:55 -0500
committerJohn Estabrook <jestabro@vyos.io>2022-04-07 16:11:51 -0500
commit84bfac85a711d22d97e1ee39a5233738e14a7750 (patch)
treee943d2dbdf44e454f7d0d91d3a7c7a0f7f522b67 /smoketest/scripts/cli/test_service_https.py
parent143621114e715eec996a2368011d7f559e89fa07 (diff)
downloadvyos-1x-84bfac85a711d22d97e1ee39a5233738e14a7750.tar.gz
vyos-1x-84bfac85a711d22d97e1ee39a5233738e14a7750.zip
smoketest: http: add check for missing key
Diffstat (limited to 'smoketest/scripts/cli/test_service_https.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_https.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_https.py b/smoketest/scripts/cli/test_service_https.py
index 921344255..9413d22d1 100755
--- a/smoketest/scripts/cli/test_service_https.py
+++ b/smoketest/scripts/cli/test_service_https.py
@@ -133,5 +133,10 @@ class TestHTTPSService(VyOSUnitTestSHIM.TestCase):
# Must get HTTP code 401 on invalid key (Unauthorized)
self.assertEqual(r.status_code, 401)
+ payload_no_key = {'data': '{"op": "showConfig", "path": []}'}
+ r = request('POST', url, verify=False, headers=headers, data=payload_no_key)
+ # Must get HTTP code 401 on missing key (Unauthorized)
+ self.assertEqual(r.status_code, 401)
+
if __name__ == '__main__':
unittest.main(verbosity=2)