From edbc8998034d27ee0f7ab364f107ee21f4c0ef6e Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Jul 29 2019 12:39:12 +0000 Subject: Fix gzip tests in CentOS8 --- diff --git a/tests/p_gzip/10-test-binaries b/tests/p_gzip/10-test-binaries index 3bb5957..2c7ee7b 100755 --- a/tests/p_gzip/10-test-binaries +++ b/tests/p_gzip/10-test-binaries @@ -17,7 +17,7 @@ fi t_Log "Checking binaries are present and run on C6/C7" -if [ $centos_ver == 7 ] +if [ $centos_ver -ge 7 ] then [ "$(readlink -e /usr/bin/gunzip)" == "/usr/bin/gunzip" ] || ExitFail [ "$(readlink -e /usr/bin/gzip)" == "/usr/bin/gzip" ] || ExitFail diff --git a/tests/p_gzip/20-gzip-test b/tests/p_gzip/20-gzip-test index d7bf553..da363bb 100755 --- a/tests/p_gzip/20-gzip-test +++ b/tests/p_gzip/20-gzip-test @@ -66,7 +66,7 @@ t_Log "Check -a is ignored as we're on CentOS" if [ $centos_ver == '5' ] then gunzip -a $FILE.gz 2>&1 | head -n 1 | grep -q 'gunzip: option --ascii ignored on this system' || ExitFail -elif [[ $centos_ver =~ ^(6|7)$ ]] +elif [[ $centos_ver =~ ^(6|7|8)$ ]] then gunzip -a $FILE.gz 2>&1 | head -n 1 | grep -q 'gzip: option --ascii ignored on this system' || ExitFail fi diff --git a/tests/p_gzip/80-zmore-tests b/tests/p_gzip/80-zmore-tests index b455cab..1039c13 100755 --- a/tests/p_gzip/80-zmore-tests +++ b/tests/p_gzip/80-zmore-tests @@ -9,13 +9,25 @@ t_Log "Running $0 Testing zmore" TESTFILE="./tests/p_gzip/gzip-test.txt.gz" t_Log "Check single file invocation" -zmore $TESTFILE | grep -q -- '------> ./tests/p_gzip/gzip-test.txt.gz <-----'- +zmore $TESTFILE | grep -q -- 'gzip-test of single file' t_CheckExitStatus $? # Check multifile invocation t_Log "Check multifile invocation" +if [ $centos_ver -ge 8 ] +then +expect << EOF &>/dev/null +spawn zmore $TESTFILE $TESTFILE +set timeout 2 +set match_max 1000 +expect -- "gzip-test of single file" +expect -- "gzip-test of single file" {exit 0} +exit 1 +EOF +retval=$? +else expect << EOF &>/dev/null spawn zmore $TESTFILE $TESTFILE set timeout 2 @@ -24,7 +36,9 @@ expect -- "--More--(Next file: ./tests/p_gzip/gzip-test.txt.gz)" {send n} timeou expect -- "gzip-test of single file" {exit 0} exit 1 EOF +retval=$? +fi -t_CheckExitStatus $? +t_CheckExitStatus $retval