-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests for booting VMs with initrd and no rootfs. - Functional: the VM shall boot and / should be mounted as "rootfs" - Performance: VM shall boot in less than 400ms Co-developed-by: Tim Deegan <tdeegan@amazon.com> Signed-off-by: Tim Deegan <tdeegan@amazon.com> Co-developed-by: Marco Vedovati <mvedovati@suse.com> Signed-off-by: Marco Vedovati <mvedovati@suse.com>
- Loading branch information
Showing
6 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2019 SUSE LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
"""Tests for initd.""" | ||
|
||
from host_tools.network import SSHConnection | ||
|
||
INITRD_FILESYSTEM = "rootfs" | ||
|
||
|
||
def test_microvm_initrd( | ||
test_microvm_with_ssh, | ||
network_config): | ||
""" Check microvm started with an inird has / mounted as rootfs.""" | ||
|
||
vm = test_microvm_with_ssh | ||
|
||
vm.spawn() | ||
|
||
vm.basic_config( | ||
add_root_device=False, | ||
use_initrd=True | ||
) | ||
_tap, _, _ = vm.ssh_network_config(network_config, '1') | ||
|
||
vm.start() | ||
|
||
# Find out what is the filesystem of /, and make sure initrd is used | ||
conn = SSHConnection(vm.ssh_config) | ||
ecode, stdout, _ = conn.execute_command( | ||
f"findmnt / | grep -q -w {INITRD_FILESYSTEM}") | ||
assert ecode == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters