Skip to content

Commit

Permalink
test(metrics): Test aggregate and per block metrics
Browse files Browse the repository at this point in the history
Add test to validate aggregate block metrics.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
  • Loading branch information
Sudan Landge committed Oct 27, 2023
1 parent fe6c5df commit d82f384
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/integration_tests/functional/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,25 @@ def test_net_metrics(test_microvm_with_api):
# test that we get metrics while interacting with different interfaces
net_metrics.validate(test_microvm)
assert exit_code == 0

def test_block_metrics(test_microvm_with_api):
"""
Validate that NetDeviceMetrics doesn't have a breaking change
and "net" is aggregate of all "net_*" in the json object.
"""
test_microvm = test_microvm_with_api
test_microvm.spawn()

# Set up a basic microVM.
test_microvm.basic_config()

num_block_devices = 1
block_metrics = FcDeviceMetrics("block", num_block_devices)

test_microvm.start()

# check that the started microvm has "block" and "NUM_NET_DEVICES" number of "block_" metrics
block_metrics.validate(test_microvm)

for i in range(num_block_devices):
block_metrics.validate(test_microvm)

0 comments on commit d82f384

Please sign in to comment.