GNOME Bugzilla – Bug 743871
validate: Provide a way to test failing socket operations.
Last modified: 2015-02-03 14:35:14 UTC
This implements a fault injection library, and an action to corrupt recv, by modifying errno to the desired error.
Created attachment 295960 [details] [review] validate: Implement a fault injection library.
Created attachment 295961 [details] [review] scenario: implement an action to corrupt socket recv. Example of new action: corrupt-socket-recv, playback-time=3.0, port=8000, errno=ECONNRESET, times=42
Review of attachment 295960 [details] [review]: ::: validate/configure.ac @@ +64,3 @@ +dnl Tiny library overriding calls such as socket recv / send +FAULTINJECTION_LIBS="-L$(top_srcdir)/fault_injection/.libs/ -lfaultinjection-$GST_API_VERSION" That does not look right (ie. specifiing .libs) ::: validate/gst/validate/Makefile.am @@ +47,3 @@ lib_LTLIBRARIES = libgstvalidate-@GST_API_VERSION@.la +libgstvalidate_@GST_API_VERSION@_la_CFLAGS = $(GST_ALL_CFLAGS)\ + $(GIO_CFLAGS) $(GST_PBUTILS_CFLAGS) -I$(top_srcdir)/fault_injection I do not understand why you link Validate against that lib here?
Created attachment 295978 [details] [review] validate: Implement a fault injection library.
(In reply to comment #3) > Review of attachment 295960 [details] [review]: > > ::: validate/configure.ac > @@ +64,3 @@ > > +dnl Tiny library overriding calls such as socket recv / send > +FAULTINJECTION_LIBS="-L$(top_srcdir)/fault_injection/.libs/ > -lfaultinjection-$GST_API_VERSION" > > That does not look right (ie. specifiing .libs) Indeed, and it's not needed > > ::: validate/gst/validate/Makefile.am > @@ +47,3 @@ > lib_LTLIBRARIES = libgstvalidate-@GST_API_VERSION@.la > +libgstvalidate_@GST_API_VERSION@_la_CFLAGS = $(GST_ALL_CFLAGS)\ > + $(GIO_CFLAGS) $(GST_PBUTILS_CFLAGS) -I$(top_srcdir)/fault_injection > > I do not understand why you link Validate against that lib here? As discussed on IRC, this is needed to implement the action. Furthermore, one can't register validate actions in a GstPlugin, as at the first inspection without the validate library being loaded the plugin will get blacklisted. We should rework this when we have a happy conclusion with https://bugzilla.gnome.org/show_bug.cgi?id=741260 in my opinion. Resubmitted the patch with the ".libs" correction.
Furthermore, one can't register validate actions in a GstPlugin's *init function*.
(In reply to comment #6) > Furthermore, one can't register validate actions in a GstPlugin's *init > function*. Why not ?
Created attachment 296023 [details] [review] validate: Implement a fault injection library. + And implement a corrupt-socket-recv action + Only compile this on Linux, LD_PRELOAD won't work on Windows. For now the registering of the action is done through a call to socket_interposer_init, this will get better when we refactor the action logic.
Review of attachment 296023 [details] [review]: Fix that small issue and go ahead :) ::: validate/gst/validate/gst-validate-scenario.c @@ +48,3 @@ +#include <socket_interposer.h> + +#include <netinet/in.h> You should not include it here anymore
commit 4ce91b98f015993583e1c7f1c7190afac8cb5258 Author: Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> Date: Fri Jan 30 18:52:57 2015 +0100 validate: Implement a fault injection library. + And implement a corrupt-socket-recv action + Only compile this on Linux, LD_PRELOAD won't work on Windows. For now the registering of the action is done through a call to socket_interposer_init, this will get better when we refactor the action logic. https://bugzilla.gnome.org/show_bug.cgi?id=743871 Done :)
Review of attachment 295961 [details] [review]: reworked
Review of attachment 296023 [details] [review]: commited with that change :)