4 echo "please run via 'make test' from the project directory"
8 if [ $
(id
-u) -ne 0 ]; then
9 echo "please run as root because we need to create test sites"
13 # do we install a package?
14 if [ ! -z "$OMD_PACKAGE" ]; then
15 echo "###################################################################"
17 OMD_PACKAGE
=`ls -1 $OMD_PACKAGE | head -n 1`
19 if [ ! -e "$OMD_PACKAGE" ]; then
20 echo "cannot install $OMD_PACKAGE: no such file"
23 echo "installing " `basename $OMD_PACKAGE`
26 if [ -x /usr
/bin
/apt-get
]; then
27 VERSION
=`dpkg-deb -W --showformat='${Package}\n' $OMD_PACKAGE | sed -e 's/^omd-//'`
28 DEPENDS
=`dpkg-deb -W --showformat='${Depends}\n' $OMD_PACKAGE | sed -e 's/debconf.*debconf-2.0,//' | tr -d ','`
29 apt-get
-qq update
&& \
30 DEBIAN_FRONTEND
=noninteractive apt-get
-q -y --no-install-recommends install $DEPENDS && \
31 dpkg
-i $OMD_PACKAGE && \
32 /usr
/sbin
/update-alternatives
--set omd
/omd
/versions
/$VERSION
35 elif [ -x /usr
/bin
/yum
]; then
36 # remove version if alread installed
37 /usr
/bin
/yum remove
-y `rpm -qp $OMD_PACKAGE`
38 /usr
/bin
/yum
install -y --nogpgcheck $OMD_PACKAGE
41 elif [ -x /usr
/bin
/zypper
]; then
42 # remove version if alread installed
43 /usr
/bin
/zypper
--quiet --non-interactive remove
`rpm -qp $OMD_PACKAGE`
44 /usr
/bin
/zypper
--quiet --non-interactive install $OMD_PACKAGE
48 if [ $rc -ne 0 ]; then
49 echo "Package installation failed, cannot run tests..."
54 # set perl environment
55 PERLARCH
=$
(perl
-e 'use Config; print $Config{archname}')
56 export PERL5LIB
="/omd/versions/default/lib/perl5/lib/perl5/${PERLARCH}:/omd/versions/default/lib/perl5/lib/perl5:$PERL5LIB"
58 if [ -z $OMD_BIN ]; then
62 echo "###################################################################"
63 echo "running tests..."
70 OMD_BIN
=$OMD_BIN PERL_DL_NONLAZY
=1 /usr
/bin
/env perl
"-MExtUtils::Command::MM" "-e" "test_harness($VERBOSE)" $TESTS