diff --git a/pymisp/aping.py b/pymisp/aping.py index d5fb232..e36cd01 100644 --- a/pymisp/aping.py +++ b/pymisp/aping.py @@ -179,6 +179,10 @@ class ExpandedPyMISP(PyMISP): response = self._prepare_request('POST', f'/servers/restartWorkers') return self._check_response(response, expect_json=True) + def db_schema_diagnostic(self): + response = self._prepare_request('GET', f'/servers/dbSchemaDiagnostic') + return self._check_response(response, expect_json=True) + def toggle_global_pythonify(self): self.global_pythonify = not self.global_pythonify diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 5e02d77..db63944 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -1561,6 +1561,10 @@ class TestComprehensive(unittest.TestCase): self.assertEqual(entry.action, 'edit') r = self.admin_misp_connector.update_user({'email': 'testusr@user.local'}, self.test_usr) + def test_db_schema(self): + diag = self.admin_misp_connector.db_schema_diagnostic() + self.assertEqual(diag['actual_db_version'], diag['expected_db_version'], diag) + def test_live_acl(self): missing_acls = self.admin_misp_connector.remote_acl() self.assertEqual(missing_acls, [], msg=missing_acls)