Blame tests/p_gzip/10-C5-test-binaries

Iain Douglas 90f693
#!/bin/bash
Iain Douglas 90f693
# Author: Iain Douglas <centos@1n6.org.uk>
Iain Douglas 90f693
#
Iain Douglas 90f693
# Check the binaries from the CentOS 5 package exist and run ok
Iain Douglas 90f693
Iain Douglas 90f693
function ExitFail {
Iain Douglas 90f693
    t_Log "Fail"
Iain Douglas 90f693
    exit $FAIL
Iain Douglas 90f693
}
Iain Douglas 90f693
Iain Douglas 90f693
[ $centos_ver != '5'  ] && exit
Iain Douglas 90f693
Iain Douglas 90f693
# Some ov the binaries respond to a --version and some don't. Of those that 
Iain Douglas 90f693
# don't, some exit with a status of 1 and others exit with a status of 2 
Iain Douglas 90f693
# nice and consistent NOT!
Iain Douglas 90f693
Iain Douglas 90f693
t_Log "Checking binaries are present and run"
Iain Douglas 90f693
[ "$(readlink -e /usr/bin/gunzip)" == "/bin/gunzip" ] || ExitFail
Iain Douglas 90f693
[ "$(readlink -e /usr/bin/gzip)" == "/bin/gzip" ] || ExitFail
Iain Douglas 90f693
Iain Douglas 90f693
for binary in gunzip gzip zcat gzexe zless
Iain Douglas 90f693
do
Iain Douglas 90f693
    echo -n "$binary "
Iain Douglas 90f693
    $binary --version &>/dev/null || ExitFail
Iain Douglas 90f693
done
Iain Douglas 90f693
Iain Douglas 90f693
for binary in znew zmore zforce
Iain Douglas 90f693
do
Iain Douglas 90f693
    echo -n "$binary "
Iain Douglas 90f693
    $binary &>/dev/null
Iain Douglas 90f693
    [ $? != '1' ] && ExitFail
Iain Douglas 90f693
done
Iain Douglas 90f693
Iain Douglas 90f693
for binary in zgrep zfgrep zegrep zdiff zcmp
Iain Douglas 90f693
do
Iain Douglas 90f693
    echo -n "$binary "
Iain Douglas 90f693
    $binary &>/dev/null
Iain Douglas 90f693
    [ $? != '2' ] && ExitFail
Iain Douglas 90f693
done
Iain Douglas 90f693
echo ""
Iain Douglas 90f693
t_Log "PASS"