Blame SOURCES/0009-fix-test-regression-gh599-use-expr-to-be-more-portab.patch

8072fb
From ac3d706eb4bfead921c7e739e5e95a186bf35438 Mon Sep 17 00:00:00 2001
8072fb
From: Eric Garver <eric@garver.life>
8072fb
Date: Wed, 8 Apr 2020 17:05:39 -0400
8072fb
Subject: [PATCH 09/10] fix: test/regression/gh599: use expr to be more
8072fb
 portable
8072fb
8072fb
dash was failing due to not having "let". So lets use "expr" instead.
8072fb
8072fb
Fixes: e887c16512ab ("test: log: verify logging still works after truncate")
8072fb
(cherry picked from commit eba44b2ebeedccbac0329a56c86c5d8f26c30f9f)
8072fb
(cherry picked from commit cdd7c9d60624a443a0a07c29081d0ef68a384beb)
8072fb
---
8072fb
 src/tests/regression/gh599.at | 3 ++-
8072fb
 1 file changed, 2 insertions(+), 1 deletion(-)
8072fb
8072fb
diff --git a/src/tests/regression/gh599.at b/src/tests/regression/gh599.at
8072fb
index 337e18018baf..b0a230733c85 100644
8072fb
--- a/src/tests/regression/gh599.at
8072fb
+++ b/src/tests/regression/gh599.at
8072fb
@@ -3,6 +3,7 @@ AT_KEYWORDS(gh599)
8072fb
 
8072fb
 AT_SKIP_IF([! NS_CMD([which truncate >/dev/null 2>&1])])
8072fb
 AT_SKIP_IF([! NS_CMD([which wc >/dev/null 2>&1])])
8072fb
+AT_SKIP_IF([! NS_CMD([which expr >/dev/null 2>&1])])
8072fb
 
8072fb
 dnl Verify we continue to write to the log file after it's truncated. That is,
8072fb
 dnl simulate logrotate's copytruncate.
8072fb
@@ -11,6 +12,6 @@ NS_CHECK([truncate -s 0 ./firewalld.log])
8072fb
 dnl generate some logs
8072fb
 FWD_CHECK([-q --add-service=this_does_not_exist], 101, [ignore], [ignore])
8072fb
 
8072fb
-NS_CHECK([sh -c 'let "$(cat ./firewalld.log | wc -c) > 0"'])
8072fb
+NS_CHECK([expr $(cat ./firewalld.log | wc -c) ">" 0], 0, [ignore], [ignore])
8072fb
 
8072fb
 FWD_END_TEST([-e '/ERROR: INVALID_SERVICE: this_does_not_exist/d'])
8072fb
-- 
8072fb
2.25.2
8072fb