Skip to content

Commit 1c46815

Browse files
authored
Merge pull request #1631 from grycap/stats
Stats
2 parents b01bd60 + 433c0f6 commit 1c46815

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/integration/TestIM.py

+6
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ def test_40_export_import(self):
509509
self.assertTrue(
510510
success, msg="ERROR calling ImportInfrastructure: " + str(res))
511511

512+
def test_45_stats(self):
513+
(success, res) = self.server.GetStats(None, None, self.auth_data)
514+
self.assertTrue(
515+
success, msg="ERROR calling GetStats: " + str(res))
516+
self.assertEqual(len(res), 3, msg="ERROR getting stats: Incorrect number of infrastructures")
517+
512518
def test_50_destroy(self):
513519
"""
514520
Test DestroyInfrastructure function

test/integration/TestREST.py

+6
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ def test_57_reconfigure_list(self):
363363
self.assertTrue(
364364
all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).")
365365

366+
def test_58_stats(self):
367+
resp = self.create_request("GET", "/stats")
368+
self.assertEqual(resp.status_code, 200, msg="ERROR getting stats:" + resp.text)
369+
stats = resp.json()["stats"]
370+
self.assertEqual(len(stats), 2, msg="Incorrect number of stats: " + resp.text)
371+
366372
def test_60_stop(self):
367373
time.sleep(10)
368374
resp = self.create_request("PUT", "/infrastructures/" + self.inf_id + "/stop")

0 commit comments

Comments
 (0)