Skip to content

Commit

Permalink
Merge pull request #3041 from rina23q/test/3007/fix-unit-test
Browse files Browse the repository at this point in the history
test: fix unit test to pass when the unit socket file exists
  • Loading branch information
reubenmiller authored Aug 1, 2024
2 parents c84f572 + b79f03a commit 635d25c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/c8y_remote_access_plugin/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,16 @@ mod tests {
}

#[test]
fn parses_spawn_child_if_no_flag_is_provided() {
fn parses_spawn_child_or_connect_unix_socket_if_no_flag_is_provided() {
let input = "530,jrh-rc-test0,127.0.0.1,22,cd8fc847-f4f2-4712-8dd7-31496aef0a7d";

let command = try_parse_arguments(&[input]).unwrap();

assert_eq!(command, Command::SpawnChild(input.to_owned()))
if Path::new(UNIX_SOCKFILE).exists() {
assert_eq!(command, Command::TryConnectUnixSocket(input.to_owned()))
} else {
assert_eq!(command, Command::SpawnChild(input.to_owned()))
}
}

#[test]
Expand Down

0 comments on commit 635d25c

Please sign in to comment.