Skip to content

Commit 7649350

Browse files
pb8ozulinx86
authored andcommitted
test: store the MSR dump as an artifact
That way to take new baselines we can just take them from a failed run rather than having to manually launch instances to run a single command. Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
1 parent e050c60 commit 7649350

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.buildkite/pipeline_cpu_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def group_single(tests):
7878
command=tests[BkStep.COMMAND],
7979
instances=tests["instances"],
8080
platforms=tests["platforms"],
81+
artifacts=["./test_results/**/*"],
8182
)
8283
return [group_step]
8384

tests/integration_tests/functional/test_cpu_features.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,11 @@ def msr_cpu_template_fxt(request):
255255
return request.param
256256

257257

258-
@pytest.mark.skipif(
259-
UNSUPPORTED_HOST_KERNEL,
260-
reason=f"Supported kernels are {SUPPORTED_HOST_KERNELS}",
261-
)
262258
@pytest.mark.timeout(900)
263259
@pytest.mark.nonci
264-
def test_cpu_rdmsr(microvm_factory, msr_cpu_template, guest_kernel, rootfs_ubuntu_22):
260+
def test_cpu_rdmsr(
261+
microvm_factory, msr_cpu_template, guest_kernel, rootfs_ubuntu_22, results_dir
262+
):
265263
"""
266264
Test MSRs that are available to the guest.
267265
@@ -312,10 +310,16 @@ def test_cpu_rdmsr(microvm_factory, msr_cpu_template, guest_kernel, rootfs_ubunt
312310
# Load baseline
313311
host_cpu = global_props.cpu_codename
314312
host_kv = global_props.host_linux_version
315-
guest_kv = re.search(r"vmlinux-(\d+\.\d+)", guest_kernel).group(1)
313+
guest_kv = re.search(r"vmlinux-(\d+\.\d+)", guest_kernel.name).group(1)
316314
baseline_file_name = (
317315
f"msr_list_{msr_cpu_template}_{host_cpu}_{host_kv}host_{guest_kv}guest.csv"
318316
)
317+
# save it as an artifact, so we don't have to manually launch an instance to
318+
# get a baseline
319+
save_msrs = results_dir / baseline_file_name
320+
save_msrs.write_text(stdout)
321+
322+
# Load baseline
319323
baseline_file_path = DATA_FILES / baseline_file_name
320324
# We can use the following line when regathering baselines.
321325
# microvm_df.to_csv(baseline_file_path, index=False, encoding="utf-8")

0 commit comments

Comments
 (0)