-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
tests: Run IPC with use-filesystem-sockets active #455
tests: Run IPC with use-filesystem-sockets active #455
Conversation
82996cd
to
bca3a15
Compare
4d32ad0
to
32cfc77
Compare
retest this please |
1 similar comment
retest this please |
tests/libstat_wrapper.c
Outdated
static int (*real_xstat)(int __ver, const char *__filename, void *__stat_buf); | ||
|
||
if (!opened) { | ||
dlhandle = dlopen(LIBC_SO, RTLD_NOW); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had been doing that in the past with dlopen_fatal(RTLD_NEXT, ...) at least in the assumption it would then get me the symbol coming next in the search order instead of directly jumping to libc.
And instead of keeping the handle in a static variable (when using an explicit library - with RTLD_NEXT there shouldn't be a need) I closed it after getting the symbols I needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sry for the above - that is of course dlsym_fatal.
And that again is just my wrapper for dlsym exiting out if it doesn't find the symbol.
The comment in parentheses already points to something being fishy here ;-)
opened = 1; | ||
} | ||
|
||
if (strcmp(__filename, FORCESOCKETSFILE) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__xstat seems to return -1 with errno==EFAULT in case the filename points to invalid memory instead of segfaulting.
Don't know if we need it that generic here but we might get called by unexpected callers and get confusing results.
Simple approach might be doing the original in any case and just compare and possibly fake result if return -1 and errno!=EFAULT.
13348e8
to
27094cc
Compare
That last force push was just a rebase to fix a covscan error in CI |
Build finished. |
tests/ipc_sock.test
Outdated
# so we can test both options without breaking other things | ||
# that might be running on this system | ||
# | ||
if [ "`uname -s`" = "Linux" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment here, also spotted below in other test scripts. It´s best to avoid the command..
format and use instead "$(command..)". When using `` the command is forked in another shell that resets the envvar to default. This could cause unexpected behavior. Similar for pwd
etc. forking also uses more resources. With $(cmd) the command is executed within the same shell.
Provide an LD_PRELOAD library that simulates the presence of /etc/libqb/use-filesystem-sockets so that we can test that functionality without actually having the file on the system and affecting everything else running on the box.
F35 and Centos9 seem to have reverted back to an actual stat() call rather than a wrapper around __xstat(), so trap both just in case. Other small fixes
b77f1ae
to
bcb1103
Compare
bcb1103
to
8812662
Compare
tests/ipc_sock.test
Outdated
then | ||
if [ -f $(pwd)/.libs/libstat_wrapper.so ] | ||
then | ||
export LD_PRELOAD=$(pwd)/.libs/libstat_wrapper.so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to have:
export LD_PRELOAD="$(pwd)/.libs/libstat_wrapper.so" in case pwd contains spaces... it doesn´t happen in CI or any sane systems.. but it can happen :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too
configure.ac
Outdated
@@ -176,7 +176,7 @@ PKG_CHECK_MODULES([libxml], [libxml-2.0]) | |||
# don´t build the man pages | |||
if test "x$cross_compiling" = "xno"; then | |||
AM_CONDITIONAL([BUILD_MAN], [true]) | |||
DOXYGEN2MAN="\$(abs_builddir)/../doxygen2man/doxygen2man" | |||
DOXYGEN2MAN="\"\$(abs_builddir)/../doxygen2man/doxygen2man\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future-proofing it would be better to leave this alone and quote $(DOXYGEN2MAN) in docs/Makefile.am, otherwise if someone ever uses "$DOXYGEN2MAN" it will fail in a confusing way
retest this please |
(re-opening PR 380 that got lost in the Great Git Transition of 2021)
Provide an LD_PRELOAD library that simulates the presence
of /etc/libqb/use-filesystem-sockets so that we can test
that functionality without actually having the file on
the system and affecting everything else running on the
box.