Skip to content

Commit 5b54630

Browse files
committed
refactor(test): Use utility function to set CPU template
There is a utility function that accepts both static and custom CPU templates. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent b8148e7 commit 5b54630

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/integration_tests/functional/test_snapshot_phase1.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,11 @@ def test_snapshot_phase1(
3636
vm.spawn(log_level="Info")
3737
vm.add_net_iface()
3838

39-
static_cpu_template = None
40-
if isinstance(cpu_template_any, str):
41-
static_cpu_template = cpu_template_any
42-
elif isinstance(cpu_template_any, dict):
43-
vm.api.cpu_config.put(**cpu_template_any["template"])
4439
vm.basic_config(
4540
vcpu_count=2,
4641
mem_size_mib=512,
47-
cpu_template=static_cpu_template,
4842
)
43+
vm.set_cpu_template(cpu_template_any)
4944

5045
guest_kernel_version = re.search("vmlinux-(.*)", vm.kernel_file.name)
5146
cpu_template_name = get_cpu_template_name(cpu_template_any, with_type=True)

0 commit comments

Comments
 (0)