From c0885f7dbbbf8fb9d9f813617e13c7ba59a6acef Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Tue, 23 Oct 2012 09:18:52 -0400 Subject: tests: make _EXPECT handle more cases First issue is that _EXPECT wasn't handling args with spaces correctly. This was fixed by enclosing the entire expected-value expression in double quotes with a simple backslash escape for the end-of-line dollar sign. Second issue is that we were throwing away potentially useful debug information. Fixed by using egrep's -q option to suppress output, and eliminating redirections so that we can see any stderr output related to a script error. Change-Id: Ide3f49558dcece55bd90cad50b1ffc572592f11c Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.org/4126 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- tests/include.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/include.rc b/tests/include.rc index bc9784cf4..585a4e2c8 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -56,7 +56,7 @@ function _EXPECT() e="$1"; shift; - "$@" | tail -1 | egrep '^'${e}'$' >/dev/null 2>&1; + "$@" | tail -1 | egrep -q "^${e}\$" test_footer; } -- cgit