Skip to content

Commit

Permalink
regress: fix on FreeBSD 11
Browse files Browse the repository at this point in the history
- alter call order of binaries as having "-v" as last parameter
  lets the daemons and bls show the usage instead of running.
- Makefile: clean target cleans the right directories.
- diff.pl: find full path to perl binary
- do not use path to sed (as it is different on FreeBSD)
- fixed unneeded loop in BareosFindPrograms.cmake
  • Loading branch information
pstorz committed Jul 12, 2018
1 parent 91f4640 commit ab767d6
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 22 deletions.
12 changes: 5 additions & 7 deletions core/cmake/BareosConfigureFile.cmake
Expand Up @@ -21,11 +21,9 @@
# configure file all *.in files
#

FOREACH(DIRECTORY manpages scripts src debian platforms)
FILE(GLOB_RECURSE IN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.in" )
FOREACH(in_file ${IN_FILES})
string(REGEX REPLACE ".in\$" "" file ${in_file})
# message(STATUS "creating file ${file}")
CONFIGURE_FILE(${in_file} ${file} @ONLY)
ENDFOREACH()
FILE(GLOB_RECURSE IN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.in" )
FOREACH(in_file ${IN_FILES})
string(REGEX REPLACE ".in\$" "" file ${in_file})
message(STATUS "creating file ${file}")
CONFIGURE_FILE(${in_file} ${file} @ONLY)
ENDFOREACH()
4 changes: 2 additions & 2 deletions core/scripts/bareos-ctl-dir.in
Expand Up @@ -71,9 +71,9 @@ case "$1" in
fi

if [ "x${VALGRIND_DIR}" = "x1" ]; then
valgrind --leak-check=full ${BIN} $2 $3 ${OPTIONS} -v
valgrind --leak-check=full ${BIN} -v $2 $3 ${OPTIONS}
else
${BIN} $2 $3 ${OPTIONS} -v
${BIN} -v $2 $3 ${OPTIONS}
fi
sleep 1
fi
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/bareos-ctl-fd.in
Expand Up @@ -65,9 +65,9 @@ case "$1" in
fi

if [ "x${VALGRIND_FD}" = "x1" ]; then
valgrind --leak-check=full ${BIN} $2 $3 ${OPTIONS} -v
valgrind --leak-check=full ${BIN} -v $2 $3 ${OPTIONS}
else
${BIN} $2 $3 ${OPTIONS} -v
${BIN} -v $2 $3 ${OPTIONS}
fi
fi
;;
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/bareos-ctl-sd.in
Expand Up @@ -65,9 +65,9 @@ case "$1" in
fi

if [ "x${VALGRIND_SD}" = "x1" ]; then
valgrind --leak-check=full ${BIN} $2 $3 ${OPTIONS} -v
valgrind --leak-check=full ${BIN} -v $2 $3 ${OPTIONS}
else
${BIN} $2 $3 ${OPTIONS} -v
${BIN} -v $2 $3 ${OPTIONS}
fi
fi
;;
Expand Down
3 changes: 2 additions & 1 deletion regress/Makefile
Expand Up @@ -78,7 +78,8 @@ clean:
rm -f diff
rm -f 1 2 3 scripts/1 scripts/2 scripts/3 tests/1 tests/2 tests/3
find . -name .#* -exec rm -rf {} \;
rm -Rvf cmake-build
rm -Rvf build/cmake-build
rm build

# Reset our userid after running as root
reset:
Expand Down
2 changes: 1 addition & 1 deletion regress/prototype.conf
Expand Up @@ -3,7 +3,7 @@ MAKEOPT=-j4

# Where to get the Bareos core source to be tested
# needs to be an absolute path for coverage
BAREOS_SOURCE="`pwd`/../core"
BAREOS_SOURCE="`pwd`/.."

# Where to send email !!!!! Change me !!!!!!!
EMAIL=my-name@domain.com
Expand Down
3 changes: 2 additions & 1 deletion regress/scripts/create_sed
Expand Up @@ -59,7 +59,7 @@ bareos_gitrev=`git show -s --format=%h HEAD`
cd -

GCOV=`which gcov`

PERL=`which perl`

# Create sed command script
>${out}
Expand Down Expand Up @@ -128,4 +128,5 @@ echo "s%@gitrev@%${gitrev}%g" >>${out}
echo "s%@regress_gitbranch@%${regress_gitbranch}%g" >>${out}
echo "s%@regress_gitrev@%${regress_gitrev}%g" >>${out}
echo "s%@GCOV@%${GCOV}%g" >>${out}
echo "s%@PERL@%${PERL}%g" >>${out}

2 changes: 1 addition & 1 deletion regress/scripts/diff.pl → regress/scripts/diff.pl.in
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!@PERL@ -w

=head1 NAME

Expand Down
1 change: 1 addition & 0 deletions regress/scripts/do_sed
Expand Up @@ -16,6 +16,7 @@ do
sed -f ${out} ${file} > `echo "${file}" | sed -e 's/.in$//'`
done


# These files have no fancy sed stuff, so we just copy them over
#cp ${rscripts}/win32-bareos-sd-tape.conf.in ${rscripts}/win32-bareos-sd-tape.conf
#cp ${rscripts}/win32-bareos-fd.conf.in ${rscripts}/win32-bareos-fd.conf
Expand Down
2 changes: 1 addition & 1 deletion regress/scripts/functions
Expand Up @@ -330,7 +330,7 @@ bls_files_verbose()
#local JOBID=${3}
#local FILENAME=${4}

${bin}/bls "${STORAGE}" -V "${VOLUME}" -c ${conf} -v
${bin}/bls -V "${VOLUME}" -c ${conf} -v "${STORAGE}"
return $?
}

Expand Down
Empty file modified regress/scripts/regress-win32.pl 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion regress/tests/migration-volume-sd-sd-test
Expand Up @@ -17,7 +17,7 @@ scripts/cleanup
# create start script for second sd
/bin/cp -f bin/bareos-ctl-sd bin/bareos-ctl-sd2
#/bin/sed 's/bareos-sd.conf/bareos-sd2.conf/g' < bin/bareos-ctl-sd > bin/bareos-ctl-sd2
/bin/sed "s#BAREOS_CONFIG_DIR=.*#BAREOS_CONFIG_DIR=${cwd}/bin/bareos-sd2.conf#g" < bin/bareos-ctl-sd > bin/bareos-ctl-sd2
sed "s#BAREOS_CONFIG_DIR=.*#BAREOS_CONFIG_DIR=${cwd}/bin/bareos-sd2.conf#g" < bin/bareos-ctl-sd > bin/bareos-ctl-sd2

/bin/cp -f scripts/bareos-sd-migration-sd-sd1.conf bin/bareos-sd.conf
/bin/cp -f scripts/bareos-sd-migration-sd-sd2.conf bin/bareos-sd2.conf
Expand Down
6 changes: 3 additions & 3 deletions regress/tests/source-addr-test
Expand Up @@ -41,7 +41,7 @@ start_test
#
outf="tmp/sed_tmp"
echo "s% Schedule =%# Schedule =%g" >${outf}
echo "s%Name = \"$JobName\"%Name = \"$JobName\"; client run after job = \"netstat -tan\"%g" >>${outf}
echo "s%Name = \"$JobName\"%Name = \"$JobName\"; client run after job = \"netstat -an\"%g" >>${outf}
cp ${conf}/bareos-dir.conf $tmp/1
sed -f ${outf} $tmp/1 >${conf}/bareos-dir.conf

Expand All @@ -52,7 +52,7 @@ PATH=$PATH:/sbin:/usr/sbin
#
os=`uname`
if [ $os = 'FreeBSD' ]; then
INTERFACE=bge0
INTERFACE=xn0
IP=`ifconfig ${INTERFACE} | perl -ne '/inet (.+?) / && print $1'`
elif [ $os = 'Linux' ]; then
INTERFACE=eth0
Expand Down Expand Up @@ -135,7 +135,7 @@ if [ $? -ne 0 ]; then
fi

if [ "$stat" = 2 ] ; then
netstat -tan
netstat -an
fi

if [ "$debug" = 1 ] ; then
Expand Down

0 comments on commit ab767d6

Please sign in to comment.