that should do the job
This commit is contained in:
parent
eea2f76b9f
commit
b4a84dbf20
@ -23,9 +23,9 @@ use ops_sat_rs::config::{
|
||||
use crate::requests::CompositeRequest;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ShellCmd {
|
||||
cmd: String,
|
||||
args: Vec<String>,
|
||||
pub struct ShellCmd<'a> {
|
||||
cmd: &'a str,
|
||||
args: Vec<&'a str>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, TryFromPrimitive)]
|
||||
@ -231,10 +231,12 @@ mod tests {
|
||||
let mut exp_ctrl =
|
||||
ExperimentController::new(composite_req_rx, action_reply_tx, stop_signal);
|
||||
let named_temp_file = NamedTempFile::new().expect("creating temp file failed");
|
||||
let cmd = ShellCmd {
|
||||
cmd: "rm".to_string(),
|
||||
args: vec![named_temp_file.path().to_string_lossy().to_string()],
|
||||
};
|
||||
let args = vec![named_temp_file
|
||||
.path()
|
||||
.to_str()
|
||||
.expect("converting path to str failed")];
|
||||
|
||||
let cmd = ShellCmd { cmd: "rm", args };
|
||||
let cmd_serialized = serde_json::to_string(&cmd).expect("serialization failed");
|
||||
let action_req = satrs::action::ActionRequest {
|
||||
action_id: ActionId::ExecuteShellCommandBlocking as u32,
|
||||
|
Loading…
x
Reference in New Issue
Block a user