Conversation
arogge
left a comment
There was a problem hiding this comment.
Does a bit more than the description of the PR suggest, but OK.
The cmake formatting needs a quick review though.
systemtests/bin/bareos
Outdated
| . ./environment | ||
| ${scripts}/bareos-config initialize_database_driver | ||
| ${scripts}/bareos $@ | ||
| ${rscripts}/bareos $@ |
There was a problem hiding this comment.
Yes, that was intended. When running on installed files, some of the scripts are taken from the installation (scripts) and some are not part of the packages so need to be taken from the source tree (rscripts).
| bareossql | ||
| PROPERTIES VERSION "${BAREOS_NUMERIC_VERSION}" SOVERSION | ||
| "${BAREOS_VERSION_MAJOR}" | ||
| bareossql PROPERTIES VERSION "${BAREOS_NUMERIC_VERSION}" SOVERSION |
There was a problem hiding this comment.
something seems to be weird with cmake-format here, it seems to have formatted in a different way for you
There was a problem hiding this comment.
I verified that my cmake-format does it that way.
bb088e3 to
f31fb90
Compare
franku
left a comment
There was a problem hiding this comment.
Looks good. However, some missing quotes here and there.
core/src/tests/catalog.cc
Outdated
| static std::string getenv_std_string(std::string env_var) | ||
| { | ||
| auto v{std::getenv(env_var.c_str())}; | ||
| const char* v=(std::getenv(env_var.c_str())); |
There was a problem hiding this comment.
| const char* v=(std::getenv(env_var.c_str())); | |
| const char* v = (std::getenv(env_var.c_str())); |
core/src/tests/catalog.cc
Outdated
| { | ||
| std::vector<char> stime; | ||
| auto jcr{directordaemon::NewDirectorJcr()}; | ||
| auto jcr=directordaemon::NewDirectorJcr(); |
There was a problem hiding this comment.
| auto jcr=directordaemon::NewDirectorJcr(); | |
| auto jcr = directordaemon::NewDirectorJcr(); |
systemtests/bin/bareos
Outdated
| @@ -2,4 +2,4 @@ | |||
| # script to start and stop daemons for individual test | |||
| . ./environment | |||
| ${scripts}/bareos-config initialize_database_driver | |||
There was a problem hiding this comment.
| ${scripts}/bareos-config initialize_database_driver | |
| "${scripts}"/bareos-config initialize_database_driver |
systemtests/bin/bconsole
Outdated
| # wrapper script to start/stop bconsole for each individual test | ||
| . ./environment | ||
| ${bin}/bconsole -c ${conf} "$@" | ||
| ${BAREOS_BCONSOLE_BINARY} -c ${conf} "$@" |
There was a problem hiding this comment.
| ${BAREOS_BCONSOLE_BINARY} -c ${conf} "$@" | |
| "${BAREOS_BCONSOLE_BINARY}" -c "${conf}" "$@" |
There was a problem hiding this comment.
BAREOS_BCONSOLE_BINARY and others should all be quoted accordingly.
| PROJECT_BINARY_DIR=@PROJECT_BINARY_DIR@ | ||
| bin=${PROJECT_BINARY_DIR}/bin | ||
| sbin=${PROJECT_BINARY_DIR}/sbin | ||
| bin=@bin@ |
There was a problem hiding this comment.
| bin=@bin@ | |
| bin="@bin@" |
|
|
||
| dumps=${current_test_directory}/dumps | ||
| plugindir=${PROJECT_BINARY_DIR}/plugins | ||
| plugindir=@plugins@ |
There was a problem hiding this comment.
| plugindir=@plugins@ | |
| plugindir="@plugins@" |
| echo "running $0" | ||
| ${scripts}/bareos-config initialize_database_driver | ||
| . ${scripts}/functions | ||
| . ${rscripts}/functions |
There was a problem hiding this comment.
| . ${rscripts}/functions | |
| . "${rscripts}/functions" |
| END_OF_DATA | ||
|
|
||
| if ! ${bin}/bconsole -c "${conf}" -p etc/user1.cred < $tmp/bconcmds >${tmp}/log1.out 2>${tmp}/err1.out; then | ||
| if ! ${BAREOS_BCONSOLE_BINARY} -c "${conf}" -p etc/user1.cred < $tmp/bconcmds >${tmp}/log1.out 2>${tmp}/err1.out; then |
There was a problem hiding this comment.
| if ! ${BAREOS_BCONSOLE_BINARY} -c "${conf}" -p etc/user1.cred < $tmp/bconcmds >${tmp}/log1.out 2>${tmp}/err1.out; then | |
| if ! "${BAREOS_BCONSOLE_BINARY}" -c "${conf}" -p etc/user1.cred < $tmp/bconcmds >${tmp}/log1.out 2>${tmp}/err1.out; then |
| print_debug "OK: login as user1 succeeded." | ||
|
|
||
| if ${bin}/bconsole -c "${conf}" -p etc/user2.cred < $tmp/bconcmds >${tmp}/log2.out 2>${tmp}/err2.out; then | ||
| if ${BAREOS_BCONSOLE_BINARY} -c "${conf}" -p etc/user2.cred < $tmp/bconcmds >${tmp}/log2.out 2>${tmp}/err2.out; then |
There was a problem hiding this comment.
| if ${BAREOS_BCONSOLE_BINARY} -c "${conf}" -p etc/user2.cred < $tmp/bconcmds >${tmp}/log2.out 2>${tmp}/err2.out; then | |
| if "${BAREOS_BCONSOLE_BINARY}" -c "${conf}" -p etc/user2.cred < $tmp/bconcmds >${tmp}/log2.out 2>${tmp}/err2.out; then |
There was a problem hiding this comment.
check other occurences as well, please
|
|
||
|
|
||
| if ! ${scripts}/bareos-ctl-dir status >/dev/null; then | ||
| if ! ${rscripts}/bareos-ctl-dir status >/dev/null; then |
There was a problem hiding this comment.
| if ! ${rscripts}/bareos-ctl-dir status >/dev/null; then | |
| if ! "${rscripts}"/bareos-ctl-dir status >/dev/null; then |
- moved common reload-xxx-test functions into one script - quoting of variables - enable shellcheck to follow sourced files - added missing function parameters - fix order of output redirection - set /bin/bash as shell where required
28d4137 to
f98f608
Compare
systemtests/bin/bconsole
Outdated
| . ./environment | ||
| ${BAREOS_BCONSOLE_BINARY} -c ${conf} "$@" | ||
|
|
||
| "${BAREOS_BCONSOLE_BINARY}" -c ${conf} "$@" |
| rm -rf "${working:?}"/CLEANUPMARKER | ||
| rm -rf "${working:?}"/plugins/* | ||
| rm -rf "${archivedir:?}"/* | ||
| rm -f "${config_directory_dir_additional_test_config}"/* |
systemtests/scripts/functions
Outdated
| fi | ||
|
|
||
| if [ $bstat != 0 -o $rstat != 0 ] ; then | ||
| if [ $bstat != 0 ] || [ $rstat != 0 ] ; then |
There was a problem hiding this comment.
"!=" does a string-comparison, numerically not-equal is "-ne"
| exit 1 | ||
| fi | ||
| if [ "$dstat" != "0" -o "$bstat" != "0" -o "$rstat" != "0" ] ; then | ||
| if [ "$dstat" != "0" ] || [ "$bstat" != "0" ] || [ "$rstat" != "0" ] ; then |
There was a problem hiding this comment.
same as above. Should be -ne instead of !=
systemtests/scripts/functions
Outdated
| echo " !!!!! $TestName failed!!! $ENDDATE !!!!! " >>test.out | ||
| echo " Status: zombie=$zstat backup=$bstat restore=$rstat diff=$dstat" >>test.out | ||
| if [ $bstat != 0 -o $rstat != 0 ] ; then | ||
| if [ $bstat != 0 ] || [ $rstat != 0 ] ; then |
There was a problem hiding this comment.
same as above. Should be -ne instead of !=
| #shellcheck source=../environment.in | ||
| . ./environment | ||
|
|
||
| JobName=backup-bareos-fd |
There was a problem hiding this comment.
is this correct? The original JobName was "bconsole-status-client"
There was a problem hiding this comment.
JobName is irrelevant here as no job is run at all in this test.
| num_eos=$(grep -c '^End Job Session Record:$' "$tmp/bscan.out") | ||
| if [ "$num_eos" -ne 1 ]; then | ||
| echo "Found $eum_sos end of session records instead of 1" | ||
| echo "Found $num_sos end of session records instead of 1" |
| num_eos=$(grep -c '^End Job Session Record:$' "$tmp/bscan.out") | ||
| if [ "$num_eos" -ne 1 ]; then | ||
| echo "Found $eum_sos end of session records instead of 1" | ||
| echo "Found $num_sos end of session records instead of 1" |
| grep "Using Device \"MultiFileStorage0003\"" ${tmp}/log1.out 2>&1 >/dev/null | ||
| grep "Using Device \"MultiFileStorage0001\"" ${tmp}/log1.out >/dev/null 2>&1 && | ||
| grep "Using Device \"MultiFileStorage0002\"" ${tmp}/log1.out >/dev/null 2>&1 && | ||
| grep "Using Device \"MultiFileStorage0003\"" ${tmp}/log1.out >/dev/null 2>&1 |
| num_eos=$(grep -c '^End Job Session Record:$' "$tmp/bscan.out") | ||
| if [ "$num_eos" -ne 1 ]; then | ||
| echo "Found $eum_sos end of session records instead of 1" | ||
| echo "Found $num_sos end of session records instead of 1" |
This pull request enables the system tests to be optionally run on installed binaries like from packages.