Path: blob/main/tests/integration_tests/functional/test_initrd.py
1958 views
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.1# SPDX-License-Identifier: Apache-2.02"""Tests for initrd."""34from framework.microvm import Serial56INITRD_FILESYSTEM = "rootfs"789def test_microvm_initrd_with_serial(10test_microvm_with_initrd):11"""Check microvm started with an inird has / mounted as rootfs."""12vm = test_microvm_with_initrd13vm.jailer.daemonize = False14vm.spawn()15vm.memory_monitor = None1617vm.basic_config(18add_root_device=False,19vcpu_count=1,20boot_args='console=ttyS0 reboot=k panic=1 pci=off',21use_initrd=True22)2324vm.start()25serial = Serial(vm)26serial.open()27serial.rx(token='login: ')28serial.tx("root")2930serial.rx(token='Password: ')31serial.tx("root")3233serial.rx(token='# ')3435serial.tx("findmnt /")36serial.rx(37token=f"/ {INITRD_FILESYSTEM} {INITRD_FILESYSTEM}")383940