Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/tests/integration_tests/functional/test_initrd.py
1958 views
1
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
"""Tests for initrd."""
4
5
from framework.microvm import Serial
6
7
INITRD_FILESYSTEM = "rootfs"
8
9
10
def test_microvm_initrd_with_serial(
11
test_microvm_with_initrd):
12
"""Check microvm started with an inird has / mounted as rootfs."""
13
vm = test_microvm_with_initrd
14
vm.jailer.daemonize = False
15
vm.spawn()
16
vm.memory_monitor = None
17
18
vm.basic_config(
19
add_root_device=False,
20
vcpu_count=1,
21
boot_args='console=ttyS0 reboot=k panic=1 pci=off',
22
use_initrd=True
23
)
24
25
vm.start()
26
serial = Serial(vm)
27
serial.open()
28
serial.rx(token='login: ')
29
serial.tx("root")
30
31
serial.rx(token='Password: ')
32
serial.tx("root")
33
34
serial.rx(token='# ')
35
36
serial.tx("findmnt /")
37
serial.rx(
38
token=f"/ {INITRD_FILESYSTEM} {INITRD_FILESYSTEM}")
39
40