-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathtest_kernel_cmdline.py
More file actions
31 lines (24 loc) · 953 Bytes
/
test_kernel_cmdline.py
File metadata and controls
31 lines (24 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test kernel commandline behavior."""
from framework.microvm import Serial
def test_init_params(uvm_plain):
"""Correct propagation of boot args to the kernel's command line.
Test that init's parameters (the ones present after "--") do not get
altered or misplaced.
"""
vm = uvm_plain
vm.help.enable_console()
vm.spawn(serial_out_path=None)
vm.memory_monitor = None
# We will override the init with /bin/cat so that we try to read the
# distro info from the /etc/os-release file.
vm.basic_config(
vcpu_count=1,
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce init=/bin/cat -- /etc/os-release",
)
vm.start()
serial = Serial(vm)
serial.open()
# If the string does not show up, the test will fail.
serial.rx(token=vm.distro.os_release_token)