Re: [libvirt] [PATCH 1/7] util: purge all code for testing OOM handling

2019-09-02 Thread Ján Tomko

On Thu, Aug 29, 2019 at 07:02:44PM +0100, Daniel P. Berrangé wrote:

The OOM handling requires special build time options which we never
enable in our CI. Even once enabled the tests are incredibly slow and
typically require manual inspection of the results to weed out false
positives.

Since there was previous agreement to switch to abort on OOM in libvirt
code, there's no point continuing to keep the unused OOM testing code.

Signed-off-by: Daniel P. Berrangé 
---
configure.ac  |  17 ---
docs/docs.html.in |   3 -
docs/internals/oomtesting.html.in | 213 --
src/libvirt_private.syms  |   4 -
src/util/viralloc.c   | 111 
src/util/viralloc.h   |   5 -
tests/Makefile.am |   1 -
tests/oomtrace.pl |  41 --
tests/qemuxml2argvtest.c  |  12 +-
tests/testutils.c | 189 +-
tests/testutils.h |   2 -
tests/virfirewalltest.c   |  12 --
12 files changed, 6 insertions(+), 604 deletions(-)
delete mode 100644 docs/internals/oomtesting.html.in
delete mode 100755 tests/oomtrace.pl



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 1/7] util: purge all code for testing OOM handling

2019-08-29 Thread Daniel P . Berrangé
The OOM handling requires special build time options which we never
enable in our CI. Even once enabled the tests are incredibly slow and
typically require manual inspection of the results to weed out false
positives.

Since there was previous agreement to switch to abort on OOM in libvirt
code, there's no point continuing to keep the unused OOM testing code.

Signed-off-by: Daniel P. Berrangé 
---
 configure.ac  |  17 ---
 docs/docs.html.in |   3 -
 docs/internals/oomtesting.html.in | 213 --
 src/libvirt_private.syms  |   4 -
 src/util/viralloc.c   | 111 
 src/util/viralloc.h   |   5 -
 tests/Makefile.am |   1 -
 tests/oomtrace.pl |  41 --
 tests/qemuxml2argvtest.c  |  12 +-
 tests/testutils.c | 189 +-
 tests/testutils.h |   2 -
 tests/virfirewalltest.c   |  12 --
 12 files changed, 6 insertions(+), 604 deletions(-)
 delete mode 100644 docs/internals/oomtesting.html.in
 delete mode 100755 tests/oomtrace.pl

diff --git a/configure.ac b/configure.ac
index 7c76a9c9ec..36e75ac3c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -766,22 +766,6 @@ if test "$enable_test_coverage" = yes; then
   WARN_CFLAGS=$save_WARN_CFLAGS
 fi
 
-LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no])
-case "$enable_test_oom" in
-  yes|no) ;;
-  *) AC_MSG_ERROR([bad value ${enable_test_oom} for test-oom option]) ;;
-esac
-
-if test "$enable_test_oom" = yes; then
-  have_trace=yes
-  AC_CHECK_HEADER([execinfo.h],[],[have_trace=no])
-  AC_CHECK_FUNC([backtrace],[],[have_trace=no])
-  if test "$have_trace" = "yes"; then
-AC_DEFINE([TEST_OOM_TRACE], 1, [Whether backtrace() is available])
-  fi
-  AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled])
-fi
-
 LIBVIRT_ARG_ENABLE([TEST_LOCKING], [thread locking tests using CIL], [no])
 case "$enable_test_locking" in
   yes|no) ;;
@@ -1052,7 +1036,6 @@ AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Test suite])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([ Coverage: $enable_test_coverage])
-AC_MSG_NOTICE([Alloc OOM: $enable_test_oom])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Miscellaneous])
 AC_MSG_NOTICE([])
diff --git a/docs/docs.html.in b/docs/docs.html.in
index ba9514279a..c1741c89b4 100644
--- a/docs/docs.html.in
+++ b/docs/docs.html.in
@@ -155,9 +155,6 @@
 Lock managers
 Use lock managers to protect disk content
 
-Out of memory testing
-Simulating OOM conditions in the test suite
-
 Functional testing
 Testing libvirt with TCK test suite and
  Libvirt-test-API
diff --git a/docs/internals/oomtesting.html.in 
b/docs/internals/oomtesting.html.in
deleted file mode 100644
index 72d0f2c6ff..00
--- a/docs/internals/oomtesting.html.in
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-http://www.w3.org/1999/xhtml;>
-  
-Out of memory testing
-
-
-
-
-
-  This page describes how to use the test suite todo out of memory
-  testing.
-
-
-Building with OOM testing
-
-
-  Since OOM testing requires hooking into the malloc APIs, it is
-  not enabled by default. The flag --enable-test-oom
-  must be given to configure. When this is done the
-  libvirt allocation APIs will have some hooks enabled.
-
-
-
-$ ./configure --enable-test-oom
-
-
-
-Basic OOM testing support
-
-
-  The first step in validating OOM usage is to run a test suite
-  with full OOM testing enabled. This is done by setting the
-  VIR_TEST_OOM=1 environment variable. The way this
-  works is that it runs the test once normally to "prime" any
-  static memory allocations. Then it runs it once more counting
-  the total number of memory allocations. Then it runs it in a
-  loop failing a different memory allocation each time. For every
-  memory allocation failure triggered, it expects the test case
-  to return an error. OOM testing is quite slow requiring each
-  test case to be executed O(n) times, where 'n' is the total
-  number of memory allocations. This results in a total number
-  of memory allocations of '(n * (n + 1) ) / 2'
-
-
-
-$ VIR_TEST_OOM=1 ./qemuxml2argvtest
- 1) QEMU XML-2-ARGV minimal   ... OK
-Test OOM for nalloc=42 .. OK
- 2) QEMU XML-2-ARGV minimal-s390  ... OK
-Test OOM for nalloc=28  OK
- 3) QEMU XML-2-ARGV machine-aliases1  ... OK
-Test OOM for nalloc=38 .. OK
- 4) QEMU XML-2-ARGV machine-aliases2  ... OK
-Test OOM for nalloc=38 .. OK
- 5) QEMU XML-2-ARGV machine-core-on   ...