Re: [PATCH v5 15/20] tests: Extend command test to transfer large data to process on multiple fds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 12, 2019 at 12:23:49PM -0400, Stefan Berger wrote:
> Add a test case to commandtest.c to test the transfer of data to a
> process who received the read-end of pipes' file descriptors. Transfer
> large (128 kb) byte streams.
> 
> Extend the commandhelper.c with support for --readfd <fd> command line
> parameter and convert the data receive loop to use poll and receive data
> on multiple file descriptors (up to 3) and read data into distinct buffers
> that we grow while adding more (string) data.
> 
> Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxx>
> ---
>  tests/commandhelper.c |  70 +++++++++++++++++++++++---
>  tests/commandtest.c   | 113 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 177 insertions(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


> @@ -62,13 +63,27 @@ int main(int argc, char **argv) {
>      char *cwd;
>      FILE *log = fopen(abs_builddir "/commandhelper.log", "w");
>      int ret = EXIT_FAILURE;
> +    int readfds[3] = { STDIN_FILENO, };
> +    int numreadfds = 1;
> +    struct pollfd fds[3];
> +    int numpollfds = 0;

s/int/size_t/ for array sizes

> +    char *buffers[3] = {NULL, NULL, NULL};
> +    size_t buflen[3] = {0, 0, 0};
> +    char c;


Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux