Re: [libvirt] [PATCH 5/7] Add virCommandSetMockOutputFile

2014-03-13 Thread Daniel P. Berrange
On Wed, Mar 12, 2014 at 04:33:22PM +0100, Ján Tomko wrote: On 03/12/2014 03:26 PM, Daniel P. Berrange wrote: On Wed, Mar 12, 2014 at 02:08:15PM +0100, Ján Tomko wrote: After this file is set, all commands executed will be replaced by cat file. I think this is a bit too special case and

[libvirt] [PATCH 5/7] Add virCommandSetMockOutputFile

2014-03-12 Thread Ján Tomko
After this file is set, all commands executed will be replaced by cat file. This is useful for testing functions that parse output of asynchronous commands. --- src/libvirt_private.syms | 1 + src/util/vircommand.c | 33 + src/util/vircommandpriv.h | 1 + 3

Re: [libvirt] [PATCH 5/7] Add virCommandSetMockOutputFile

2014-03-12 Thread Daniel P. Berrange
On Wed, Mar 12, 2014 at 02:08:15PM +0100, Ján Tomko wrote: After this file is set, all commands executed will be replaced by cat file. I think this is a bit too special case and unecessarily forces use of an external cat command. I think your test would be easier if using this callback approach

Re: [libvirt] [PATCH 5/7] Add virCommandSetMockOutputFile

2014-03-12 Thread Ján Tomko
On 03/12/2014 03:26 PM, Daniel P. Berrange wrote: On Wed, Mar 12, 2014 at 02:08:15PM +0100, Ján Tomko wrote: After this file is set, all commands executed will be replaced by cat file. I think this is a bit too special case and unecessarily forces use of an external cat command. I think