mirror of
https://github.com/containers/youki
synced 2024-11-24 01:44:17 +01:00
Fix youki processes staying alive in create tests
This commit is contained in:
parent
a39b287f6e
commit
85f23015dd
@ -1,4 +1,4 @@
|
||||
use super::create;
|
||||
use super::{create, kill};
|
||||
use crate::support::generate_uuid;
|
||||
use std::path::{Path, PathBuf};
|
||||
use test_framework::{TestResult, TestableGroup};
|
||||
@ -28,12 +28,17 @@ impl ContainerCreate {
|
||||
}
|
||||
|
||||
fn create_valid_id(&self) -> TestResult {
|
||||
create::create(&self.project_path, &self.container_id)
|
||||
let temp = create::create(&self.project_path, &self.container_id);
|
||||
if let TestResult::Ok = temp {
|
||||
kill::kill(&self.project_path, &self.container_id);
|
||||
}
|
||||
temp
|
||||
}
|
||||
fn create_duplicate_id(&self) -> TestResult {
|
||||
let id = generate_uuid().to_string();
|
||||
let _ = create::create(&self.project_path, &id);
|
||||
let temp = create::create(&self.project_path, &id);
|
||||
kill::kill(&self.project_path, &id);
|
||||
match temp {
|
||||
TestResult::Ok => TestResult::Err(anyhow::anyhow!(
|
||||
"Container should not have been created with same id, but was created."
|
||||
|
Loading…
Reference in New Issue
Block a user