Commit Graph

20 Commits

Author SHA1 Message Date
Jan Pokorný
c5cb0db0f2
CI: travis: add (redundant for now, but...) libglib2.0-dev prerequisite
We want to run every and each test we can, without reliance on
transitive deoendencies and environment "invariants".

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2019-06-12 16:31:21 +02:00
Jan Pokorný
454610697b
tests: new sort of tests dubbed "functional", cover linker vs. logging
These are for quick manual sanity checking, assuming the target audience
-- maintainers -- are clear on the context of use and the purpose
(perhaps with the help of static files for comparison and/or additional
checking harness, usually available through "make check", but not to be
confused with regular unit + broader tests).  These test are meant to be
compiled on demand only, not during the standard building routine, for
which a trick leveraging GNUmakefile-Makefile precedence with GNU make
was devised (GNU make/gmake already required by configure script for
other reasons [some pattern-based matching not available with FreeBSD's
default "make", IIRC], so this introduces no new build dependency).

The respective new tests are meant to simulate logging variants in two
different library consumption models:
  a. regular: linking against system-wide library
  b. developmental: consuming library from a local sub-checkout tree,
                    using libtool conventions and hence attaching the
                    library through libqb.la intermediate library
                    descriptor of libtool
and between up to three possibly affected logging system participants
(discrete compilation units):
  1. libqb itself will emit log messages in boundary conditions or
     for tracing purposes
  2. client program that consumes libqb's logging API directly
  3. ditto, but the client program furthermore links with a library
     (referred to as "interlib") that itself exercises the logging
     API (it's also linked with libqb) -- through induction, this
     should cover whole class of N interlib cases

Especially the latter perspective makes for a test matrix to possibly
(hopefully) demonstrate a fix allowing to cope with the changed
behaviour of ld from binutils 2.29+ wrt. boundaries denoting symbols for
a (custom) orphan section that are no longer externally visible.  Such
commit is in the pipeline...

Developmental consumption model (a.) is now also tested automatically
in Travis CI runs and as a part of %check within upstream-suggested
libqb.spec for RPM packaging, whereas the regular one (b.) serves as
a building block for new log_test_mock.sh runner of said test matrix
-- it iterates through all the possible permutations of linker-imposed
implicit visibility of mentioned symbols between various affected
link participants all making use of logging (see 1. - 3. above) so as
to demonstrate A/ the impact of the problem (see table below), and
subsequently B/ that the fix is effective in all these situations
(updated table will be provided as well) once it lands.  This script
also allows convoluting the test matrix further, notably with on-demand
defusing the self-checks based on QB_LOG_INIT_DATA macro, which is
of significance as demonstrated below (and will become even more
important with upcoming patches in this series).

* * *

Current state for such matrix, in which participants 1. - 3. map like:
  1. ~ libqb(Y)
  2. ~ "direct"
  3. ~ libX(Y)  [a.k.a. interlib]
and where "X(Y)" denotes "X linked with linker Y":
  X(a) .. ld.bfd < 2.29
  X(b) .. ld.bfd = 2.29 (and only 2.29),
goes like this:

+=========+=========+=========+=========+=========+=========+=========+
#client(x)#        libqb(a) usage       #        libqb(b) usage       #
#   vvv   #---------+---------+---------+---------+---------+---------+
#    V    #  direct | libX(a) : libX(b) #  direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
#  x = a  #   OK    |   OK    : BAD[*2] # BAD[*1] | BAD[*D] : BAD[*3] #
#  x = b  # BAD[*A] | BAD[*B] : BAD[*C] # BAD[*1] | BAD[*C] : BAD[*3] #
+=========+=========+=========+=========+=========+=========+=========+

whereas if we swap 2.29 for 2.29.1, i.e., X(b) .. ld.bfd = 2.29.1, we
can observe a somewhat simpler story (DEP ~ "depends"):

+=========+=========+=========+=========+=========+=========+=========+
#client(x)#        libqb(a) usage       #        libqb(b) usage       #
#   vvv   #---------+---------+---------+---------+---------+---------+
#    V    #  direct | libX(a) : libX(b) #  direct | libX(a) : libX(b) #
+=========+=========+=========+=========+=========+=========+=========+
#  x = a  #   OK    |   OK    : DEP[*J] # BAD[*1] | BAD[*1] : BAD[*L] #
#  x = b  # DEP[*I] | DEP[*I] : DEP[*K] # BAD[*1] | BAD[*1] : BAD[*L] #
+=========+=========+=========+=========+=========+=========+=========+

* * *

[*1] client logging not working
[*2] interlib logging not working
[*3] both client and interlib logging not working

[*A] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
     which fails on 'implicit callsite section is populated' assertion
[*B] boils down to [*1], unless QB_LOG_INIT_DATA used on interlib side,
     which fails on 'implicit callsite section is populated' assertion
[*C] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
     which fails on 'implicit callsite section is populated' assertion
[*D] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side,
     which makes it boil down just to [*1] (hypothesis: mere internal
     self-reference to the section's boundary symbols makes them
     overcome some kind of symbol garbage collection at the linkage
     stage, so they are exposed even they wouldn't be otherwise as
     demonstrated with the initial, plain case of [*3])

[*I] boils down to [*1], unless QB_LOG_INIT_DATA used on client side,
     which makes it, likely through self-reference keepalive (see
     below) work OK
[*J] boils down to [*2], unless QB_LOG_INIT_DATA used on interlib side,
     which makes it, likely through self-reference keepalive (see
     below) work OK
[*K] boils down to [*3], unless QB_LOG_INIT_DATA used on both client
     and interlib side, which makes it, likely through self-reference
     keepalive (see below) work OK  (it's expected that this a mere
     composite of situations [*I] and [*J] with consequences as stated)
[*L] boils down to [*3], unless QB_LOG_INIT_DATA used on interlib side
     (sufficient?), which makes it, likely through self-reference
     keepalive (see below) boil down just to [*1]

* * *

Note: as observed with [*D] case (libqb linked with ld.bfd < 2.29
whereas interlib and its client linked with ld.bfd = 2.29), the exact
availability of a working logging doesn't depend solely on the linkers
in question, but generally (further investigation out of scope) the
conclusion is that when 2.29 ld.bfd is involved somewhere in the chain
of logging-related discrete compilation units, also (self-)referencing
of the section's boundary denoting symbols is a deciding factor whether
particular logging source will be honored.  This may be a result of
some internal linkage garbage collection mechanisms involved.
Anyway, it is supposed that the fix to broken-by-linkage logging can be
proclaimed complete once all combinations pass barring QB_LOG_INIT_DATA
usage (incurring the mentioned active referential use of the symbols),
along with a spin using it everywhere for good measure.

For another level of the analysis depth, one can further play with
combinations of -n{sc,cl,il} options (explained upon -h switch) to
log_test_mock.sh (taking an oracle, this is added mostly to justify
the upcoming self-check test change because linker-script-based
workaround for newer linkers will cause the section boundary symbols
to be present regardless if that section is utilized, leading to
a self-inflicted breakage due to these empty section symbols suddenly
winning in the symbol resolution mechanism).

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-12-12 20:46:02 +01:00
Jan Pokorný
524042d797
CI: travis: fix du -> df and capture it also directly from test 2016-12-16 15:48:10 +01:00
Jan Pokorný
602d04dacf
build: drop allegedly no longer intrusive syslog-tests opt-in switch
The intention behind enabling the syslog tests on demand (642f74d) was
to tread cautiously as libtool used to alert that something controversial
is going on:

$ ./autogen.sh && ./configure --enable-syslog-tests && make check
> ...
> *** Warning: Linking the executable log.test against the loadable module
> *** _syslog_override.so is not portable!
> ...

owing to the fact that _syslog_override.so is being linked (through
libtool) with LDFLAGS=-module.

In fact, the issue did go away with a fix to the "make install" process
(ebcff54) for which _syslog_override.so* files were being picked
undesirably prior to the fix, which manifested itself also on
"make rpm" (hence the respective commit message):

> RPM build errors:
>     Installed (but unpackaged) file(s) found:
>    /usr/lib64/_syslog_override.so
>    /usr/lib64/_syslog_override.so.0
>    /usr/lib64/_syslog_override.so.0.0.0

The explanation for the secondary positive effect on the mentioned
libtool's warning going away is rather simple:
"lib" prefix switches the expectations about the result as a library
(also due to "libdir" destination) rather than as an executable object.
Change like that ensures the result is what libtool's manual calls
"dynamic module that can be opened by lt_dlopen" rather than "runtime
library that cannot" in the context of Mac OS X, which was likely the
cause of the portability warning.
(https://www.gnu.org/software/libtool/manual/libtool.html#FOOT10)

And because the tests themselves are run through the libtool wrapper
scripts capable of relinking and other magic

What libtool manual has to say on this topic:
> Note that libtool modules don’t need to have a "lib" prefix. However,
> Automake 1.4 or higher is required to build such modules.
referring to version released 15+ years back, which is assumed anyway.
(https://www.gnu.org/software/libtool/manual/libtool.html#Modules-for-libltdl)

* * *

That being said, there's now no longer a reason to have "syslog-tests"
enablement conditionalized (no longer supposed intrusive), hence enable
them unconditionally along the other libcheck-based tests
-- whenever libcheck is detected.

This changeset also drops any trace of --enable-syslog-tests switch
in various places using that (spec file, Travis CI configuration)
making for a complete vaporizatio of this choice.
2016-12-12 12:18:37 +01:00
Jan Pokorný
f321df7498
CI: travis: fix dh -> du + add "lsblk -f" diagnostics 2016-11-28 15:14:27 +01:00
Jan Pokorný
e702848b0d
CI: make travis watch for the issue #234 2016-11-24 16:05:25 +01:00
Jan Pokorný
43efb5197c
CI: make travis use also clang compiler (for good measure)
Also, unify the indentation.
2016-05-05 16:20:13 +02:00
Jan Pokorný
8ab2799599
tests: ensure verbose output on failure w/ more recent automake
...so as to obtain a first glance diagnostics in all cases with possibly
remote build system preventing other means of investigation.
2016-04-28 21:56:05 +02:00
Jan Pokorný
e1bfb098be
CI: "make check" already included in "make distcheck"
No need to waste time on redundant tests execution.
2016-03-14 14:36:50 +01:00
Jan Pokorný
9c8814522d
CI: make sure RPM can be built all the time
This is to prevent issues like the one being fixed with ebcff54
(https://github.com/ClusterLabs/libqb/pull/197).

Also, plain "make" invocation is dropped as it is an integral part
of "make rpm" (%build phase in libqb.spec).
2016-03-09 15:34:26 +01:00
Christine Caulfield
f439488261 travis: Add a normal 'make' to the checks
make check doesn't build the docs and so errors in that part of
the build system will not be checked without a normal 'make'.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-02-22 16:02:25 +00:00
Jan Pokorný
7b10be7401
CI: restore travis notifications, IRC this time around
While quarterback [dash] devel [at] lists [dot] fedorahosted [dot] org,
original notification target and development ML seems long gone (without
archives preserved!), let's use #clusterlabs-dev at freenode IRC
network.  This is in-line with the purpose of the channel and it's what
clufter, crmsh and hawk seem to be currently using.
2016-02-18 12:06:28 +01:00
Jan Pokorný
fa73c21ae4
CI: enable recently added syslog-tests in .travis.yml 2016-02-18 11:32:55 +01:00
Jan Pokorný
0fc2757546
CI: .travis.yml cosmetics 2016-02-18 11:32:40 +01:00
Ken Gaillot
7cd90f11db release version 0.17.2
This revision switches libtool soname versioning from -version-number to
-version-info, and updates the travis configuration to use their newly
recommended infrastructure.
2015-08-18 09:14:51 -05:00
Angus Salkeld
bb37130aa6 Enable distcheck on the travis tests
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-14 09:38:25 +10:00
Angus Salkeld
407cac7a11 Remove doxygen from travis deps to try and get the job working.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-04-10 15:54:22 +10:00
Angus Salkeld
ffdc2d519a Deal with /dev/shm issue on Travis builders
https://github.com/travis-ci/travis-cookbooks/issues/155

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-13 09:24:12 +11:00
Angus Salkeld
8857544992 Add the mailing list to the travis email notifications.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 11:11:19 +10:00
Angus Salkeld
fef547a16e Add travis continuous integration config
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:11:16 +10:00