2
2
# SPDX-License-Identifier: Apache-2.0
3
3
"""Tests that ensure the boot time to init process is within spec."""
4
4
5
- import platform
6
5
import re
7
6
import time
8
7
9
8
from framework .properties import global_props
10
- from framework .utils_cpuid import get_cpu_model_name , get_instance_type
11
9
12
10
# The maximum acceptable boot time in us.
13
11
MAX_BOOT_TIME_US = 150000
14
- # NOTE: For aarch64 most of the boot time is spent by the kernel to unpack the
15
- # initramfs in RAM. This time is influenced by the size and the compression
16
- # method of the used initrd image. The boot time for Skylake is greater than
17
- # other x86-64 CPUs, since L1TF mitigation (unconditional L1D cache flush) is
18
- # enabled.
19
- INITRD_BOOT_TIME_US = {
20
- "x86_64" : {
21
- "m5d.metal" : {
22
- "Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz" : 230000 ,
23
- "Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz" : 180000 ,
24
- },
25
- "m6i.metal" : {
26
- "Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz" : 180000 ,
27
- },
28
- "m6a.metal" : {
29
- "AMD EPYC 7R13 48-Core Processor" : 180000 ,
30
- },
31
- },
32
- "aarch64" : {
33
- "m6g.metal" : {
34
- "ARM_NEOVERSE_N1" : 205000 ,
35
- },
36
- "c7g.metal" : {
37
- "ARM_NEOVERSE_V1" : 205000 ,
38
- },
39
- },
40
- }
12
+
41
13
# Regex for obtaining boot time from some string.
42
14
TIMESTAMP_LOG_REGEX = r"Guest-boot-time\s+\=\s+(\d+)\s+us"
43
15
44
-
45
16
DIMENSIONS = {
46
17
"instance" : global_props .instance ,
47
18
"cpu_model" : global_props .cpu_model ,
@@ -100,12 +71,9 @@ def test_initrd_boottime(test_microvm_with_initrd, record_property, metrics):
100
71
vm = test_microvm_with_initrd
101
72
vm .jailer .extra_args .update ({"boot-timer" : None })
102
73
_tap = _configure_and_run_vm (vm , initrd = True )
103
- max_time_us = INITRD_BOOT_TIME_US [platform .machine ()][get_instance_type ()][
104
- get_cpu_model_name ()
105
- ]
106
- boottime_us = _test_microvm_boottime (vm , max_time_us = max_time_us )
74
+ boottime_us = _test_microvm_boottime (vm , max_time_us = None )
107
75
print (f"Boot time with initrd is: { boottime_us } us" )
108
- record_property ("boottime_initrd" , f"{ boottime_us } us < { max_time_us } us " )
76
+ record_property ("boottime_initrd" , f"{ boottime_us } us" )
109
77
metrics .set_dimensions (DIMENSIONS )
110
78
metrics .put_metric ("boot_time_with_initrd" , boottime_us , unit = "Microseconds" )
111
79
@@ -123,8 +91,7 @@ def _test_microvm_boottime(vm, max_time_us=MAX_BOOT_TIME_US):
123
91
boot_time_us = int (timestamps [0 ])
124
92
125
93
assert boot_time_us > 0
126
- # temporarily disable this test in 6.1
127
- if global_props .host_linux_version != "6.1" :
94
+ if max_time_us is not None :
128
95
assert (
129
96
boot_time_us < max_time_us
130
97
), f"boot time { boot_time_us } cannot be greater than: { max_time_us } us"
0 commit comments