runtime-rs: add unit test and eliminate raw string

Add two unit tests for coverage and eliminate raw strings to constant.

Fixes: #5068
Signed-Off-By: Ji-Xinyou <jerryji0414@outlook.com>
This commit is contained in:
Ji-Xinyou
2022-09-16 14:40:50 +08:00
parent 87959cb72d
commit 426a436780
4 changed files with 88 additions and 8 deletions

View File

@@ -7,6 +7,7 @@
use anyhow::{anyhow, Result};
use crate::{VM_ROOTFS_DRIVER_BLK, VM_ROOTFS_DRIVER_PMEM};
use kata_types::config::LOG_VPORT_OPTION;
// Port where the agent will send the logs. Logs are sent through the vsock in cases
// where the hypervisor has no console.sock, i.e dragonball
@@ -60,7 +61,7 @@ impl KernelParams {
];
if debug {
params.push(Param::new("agent.log_vport", VSOCK_LOGS_PORT));
params.push(Param::new(LOG_VPORT_OPTION, VSOCK_LOGS_PORT));
}
Self { params }