Skip to content

Commit 7d55cbd

Browse files
committed
test: hack: tmp: disable serial for A/B tests
When A/B-testing, the "A" revision firecracker binary does not know about the new --serial-out-path CLI argument. Thus, disable the serial console for all A/B-tests. It gets quite ugly to do for the vulnerability tests, because the .spawn() call is burried deep in the fixtures. This commit should be reverted after merging the PR Signed-off-by: Patrick Roy <[email protected]>
1 parent a264f75 commit 7d55cbd

File tree

9 files changed

+17
-10
lines changed

9 files changed

+17
-10
lines changed

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,10 @@ def uvm_booted(
605605
):
606606
"""Return a booted uvm"""
607607
uvm = microvm_factory.build(guest_kernel, rootfs, pci=pci_enabled)
608-
uvm.spawn()
608+
if getattr(microvm_factory, "hack_no_serial", False):
609+
uvm.spawn(serial_log_file=None)
610+
else:
611+
uvm.spawn()
609612
uvm.basic_config(vcpu_count=vcpu_count, mem_size_mib=mem_size_mib)
610613
uvm.set_cpu_template(cpu_template)
611614
uvm.add_net_iface()

tests/framework/microvm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,10 @@ def build(self, kernel=None, rootfs=None, **kwargs):
12271227
def build_from_snapshot(self, snapshot: Snapshot):
12281228
"""Build a microvm from a snapshot"""
12291229
vm = self.build()
1230-
vm.spawn()
1230+
if getattr(self, "hack_no_serial", False):
1231+
vm.spawn(serial_log_file=None)
1232+
else:
1233+
vm.spawn()
12311234
vm.restore_from_snapshot(snapshot, resume=True)
12321235
return vm
12331236

tests/integration_tests/performance/test_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_block_performance(
174174
Execute block device emulation benchmarking scenarios.
175175
"""
176176
vm = uvm_plain_acpi
177-
vm.spawn(log_level="Info", emit_metrics=True)
177+
vm.spawn(log_level="Info", emit_metrics=True, serial_log_file=None)
178178
vm.basic_config(vcpu_count=vcpus, mem_size_mib=GUEST_MEM_MIB)
179179
vm.add_net_iface()
180180
# Add a secondary block device for benchmark tests.
@@ -223,7 +223,7 @@ def test_block_vhost_user_performance(
223223
"""
224224

225225
vm = uvm_plain_acpi
226-
vm.spawn(log_level="Info", emit_metrics=True)
226+
vm.spawn(log_level="Info", emit_metrics=True, serial_log_file=None)
227227
vm.basic_config(vcpu_count=vcpus, mem_size_mib=GUEST_MEM_MIB)
228228
vm.add_net_iface()
229229

tests/integration_tests/performance/test_boottime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def launch_vm_with_boot_timer(
100100
"""Launches a microVM with guest-timer and returns the reported metrics for it"""
101101
vm = microvm_factory.build(guest_kernel_acpi, rootfs_rw, pci=pci_enabled)
102102
vm.jailer.extra_args.update({"boot-timer": None})
103-
vm.spawn()
103+
vm.spawn(serial_log_file=None)
104104
vm.basic_config(
105105
vcpu_count=vcpu_count,
106106
mem_size_mib=mem_size_mib,

tests/integration_tests/performance/test_memory_overhead.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_memory_overhead(
4747
microvm = microvm_factory.build(
4848
guest_kernel_acpi, rootfs, pci=pci_enabled, monitor_memory=False
4949
)
50-
microvm.spawn(emit_metrics=True)
50+
microvm.spawn(emit_metrics=True, serial_log_file=None)
5151
microvm.basic_config(vcpu_count=vcpu_count, mem_size_mib=mem_size_mib)
5252
microvm.add_net_iface()
5353
microvm.start()

tests/integration_tests/performance/test_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def network_microvm(request, uvm_plain_acpi):
4646
guest_vcpus = request.param
4747

4848
vm = uvm_plain_acpi
49-
vm.spawn(log_level="Info", emit_metrics=True)
49+
vm.spawn(log_level="Info", emit_metrics=True, serial_log_file=None)
5050
vm.basic_config(vcpu_count=guest_vcpus, mem_size_mib=guest_mem_mib)
5151
vm.add_net_iface()
5252
vm.start()

tests/integration_tests/performance/test_snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def boot_vm(self, microvm_factory, guest_kernel, rootfs, pci_enabled) -> Microvm
5252
monitor_memory=False,
5353
pci=pci_enabled,
5454
)
55-
vm.spawn(log_level="Info", emit_metrics=True)
55+
vm.spawn(log_level="Info", emit_metrics=True, serial_log_file=None)
5656
vm.time_api_requests = False
5757
vm.basic_config(
5858
vcpu_count=self.vcpus,
@@ -271,7 +271,7 @@ def test_snapshot_create_latency(
271271
"""Measure the latency of creating a Full snapshot"""
272272

273273
vm = uvm_plain
274-
vm.spawn()
274+
vm.spawn(serial_log_file=None)
275275
vm.basic_config(
276276
vcpu_count=2,
277277
mem_size_mib=512,

tests/integration_tests/performance/test_vsock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_vsock_throughput(
9393

9494
mem_size_mib = 1024
9595
vm = uvm_plain_acpi
96-
vm.spawn(log_level="Info", emit_metrics=True)
96+
vm.spawn(log_level="Info", emit_metrics=True, serial_log_file=None)
9797
vm.basic_config(vcpu_count=vcpus, mem_size_mib=mem_size_mib)
9898
vm.add_net_iface()
9999
# Create a vsock device

tests/integration_tests/security/test_vulnerabilities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def microvm_factory_a(record_property):
211211
bin_dir = git_clone(Path("../build") / revision_a, revision_a).resolve()
212212
record_property("firecracker_bin", str(bin_dir / "firecracker"))
213213
uvm_factory = MicroVMFactory(bin_dir)
214+
uvm_factory.hack_no_serial = True
214215
yield uvm_factory
215216
uvm_factory.kill()
216217

0 commit comments

Comments
 (0)