Skip to content

Commit 6b3eb4d

Browse files
committed
tests: use posix shell over bash for improved cross platform compatibility
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
1 parent 5457bb5 commit 6b3eb4d

File tree

1 file changed

+10
-10
lines changed
  • crates/extensions/c8y_mapper_ext/src

1 file changed

+10
-10
lines changed

crates/extensions/c8y_mapper_ext/src/tests.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,8 @@ async fn custom_operation_without_timeout_successful() {
17461746
//create custom operation file
17471747
create_custom_op_file(&cfg_dir, cmd_file.as_path(), None, None);
17481748
//create command
1749-
let content = r#"#!/usr/bin/env bash
1750-
for i in {1..2}
1749+
let content = r#"#!/bin/sh
1750+
for i in $(seq 1 2)
17511751
do
17521752
sleep 1
17531753
done
@@ -1808,8 +1808,8 @@ async fn custom_operation_with_timeout_successful() {
18081808
//create custom operation file
18091809
create_custom_op_file(&cfg_dir, cmd_file.as_path(), Some(4), Some(2));
18101810
//create command
1811-
let content = r#"#!/usr/bin/env bash
1812-
for i in {1..2}
1811+
let content = r#"#!/bin/sh
1812+
for i in $(seq 1 2)
18131813
do
18141814
sleep 1
18151815
done
@@ -1868,9 +1868,9 @@ async fn custom_operation_timeout_sigterm() {
18681868
//create custom operation file
18691869
create_custom_op_file(&cfg_dir, cmd_file.as_path(), Some(1), Some(2));
18701870
//create command
1871-
let content = r#"#!/usr/bin/env bash
1872-
trap 'echo received SIGTERM; exit 124' SIGTERM
1873-
for i in {1..10}
1871+
let content = r#"#!/bin/sh
1872+
trap 'echo received SIGTERM; exit 124' TERM
1873+
for i in $(seq 1 10)
18741874
do
18751875
echo "main $i"
18761876
sleep 2
@@ -1933,9 +1933,9 @@ async fn custom_operation_timeout_sigkill() {
19331933
//create custom operation file
19341934
create_custom_op_file(&cfg_dir, cmd_file.as_path(), Some(1), Some(2));
19351935
//create command
1936-
let content = r#"#!/usr/bin/env bash
1937-
trap 'echo ignore SIGTERM' SIGTERM
1938-
for i in {1..50}
1936+
let content = r#"#!/bin/sh
1937+
trap 'echo ignore SIGTERM' TERM
1938+
for i in $(seq 1 50)
19391939
do
19401940
echo "main $i"
19411941
sleep 2

0 commit comments

Comments
 (0)