mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 05:04:26 +00:00
agent: clear cargo test warnings
Function parameters in test config is not used. This commit will add under score before variable name in test config. Fixes: #3091 Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
parent
cad279b37d
commit
ce0693d6dc
@ -112,6 +112,7 @@ lazy_static! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
#[cfg(not(test))]
|
||||||
pub fn mount<
|
pub fn mount<
|
||||||
P1: ?Sized + NixPath,
|
P1: ?Sized + NixPath,
|
||||||
P2: ?Sized + NixPath,
|
P2: ?Sized + NixPath,
|
||||||
@ -124,21 +125,42 @@ pub fn mount<
|
|||||||
flags: MsFlags,
|
flags: MsFlags,
|
||||||
data: Option<&P4>,
|
data: Option<&P4>,
|
||||||
) -> std::result::Result<(), nix::Error> {
|
) -> std::result::Result<(), nix::Error> {
|
||||||
#[cfg(not(test))]
|
mount::mount(source, target, fstype, flags, data)
|
||||||
return mount::mount(source, target, fstype, flags, data);
|
|
||||||
#[cfg(test)]
|
|
||||||
return Ok(());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
#[cfg(test)]
|
||||||
|
pub fn mount<
|
||||||
|
P1: ?Sized + NixPath,
|
||||||
|
P2: ?Sized + NixPath,
|
||||||
|
P3: ?Sized + NixPath,
|
||||||
|
P4: ?Sized + NixPath,
|
||||||
|
>(
|
||||||
|
_source: Option<&P1>,
|
||||||
|
_target: &P2,
|
||||||
|
_fstype: Option<&P3>,
|
||||||
|
_flags: MsFlags,
|
||||||
|
_data: Option<&P4>,
|
||||||
|
) -> std::result::Result<(), nix::Error> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
#[cfg(not(test))]
|
||||||
pub fn umount2<P: ?Sized + NixPath>(
|
pub fn umount2<P: ?Sized + NixPath>(
|
||||||
target: &P,
|
target: &P,
|
||||||
flags: MntFlags,
|
flags: MntFlags,
|
||||||
) -> std::result::Result<(), nix::Error> {
|
) -> std::result::Result<(), nix::Error> {
|
||||||
#[cfg(not(test))]
|
mount::umount2(target, flags)
|
||||||
return mount::umount2(target, flags);
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
return Ok(());
|
pub fn umount2<P: ?Sized + NixPath>(
|
||||||
|
_target: &P,
|
||||||
|
_flags: MntFlags,
|
||||||
|
) -> std::result::Result<(), nix::Error> {
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init_rootfs(
|
pub fn init_rootfs(
|
||||||
@ -450,14 +472,20 @@ fn mount_cgroups(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(test))]
|
||||||
fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
|
fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
|
||||||
new_root: &P1,
|
new_root: &P1,
|
||||||
put_old: &P2,
|
put_old: &P2,
|
||||||
) -> anyhow::Result<(), nix::Error> {
|
) -> anyhow::Result<(), nix::Error> {
|
||||||
#[cfg(not(test))]
|
unistd::pivot_root(new_root, put_old)
|
||||||
return unistd::pivot_root(new_root, put_old);
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
return Ok(());
|
fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
|
||||||
|
_new_root: &P1,
|
||||||
|
_put_old: &P2,
|
||||||
|
) -> anyhow::Result<(), nix::Error> {
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pivot_rootfs<P: ?Sized + NixPath + std::fmt::Debug>(path: &P) -> Result<()> {
|
pub fn pivot_rootfs<P: ?Sized + NixPath + std::fmt::Debug>(path: &P) -> Result<()> {
|
||||||
@ -582,11 +610,15 @@ fn parse_mount_table() -> Result<Vec<Info>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn chroot<P: ?Sized + NixPath>(path: &P) -> Result<(), nix::Error> {
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
return unistd::chroot(path);
|
fn chroot<P: ?Sized + NixPath>(path: &P) -> Result<(), nix::Error> {
|
||||||
|
unistd::chroot(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
return Ok(());
|
fn chroot<P: ?Sized + NixPath>(_path: &P) -> Result<(), nix::Error> {
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ms_move_root(rootfs: &str) -> Result<bool> {
|
pub fn ms_move_root(rootfs: &str) -> Result<bool> {
|
||||||
|
Loading…
Reference in New Issue
Block a user