mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-05 04:15:20 +00:00
tests: Switch AArch64 serial test cases to ttyAMA0
This commit switches the serial test cases for AArch64 to ttyAMA0. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
3965a8505b
commit
9c3b489f0e
@ -111,7 +111,7 @@ mod tests {
|
|||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
const GREP_SERIAL_IRQ_CMD: &str = "cat /proc/interrupts | grep 'IO-APIC' | grep -c 'ttyS0'";
|
const GREP_SERIAL_IRQ_CMD: &str = "cat /proc/interrupts | grep 'IO-APIC' | grep -c 'ttyS0'";
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
const GREP_SERIAL_IRQ_CMD: &str = "cat /proc/interrupts | grep 'GICv3' | grep -c 'ttyS0'";
|
const GREP_SERIAL_IRQ_CMD: &str = "cat /proc/interrupts | grep 'GICv3' | grep -c 'uart-pl011'";
|
||||||
|
|
||||||
const PIPE_SIZE: i32 = 32 << 20;
|
const PIPE_SIZE: i32 = 32 << 20;
|
||||||
|
|
||||||
@ -3604,13 +3604,18 @@ mod tests {
|
|||||||
let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
let mut focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
||||||
let guest = Guest::new(&mut focal);
|
let guest = Guest::new(&mut focal);
|
||||||
let mut cmd = GuestCommand::new(&guest);
|
let mut cmd = GuestCommand::new(&guest);
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
let console_str: &str = "console=ttyS0";
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
let console_str: &str = "console=ttyAMA0";
|
||||||
|
|
||||||
cmd.args(&["--cpus", "boot=1"])
|
cmd.args(&["--cpus", "boot=1"])
|
||||||
.args(&["--memory", "size=512M"])
|
.args(&["--memory", "size=512M"])
|
||||||
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
.args(&["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
.args(&[
|
.args(&[
|
||||||
"--cmdline",
|
"--cmdline",
|
||||||
DIRECT_KERNEL_BOOT_CMDLINE
|
DIRECT_KERNEL_BOOT_CMDLINE
|
||||||
.replace("console=hvc0 ", "console=ttyS0")
|
.replace("console=hvc0 ", console_str)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
])
|
])
|
||||||
.default_disks()
|
.default_disks()
|
||||||
@ -3657,6 +3662,11 @@ mod tests {
|
|||||||
|
|
||||||
let kernel_path = direct_kernel_boot_path();
|
let kernel_path = direct_kernel_boot_path();
|
||||||
|
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
let console_str: &str = "console=ttyS0";
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
let console_str: &str = "console=ttyAMA0";
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(&["--cpus", "boot=1"])
|
.args(&["--cpus", "boot=1"])
|
||||||
.args(&["--memory", "size=512M"])
|
.args(&["--memory", "size=512M"])
|
||||||
@ -3664,7 +3674,7 @@ mod tests {
|
|||||||
.args(&[
|
.args(&[
|
||||||
"--cmdline",
|
"--cmdline",
|
||||||
DIRECT_KERNEL_BOOT_CMDLINE
|
DIRECT_KERNEL_BOOT_CMDLINE
|
||||||
.replace("console=hvc0 ", "console=ttyS0")
|
.replace("console=hvc0 ", console_str)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
])
|
])
|
||||||
.default_disks()
|
.default_disks()
|
||||||
@ -3710,6 +3720,11 @@ mod tests {
|
|||||||
let guest = Guest::new(&mut focal);
|
let guest = Guest::new(&mut focal);
|
||||||
|
|
||||||
let serial_path = guest.tmp_dir.as_path().join("/tmp/serial-output");
|
let serial_path = guest.tmp_dir.as_path().join("/tmp/serial-output");
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
let console_str: &str = "console=ttyS0";
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
let console_str: &str = "console=ttyAMA0";
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(&["--cpus", "boot=1"])
|
.args(&["--cpus", "boot=1"])
|
||||||
.args(&["--memory", "size=512M"])
|
.args(&["--memory", "size=512M"])
|
||||||
@ -3717,7 +3732,7 @@ mod tests {
|
|||||||
.args(&[
|
.args(&[
|
||||||
"--cmdline",
|
"--cmdline",
|
||||||
DIRECT_KERNEL_BOOT_CMDLINE
|
DIRECT_KERNEL_BOOT_CMDLINE
|
||||||
.replace("console=hvc0 ", "console=ttyS0")
|
.replace("console=hvc0 ", console_str)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
])
|
])
|
||||||
.default_disks()
|
.default_disks()
|
||||||
|
Loading…
Reference in New Issue
Block a user