File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -500,3 +500,21 @@ def test_get_meshagent_url_docker(self):
500
500
r ,
501
501
"http://tactical-meshcentral:4443/meshagents?id=4&meshid=abc123&installflags=0" ,
502
502
)
503
+
504
+
505
+ class TestMonitoring (TacticalTestCase ):
506
+ url = "/core/status/"
507
+
508
+ def setUp (self ):
509
+ self .setup_client ()
510
+ self .setup_coresettings ()
511
+
512
+ def test_prometheus_missing_auth_header_request (self ):
513
+ r = self .client .get (self .url )
514
+ self .assertEqual (r .status_code , 400 )
515
+
516
+ @override_settings (MON_TOKEN = "MySuperTestSecret" )
517
+ def test_prometheus_correct_request (self ):
518
+ header = {"Authorization" : "Bearer MySuperTestSecret" }
519
+ r = self .client .get (self .url , ** header )
520
+ self .assertEqual (r .status_code , 200 )
You can’t perform that action at this time.
0 commit comments