1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-05-10 09:36:13 +02:00

use existing create_temp_dir

This commit is contained in:
yukang 2021-10-02 19:54:44 +08:00
parent 26e345d190
commit c4a61d72c6
3 changed files with 2 additions and 3 deletions

1
Cargo.lock generated
View File

@ -1546,5 +1546,4 @@ dependencies = [
"serial_test",
"systemd",
"tabwriter",
"tempfile",
]

View File

@ -61,7 +61,6 @@ oci-spec = { git = "https://github.com/containers/oci-spec-rs", rev = "5018f8e5
quickcheck = "1"
serial_test = "0.5.1"
ipc-channel = "0.15.0"
tempfile = "3"
[profile.release]
lto = true

View File

@ -112,12 +112,13 @@ impl SpecJson {
// Tests become unstable if not serial. The cause is not known.
mod tests {
use super::*;
use crate::utils::create_temp_dir;
#[test]
fn test_spec_json() -> Result<()> {
let mut spec = Default::default();
spec = set_for_rootless(&spec)?;
let tmpdir = tempfile::tempdir().unwrap();
let tmpdir = create_temp_dir("test_spec_json").expect("failed to create temp dir");
let path = tmpdir.path().join("config.json");
to_writer_pretty(&File::create(path)?, &spec)?;
Ok(())