Skip to content

Commit

Permalink
Replace 'echo "$foo"' with call to shell script.
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fontein <[email protected]>
  • Loading branch information
felixfontein committed Dec 29, 2023
1 parent 5e2ffcc commit ea3311b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions functional-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,17 @@ bar: |-
.success(),
"sops didn't exit successfully"
);
let print_foo = prepare_temp_file(
"print_foo.sh",
r#"#!/bin/sh
echo "${foo}"
"#
.as_bytes(),
);
let output = Command::new(SOPS_BINARY_PATH)
.arg("exec-env")
.arg(file_path.clone())
.arg("echo \"$foo\"")
.arg(format!("/bin/sh {}", print_foo))
.output()
.expect("Error running sops");
assert!(output.status.success(), "sops didn't exit successfully");
Expand All @@ -826,10 +833,17 @@ bar: |-
String::from_utf8_lossy(&output.stderr)
);
assert_eq!(String::from_utf8_lossy(&output.stdout), "bar\n");
let print_bar = prepare_temp_file(
"print_bar.sh",
r#"#!/bin/sh
echo "${bar}"
"#
.as_bytes(),
);
let output = Command::new(SOPS_BINARY_PATH)
.arg("exec-env")
.arg(file_path.clone())
.arg("echo \"$bar\"")
.arg(format!("/bin/sh {}", print_bar))
.output()
.expect("Error running sops");
assert!(output.status.success(), "sops didn't exit successfully");
Expand Down

0 comments on commit ea3311b

Please sign in to comment.