Skip to content

Commit

Permalink
Test libnxz behavior when out of credits
Browse files Browse the repository at this point in the history
libnxz behavior upon lack of credits changes depending on the mode being
used (AUTO, NX, SW, etc). The new test test_exhaust_credits checks that
it behaves as expected for each case.

Before starting the test, it creates several child processes to consume
all credits on the system. For this reason, it can cause failures if
other tests are run in parallel with it. So a secondary test suite was
implemented under serial-tests, that forces all tests to run serially.
This should be only be added to this test suite when strictly necessary,
like in this case.

Signed-off-by: Matheus Castanho <msc@linux.ibm.com>
  • Loading branch information
mscastanho committed Jun 6, 2022
1 parent ce4086e commit 932acec
Show file tree
Hide file tree
Showing 10 changed files with 1,483 additions and 39 deletions.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,8 @@ ac_config_files="$ac_config_files samples/Makefile"

ac_config_files="$ac_config_files test/Makefile"

ac_config_files="$ac_config_files test/serial-tests/Makefile"


ac_config_headers="$ac_config_headers config.h"

Expand Down Expand Up @@ -18220,6 +18222,7 @@ do
"oct/Makefile") CONFIG_FILES="$CONFIG_FILES oct/Makefile" ;;
"samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;;
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
"test/serial-tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/serial-tests/Makefile" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ AC_CONFIG_FILES([oct/config.sh])
AC_CONFIG_FILES([oct/Makefile])
AC_CONFIG_FILES([samples/Makefile])
AC_CONFIG_FILES([test/Makefile])
AC_CONFIG_FILES([test/serial-tests/Makefile])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10 no-define foreign subdir-objects])
Expand Down
3 changes: 3 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ AM_COLOR_TESTS=always
AM_CFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/inc_nx
LDADD = ../lib/libnxz.la $(PTHREAD_LIBS) -ldl

# The . forces tests in the current directory to run first
SUBDIRS = . serial-tests

test_scripts = test_abi

test_exe = test_adler32 \
Expand Down
196 changes: 157 additions & 39 deletions test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,27 @@ DIST_SOURCES = $(test_adler32_SOURCES) $(test_buf_error_SOURCES) \
$(test_inflate_SOURCES) $(test_inflatesyncpoint_SOURCES) \
$(test_multithread_stress_SOURCES) $(test_pid_reuse_SOURCES) \
$(test_stress_SOURCES) $(test_zeroinput_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
check recheck distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
Expand Down Expand Up @@ -444,7 +460,6 @@ am__set_TESTS_bases = \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
am__EXEEXT_4 = test_stress.auto test_deflate.auto test_inflate.auto \
test_dict.auto test_gz.auto
am__EXEEXT_5 = test_stress.sw test_deflate.sw test_inflate.sw \
Expand Down Expand Up @@ -475,9 +490,35 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
$(top_srcdir)/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
Expand Down Expand Up @@ -630,6 +671,9 @@ top_srcdir = @top_srcdir@
AM_COLOR_TESTS = always
AM_CFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/inc_nx
LDADD = ../lib/libnxz.la $(PTHREAD_LIBS) -ldl

# The . forces tests in the current directory to run first
SUBDIRS = . serial-tests
test_scripts = test_abi
test_exe = test_adler32 \
test_buf_error \
Expand Down Expand Up @@ -667,7 +711,7 @@ test_gz_SOURCES = test_gz.c test_utils.c
ABIDW_FLAGS = --no-corpus-path --drop-undefined-syms --drop-private-types \
--no-comp-dir-path --no-show-locs --type-id-style hash

all: all-am
all: all-recursive

.SUFFIXES:
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
Expand Down Expand Up @@ -748,7 +792,7 @@ test_dict$(EXEEXT): $(test_dict_OBJECTS) $(test_dict_DEPENDENCIES) $(EXTRA_test_
@rm -f test_dict$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_dict_OBJECTS) $(test_dict_LDADD) $(LIBS)

test_gz$(EXEEXT): $(test_gz_OBJECTS) $(test_gz_DEPENDENCIES) $(EXTRA_test_gz_DEPENDENCIES)
test_gz$(EXEEXT): $(test_gz_OBJECTS) $(test_gz_DEPENDENCIES) $(EXTRA_test_gz_DEPENDENCIES)
@rm -f test_gz$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_gz_OBJECTS) $(test_gz_LDADD) $(LIBS)
inflate/$(am__dirstamp):
Expand Down Expand Up @@ -849,14 +893,61 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"

ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
tags: tags-recursive
TAGS: tags

tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
Expand All @@ -869,7 +960,7 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$$unique; \
fi; \
fi
ctags: ctags-am
ctags: ctags-recursive

CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
Expand All @@ -882,7 +973,7 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist: cscopelist-recursive

cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
Expand Down Expand Up @@ -1321,21 +1412,47 @@ distdir-am: $(DISTFILES)
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
check: check-recursive
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
Expand Down Expand Up @@ -1364,12 +1481,12 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean: clean-recursive

clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
mostlyclean-am

distclean: distclean-am
distclean: distclean-recursive
-rm -f ./$(DEPDIR)/test_adler32.Po
-rm -f ./$(DEPDIR)/test_buf_error.Po
-rm -f ./$(DEPDIR)/test_crc32.Po
Expand All @@ -1394,47 +1511,47 @@ distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags

dvi: dvi-am
dvi: dvi-recursive

dvi-am:

html: html-am
html: html-recursive

html-am:

info: info-am
info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-am
install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-am
install-html: install-html-recursive

install-html-am:

install-info: install-info-am
install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-am
install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-am
install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/test_adler32.Po
-rm -f ./$(DEPDIR)/test_buf_error.Po
-rm -f ./$(DEPDIR)/test_crc32.Po
Expand All @@ -1458,33 +1575,34 @@ maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am
mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool

pdf: pdf-am
pdf: pdf-recursive

pdf-am:

ps: ps-am
ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: check-am install-am install-strip

.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
clean-local cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
.MAKE: $(am__recursive_targets) check-am install-am install-strip

.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--depfiles check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool clean-local \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am recheck tags tags-am uninstall \
Expand Down
Loading

0 comments on commit 932acec

Please sign in to comment.