[PATCH for-4.21 v2 2/3] cirrus-ci: fix bashism in the test_script code

Roger Pau Monne posted 3 patches 3 weeks, 2 days ago
[PATCH for-4.21 v2 2/3] cirrus-ci: fix bashism in the test_script code
Posted by Roger Pau Monne 3 weeks, 2 days ago
The default shell in FreeBSD is plain sh, which doesn't support the usage
of the '|&' operator:

./automation/scripts/console.exp |& sed 's/\r\+$//'
/tmp/scripts34c427adc6599db29cb91221a0939d85.sh: 16: Syntax error: "&" unexpected

Fix this by using a redirection of stderr into stdout, and then a pipe.

Fixes: a406195c15dd ("automation: call expect script with redirected standard error")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 10d8371ccc38..30108892b751 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -167,7 +167,7 @@ task:
     export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
     export PASSED="Test result: SUCCESS"
     export TEST_TIMEOUT=120
-    ./automation/scripts/console.exp |& sed 's/\r\+$//'
+    ./automation/scripts/console.exp 2>&1 | sed 's/\r\+$//'
 
   always:
     serial_artifacts:
-- 
2.51.0