Blame runtests.sh

Karanbir Singh 2dd0be
#!/bin/bash
Karanbir Singh 7a0496
Steve Barnes e801dc
# Author: Steve Barnes (steve@echo.id.au)
Steve Barnes e801dc
# Description: this script sources our library functions and starts a test run.
Steve Barnes e801dc
Karanbir Singh 2dd0be
echo -e "\n[+] `date` -> CentOS QA $0 starting."
Karanbir Singh 2dd0be
Karanbir Singh cc2368
yum -d0 -y install bind-utils 
Karanbir Singh df2b9a
48a27c
if [ "$?" -ne "0" ] ;then
48a27c
  echo "[+] ERROR : not even able to install bind-utils pkg so all t_functional tests will fail"
48a27c
  echo "[+] Do we have enabled repositories with correct GPG settings and signed pkgs ?"
48a27c
  exit 1
48a27c
fi
48a27c
Karanbir Singh 0da8c3
host repo.centos.qa > /dev/null
Karanbir Singh 0da8c3
export SKIP_QA_HARNESS=$?
Karanbir Singh 23b6ba
Karanbir Singh 2dd0be
LIB_FUNCTIONS='./tests/0_lib/functions.sh'
Karanbir Singh 2dd0be
Karanbir Singh 600c82
# Human friendly symbols
Karanbir Singh 600c82
export readonly PASS=0
Karanbir Singh 600c82
export readonly FAIL=1
Karanbir Singh 600c82
# set debug level of yum install in t_InstallPackage
Karanbir Singh 600c82
export YUMDEBUG=0
iaind 79f00f
Karanbir Singh 2dd0be
[ -f $LIB_FUNCTIONS ] && source $LIB_FUNCTIONS || { echo -e "\n[+] `date` -> Unable to source functions library. Cannot continue\n"; exit $FAIL; }
Karanbir Singh 2dd0be
Karanbir Singh 2dd0be
# case insensitive filename matching
Karanbir Singh 2dd0be
shopt -s nocasematch
Karanbir Singh 2dd0be
Karanbir Singh 2dd0be
# exit as soon as any script returns a non-zero exit status
Karanbir Singh 2dd0be
set -e
Karanbir Singh 2dd0be
Steve Barnes 464547
# exit on undefined variables
Steve Barnes 464547
set -u
Steve Barnes 464547
55254f
# Searching for tests to disable
55254f
if [ -e skipped-tests.list ] ;then
55254f
  t_Log "QA Harness : searching for tests to disable with valid reason"
55254f
  egrep ^${centos_ver} skipped-tests.list | while read line; 
55254f
    do test=$(echo $line|cut -f 2 -d '|')
55254f
    t_Log "Disabling QA harness test ${test}"
55254f
    chmod -x ${test}
55254f
  done
55254f
fi
55254f
Steve Barnes 464547
# process our test scripts
Karanbir Singh 298f36
if [ $# -gt 0 ]; then
vivekd 5ac723
  t_Process <(/usr/bin/find ./tests/0_*/ -type f|sort -t'/' )
vivekd f987f3
  t_Process <(/usr/bin/find ./tests/$1/ -type f|sort -t'/' )
Karanbir Singh 910a7a
else
vivekd 5ac723
  t_Process <(/usr/bin/find ./tests/0_*/ -type f|sort -t'/' )
Christoph Galuschka 0d78f7
  t_Process <(/usr/bin/find ./tests/p_*/ -type f|sort -t'/' )
Karanbir Singh 24cac1
  t_Process <(/usr/bin/find ./tests/r_*/ -type f|sort -t'/' )
Karanbir Singh 24cac1
  t_Process <(/usr/bin/find ./tests/z_*/ -type f|sort -t'/' )
Karanbir Singh 24cac1
fi
Karanbir Singh 2dd0be
Steve Barnes e801dc
# and, we're done.
55254f
if [ -e skipped-tests.list ] ;then
55254f
  t_Log "QA Harness : Searching for disabled tests (skipped-tests.list)"
55254f
  egrep ^${centos_ver} skipped-tests.list | while read line; 
55254f
    do test=$(echo $line|cut -f 2 -d '|')
55254f
    reason=$(echo $line|cut -f 3 -d '|')
55254f
    t_Log " =WARNING= : Disabled test : ${test} (${reason})" 
55254f
  done
55254f
fi
55254f
1cf36a
t_Log "QA t_functional tests finished."
Athmane Madjoudj 549cd2
exit 0