mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2026-01-05 00:39:40 +00:00
vhost-device-sound: test --socket and --socket-fd
Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
parent
3dca78e684
commit
0cd9b6bb4c
@ -33,10 +33,29 @@ fn main() {
|
||||
mod tests {
|
||||
use clap::Parser;
|
||||
use rstest::*;
|
||||
use std::path::PathBuf;
|
||||
use vhost_device_sound::BackendType;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_cli_socket_arg() {
|
||||
let args: SoundArgs = Parser::parse_from([
|
||||
"",
|
||||
"--socket",
|
||||
"/tmp/vhost-sound.socket",
|
||||
"--backend",
|
||||
"null",
|
||||
]);
|
||||
assert_eq!(args.socket, Some(PathBuf::from("/tmp/vhost-sound.socket")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cli_socket_fd_arg() {
|
||||
let args: SoundArgs = Parser::parse_from(["", "--socket-fd", "3", "--backend", "null"]);
|
||||
assert_eq!(args.socket_fd, Some(3));
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case::null_backend("null", BackendType::Null)]
|
||||
#[cfg_attr(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user