[Libguestfs] [PATCH [WIP] 0/3] tests: Define common test functions.

2017-02-19 Thread Richard W.M. Jones
There's a lot of common code in the tests, eg: if [ "$(guestfish get-backend)" = "uml" ]; then echo "$0: test skipped because UML backend does not support network" exit 77 fi These commits (work in progress) create a common set of test functions for skipping tests etc. Rich.

[Libguestfs] [PATCH [WIP] 1/3] tests: Rename test-data/test-utils.sh -> tests/test-functions.sh.

2017-02-19 Thread Richard W.M. Jones
This is pure code motion. --- Makefile.am| 1 + test-data/Makefile.am | 3 --- tests/qemu/qemu-liveness.sh| 2 +- tests/qemu/qemu-snapshot-isolation.sh | 2 +- test-data/test-utils.sh =>

[Libguestfs] [PATCH [WIP] 3/3] tests: Extend $TEST_FUNCTIONS with predefined functions for skipping tests etc.

2017-02-19 Thread Richard W.M. Jones
Apply this change across all the shell scripts containing tests. Additionally this defines the environment variables $abs_srcdir, $abs_builddir, $top_srcdir, $top_builddir, $abs_top_srcdir and $abs_top_builddir which can now be used throughout test scripts. --- docs/guestfs-hacking.pod

[Libguestfs] [PATCH [WIP] 2/3] tests: Add $TEST_FUNCTIONS.

2017-02-19 Thread Richard W.M. Jones
This macro(?) expands to some shell script to source the tests/test-functions.sh file from its correct location. The intention is to use this in all tests, but in this commit only the existing tests which already include test-functions.sh are modified. --- subdir-rules.mk |

[Libguestfs] [PATCH v3 7/7] yara_scan: added API tests

2017-02-19 Thread Matteo Cafasso
Signed-off-by: Matteo Cafasso --- configure.ac | 1 + tests/yara/Makefile.am | 26 tests/yara/test-yara-scan.sh | 72 3 files changed, 99 insertions(+) create mode 100644

[Libguestfs] [PATCH v3 2/7] appliance: add yara dependency

2017-02-19 Thread Matteo Cafasso
libyara3 on Debian/Ubuntu yara on SUSE/RedHat Signed-off-by: Matteo Cafasso --- appliance/packagelist.in | 4 daemon/Makefile.am | 3 ++- m4/guestfs_daemon.m4 | 14 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git

[Libguestfs] [PATCH v3 3/7] New API: yara_load

2017-02-19 Thread Matteo Cafasso
The yara_load API allows to load a set of Yara rules contained within a file on the host. Rules can be in binary format, as when compiled with yarac command, or in source code format. In the latter case, the rules will be first compiled and then loaded. Subsequent calls of the yara_load API will

[Libguestfs] [PATCH v3 6/7] New API: yara_scan

2017-02-19 Thread Matteo Cafasso
The yara_scan API parses the file generated by the daemon counterpart function and returns the list of yara_detection structs to the user. It writes the daemon's command output on a temporary file and parses it, deserialising the XDR formatted yara_detection structs. It returns to the caller the

[Libguestfs] [PATCH v3 1/7] daemon: expose file upload logic

2017-02-19 Thread Matteo Cafasso
Allows other modules to use the same logic for uploading files. Signed-off-by: Matteo Cafasso --- daemon/daemon.h | 3 +++ daemon/upload.c | 70 - 2 files changed, 42 insertions(+), 31 deletions(-) diff --git

[Libguestfs] [PATCH v3 5/7] New API: internal_yara_scan

2017-02-19 Thread Matteo Cafasso
The internal_yara_scan runs the Yara engine with the previously loaded rules against the given file. For each rule matching against the scanned file, a struct containing the file name and the rule identifier is returned. The gathered list of yara_detection structs is serialised into XDR format

[Libguestfs] [PATCH v3 4/7] New API: yara_destroy

2017-02-19 Thread Matteo Cafasso
The yara_destroy API allows to claim resources back via the removal of the previously loaded Yara rules. Signed-off-by: Matteo Cafasso --- daemon/yara.c| 14 ++ generator/actions.ml | 8 lib/MAX_PROC_NR | 2 +- 3 files changed, 23

[Libguestfs] [PATCH v3 0/7] Feature: Yara file scanning

2017-02-19 Thread Matteo Cafasso
Rebase patches on top of 1.35.25. No changes since last series. Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests

[Libguestfs] Fwd: nbdkit async

2017-02-19 Thread Richard W.M. Jones
- Forwarded message - Date: Sat, 18 Feb 2017 22:21:19 -0500 Subject: nbdkit async Hello, Hope this is the right person to contact regarding nbdkit design. I have a high latency massively parallel device that I am currently implementing as an nbdkit plugin in c++ and have run into some