Skip to content

Commit

Permalink
Merge pull request #1631 from grycap/stats
Browse files Browse the repository at this point in the history
Stats
  • Loading branch information
micafer authored Nov 6, 2024
2 parents b01bd60 + 433c0f6 commit 1c46815
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/integration/TestIM.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,12 @@ def test_40_export_import(self):
self.assertTrue(
success, msg="ERROR calling ImportInfrastructure: " + str(res))

def test_45_stats(self):
(success, res) = self.server.GetStats(None, None, self.auth_data)
self.assertTrue(
success, msg="ERROR calling GetStats: " + str(res))
self.assertEqual(len(res), 3, msg="ERROR getting stats: Incorrect number of infrastructures")

def test_50_destroy(self):
"""
Test DestroyInfrastructure function
Expand Down
6 changes: 6 additions & 0 deletions test/integration/TestREST.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ def test_57_reconfigure_list(self):
self.assertTrue(
all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).")

def test_58_stats(self):
resp = self.create_request("GET", "/stats")
self.assertEqual(resp.status_code, 200, msg="ERROR getting stats:" + resp.text)
stats = resp.json()["stats"]
self.assertEqual(len(stats), 2, msg="Incorrect number of stats: " + resp.text)

def test_60_stop(self):
time.sleep(10)
resp = self.create_request("PUT", "/infrastructures/" + self.inf_id + "/stop")
Expand Down

0 comments on commit 1c46815

Please sign in to comment.