def test_network_latency(network_config, bin_cloner_path): """Test network latency driver for multiple artifacts.""" logger = logging.getLogger("network_latency") microvm_artifacts = ArtifactSet( ARTIFACTS_COLLECTION.microvms(keyword="2vcpu_1024mb")) kernel_artifacts = ArtifactSet(ARTIFACTS_COLLECTION.kernels()) disk_artifacts = ArtifactSet(ARTIFACTS_COLLECTION.disks(keyword="ubuntu")) # Create a test context and add builder, logger, network. test_context = TestContext() test_context.custom = { 'builder': MicrovmBuilder(bin_cloner_path), 'network_config': network_config, 'logger': logger, 'requests': 10, 'interval': 0.2, # Seconds. 'name': 'network_latency' } # Create the test matrix. test_matrix = TestMatrix( context=test_context, artifact_sets=[microvm_artifacts, kernel_artifacts, disk_artifacts]) test_matrix.run_test(_g2h_send_ping)
def test_network_latency(bin_cloner_path, results_file_dumper): """ Test network latency for multiple vm configurations. @type: performance """ logger = logging.getLogger("network_latency") microvm_artifacts = ArtifactSet( ARTIFACTS_COLLECTION.microvms(keyword="1vcpu_1024mb") ) kernel_artifacts = ArtifactSet(ARTIFACTS_COLLECTION.kernels()) disk_artifacts = ArtifactSet(ARTIFACTS_COLLECTION.disks(keyword="ubuntu")) # Create a test context and add builder, logger, network. test_context = TestContext() test_context.custom = { "builder": MicrovmBuilder(bin_cloner_path), "logger": logger, "requests": 1000, "interval": 0.2, # Seconds. "name": "network_latency", "results_file_dumper": results_file_dumper, } # Create the test matrix. test_matrix = TestMatrix( context=test_context, artifact_sets=[microvm_artifacts, kernel_artifacts, disk_artifacts], ) test_matrix.run_test(_g2h_send_ping)