Skip to content

Commit

Permalink
tests: log_test_mock.sh: allow for selection of particular test
Browse files Browse the repository at this point in the history
This is to cut down some time when only particular item of the
test matrix is of interest, such as in

  ./log_test_mock.sh -v -ncl -tqb+_il+_c+ <srpm>

command that can be used to highlight the issue with binutils 2.29+
compatibility fix making for a new issue when all of following are
satisfied:

- there are three link participants (reusing terminology establish
  in the patches constituting said fix)
  client program > intermediate library > libqb
  (client is not necessarily directly dependent on libqb)

- client program is build-time linked using ld/binutils either
  < or >= 2.29 but with libqb 1.0.3 (containing the said fix,
  i.e., new linker script is in effect for building the client
  program)

- client program does not use any logging at all

- intermediate library triggers some checks when gets loaded,
  through usage of QB_LOG_INIT_DATA macro from qb/qblog.h,
  which are meant to check itself, but alas, the symbols to
  check on behalf of this library get run-time overridden
  with symbols of the client program, which only do exist
  because the libqb.so linker script (intended for other
  effect) made it happen despite the section is empty

So far, log_test_mock.sh was only thoroughly run without any
log-suppressing options (e.g. -ncl), which together with some
extra linker/build flags (distro specific?) in case of compiling
pacemaker (exercising the same scheme with some CLI utilities)
masked this problem.  [this all is still to be verified]

This asks for a follow-up solution, and this commit is a good
start as running whole matrix would keep increasing turnaround
time needlessly (the new skipping harness is not ideal, but
serves the purpose).

Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
jnpkrn committed Jan 11, 2018
1 parent 83364a3 commit b4ba81e
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions tests/functional/log_test_mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,16 @@ do_proceed () {
_selfcheck=1
_clientlogging=1
_interliblogging=1
_picktest=
while :; do
case "$1" in
shell) shift; do_shell "$@"; return;;
-v) _makevars="${_makevars} V=1"; shift;;
shell) shift; do_shell "$@"; return;;
-v) _makevars="${_makevars} V=1"; shift;;
-t=?*) _picktest=${1#-t=}; shift;;
-t=) do_die "missing -t option value";;
-t?*) _picktest=${1#-t}; shift;;
-t) test $# -gt 1 && { shift; _picktest=$1; } \
|| do_die "missing -t option value"; shift;;
-nsc) _resultsdir_tag="${_resultsdir_tag}$1"; shift; _selfcheck=0;;
-ncl) _resultsdir_tag="${_resultsdir_tag}$1"; shift; _clientlogging=0;;
-nil) _resultsdir_tag="${_resultsdir_tag}$1"; shift; _interliblogging=0;;
Expand Down Expand Up @@ -245,6 +251,12 @@ do_proceed () {
*) _outfile_qb="?";;
esac

case "${_picktest}" in
""|${_outfile_qb}*) ;;
*) do_progress "skipping '${_outfile_qb}' branch (no match with '${_picktest}')"
continue;;
esac

do_progress "installing ${_pkg_binutils_libqb} so as to build" \
"libqb [${_outfile_qb}]"
do_install "${_pkg_binutils_libqb}"
Expand All @@ -269,18 +281,22 @@ do_proceed () {
*) _outfile="${_outfile_qb}_?";;
esac

case "${_pkg_binutils_interlib}" in
none) ;;
*)
do_progress "installing ${_pkg_binutils_interlib}" \
"so as to build interlib [${_outfile}]"
do_install "${_pkg_binutils_interlib}"

do_progress "building interlib with ${_libqb_descriptor_archive}" \
"+ ${_pkg_binutils_interlib} [${_outfile}]" \
"{${_makevars}}"
do_compile_interlib "${_libqb_descriptor_archive}" "${_makevars}"
;;
case "${_picktest}" in
""|"${_outfile}*")
case "${_pkg_binutils_interlib}" in
none) ;;
*)
do_progress "installing ${_pkg_binutils_interlib}" \
"so as to build interlib [${_outfile}]"
do_install "${_pkg_binutils_interlib}"

do_progress "building interlib with ${_libqb_descriptor_archive}" \
"+ ${_pkg_binutils_interlib} [${_outfile}]" \
"{${_makevars}}"
do_compile_interlib "${_libqb_descriptor_archive}" "${_makevars}"
;;
esac;;
*) do_progress "skipping dealing with interlib (no match with '${_picktest}')";;
esac

for _pkg_binutils_client in "${pkg_binutils_228}" "${pkg_binutils_229}"; do
Expand All @@ -294,6 +310,9 @@ do_proceed () {
*) _outfile_client="${_outfile}_?";;
esac

test -n "${_picktest}" && test "${_picktest}" != "${_outfile_client}" \
&& continue

do_progress "installing ${_pkg_binutils_client}" \
"so as to build ${_client} [${_outfile_client}]"
do_install "${_pkg_binutils_client}"
Expand All @@ -309,9 +328,11 @@ do_proceed () {
}

{ test $# -eq 0 || test "$1" = -h || test "$1" = --help; } \
&& printf '%s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n' \
&& printf '%s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n' \
"usage: $0 {[-n{sc,cl,il}]* <libqb.src.rpm> | shell}" \
"- use '-v' to show the compilation steps verbosely" \
"- use '-t[=]<testspec>' to pick just one item of the test matrix" \
" (pass the identifier matching the result file, e.g. qb+c-)" \
"- use '-nsc' to suppress optional self-check (\"see whole story\")" \
"- use '-ncl' to suppress client-side logging" \
"- use '-nil' to suppress interlib-side logging" \
Expand Down

0 comments on commit b4ba81e

Please sign in to comment.