bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

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
Christoph Galuschka ca4411
t_Log "Running $0 - Checking binaries are present and run on C5"
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
Christoph Galuschka a13887
for binary in gunzip gzip zcat gzexe zless
Iain Douglas 90f693
do
Christoph Galuschka 316297
    echo -n "$binary "
Iain Douglas 90f693
    $binary --version &>/dev/null || ExitFail
Iain Douglas 90f693
done
Iain Douglas 90f693
Christoph Galuschka 918ab9
#disabled, needs to be looked into
Christoph Galuschka 918ab9
#for binary in zmore
Christoph Galuschka 918ab9
#do
Christoph Galuschka 918ab9
#    echo -n "$binary "
Christoph Galuschka 918ab9
#    $binary &>/dev/null || ExitFail
Christoph Galuschka 918ab9
#done
Christoph Galuschka a13887
Christoph Galuschka a13887
for binary in znew zforce
Iain Douglas 90f693
do
Christoph Galuschka 316297
    echo -n "$binary "
Christoph Galuschka 8e848e
    $binary &>/dev/null
Christoph Galuschka 8e848e
    [ $? != '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"