MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / test_parse_vhost_user

Function test_parse_vhost_user

vmm/src/config.rs:4324–4367  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4322
4323 #[test]
4324 fn test_parse_vhost_user() -> Result<()> {
4325 // all parameters must be supplied, except pci_segment
4326 GenericVhostUserConfig::parse("").unwrap_err();
4327 GenericVhostUserConfig::parse("virtio_id=1").unwrap_err();
4328 GenericVhostUserConfig::parse("queue_size=1").unwrap_err();
4329 GenericVhostUserConfig::parse("socket=/tmp/sock").unwrap_err();
4330 GenericVhostUserConfig::parse("id=1").unwrap_err();
4331 make_vhost_user_config(
4332 "/dev/null/doesnotexist",
4333 100,
4334 "Something",
4335 10,
4336 &IntegerList(vec![u16::MAX.into(), 20u16.into()]),
4337 );
4338 make_vhost_user_config(
4339 "/dev/null/doesnotexist",
4340 100,
4341 "Something",
4342 10,
4343 &IntegerList(vec![u16::MAX.into()]),
4344 );
4345 make_vhost_user_config(
4346 "/dev/null/doesnotexist",
4347 u64::from(u32::MAX) + 1,
4348 "Something",
4349 10,
4350 &IntegerList(vec![20u64]),
4351 );
4352 make_vhost_user_config(
4353 "/dev/null/doesnotexist",
4354 u64::from(u32::MAX) + 1,
4355 "Something",
4356 10,
4357 &IntegerList(vec![20u64]),
4358 );
4359 make_vhost_user_config(
4360 "/dev/null/doesnotexist",
4361 u64::from(u32::MAX) + 1,
4362 "Something",
4363 10,
4364 &IntegerList(vec![20u64]),
4365 );
4366 Ok(())
4367 }
4368
4369 fn pmem_fixture() -> PmemConfig {
4370 PmemConfig {

Callers

nothing calls this directly

Calls 2

make_vhost_user_configFunction · 0.85
IntegerListClass · 0.85

Tested by

no test coverage detected