1
0
mirror of https://github.com/containers/youki synced 2024-11-23 01:11:58 +01:00

Add youki commands

This commit is contained in:
oliver 2021-06-28 04:25:08 +09:00
parent 27a0924fea
commit 8fb3e1899d
6 changed files with 78 additions and 0 deletions

@ -0,0 +1,16 @@
use std::path::PathBuf;
use std::process::{Command,Stdio};
pub fn exec(project_path: &PathBuf, id: &str) -> bool {
let status = Command::new(project_path.join(PathBuf::from("youki")))
.stdout(Stdio::null())
.arg("-r")
.arg(project_path.join("integration-workspace").join("youki"))
.arg("create")
.arg(id)
.arg("--bundle")
.arg(project_path.join("integration-workspace").join("bundle"))
.status()
.expect("failed to execute process");
return status.success();
}

@ -0,0 +1,14 @@
use std::path::PathBuf;
use std::process::{Command,Stdio};
pub fn exec(project_path: &PathBuf, id: &str) -> bool {
let status = Command::new(project_path.join(PathBuf::from("youki")))
.stdout(Stdio::null())
.arg("-r")
.arg(project_path.join("integration-workspace").join("youki"))
.arg("delete")
.arg(id)
.status()
.expect("failed to execute process");
return status.success();
}

15
tests/integration/kill.rs Normal file

@ -0,0 +1,15 @@
use std::path::PathBuf;
use std::process::{Command,Stdio};
pub fn exec(project_path: &PathBuf, id: &str) -> bool {
let status = Command::new(project_path.join(PathBuf::from("youki")))
.stdout(Stdio::null())
.arg("-r")
.arg(project_path.join("integration-workspace").join("youki"))
.arg("kill")
.arg(id)
.arg("9")
.status()
.expect("failed to execute process");
return status.success();
}

5
tests/integration/mod.rs Normal file

@ -0,0 +1,5 @@
pub mod create;
pub mod state;
pub mod delete;
pub mod start;
pub mod support;

@ -0,0 +1,14 @@
use std::path::PathBuf;
use std::process::{Command,Stdio};
pub fn exec(project_path: &PathBuf, id: &str) -> bool {
let status = Command::new(project_path.join(PathBuf::from("youki")))
.stdout(Stdio::null())
.arg("-r")
.arg(project_path.join("integration-workspace").join("youki"))
.arg("start")
.arg(id)
.status()
.expect("failed to execute process");
return status.success();
}

@ -0,0 +1,14 @@
use std::path::PathBuf;
use std::process::{Command,Stdio};
pub fn exec(project_path: &PathBuf, id: &str) -> bool {
let status = Command::new(project_path.join(PathBuf::from("youki")))
.stdout(Stdio::null())
.arg("-r")
.arg(project_path.join("integration-workspace").join("youki"))
.arg("state")
.arg(id)
.status()
.expect("failed to execute process");
return status.success();
}