Mailing List Archive

[PATCH v1 0/5] tools/ocaml/xenstored: structured fuzz testing
Test that live update functionality works correctly by writing a
Quickcheck-style property test that asserts that oxenstored state
is the same whether the live-update command was run or not.

Crowbar is used for supplying random numbers to quickcheck,
which optionally works with AFL as a driver, but can also be used
without external dependencies.

This is also called structured fuzz testing, because we don't fuzz
the xenstore commands or state directly, but generate some valid looking
trees and commands based on fuzzing the parameters of these commands.

Inspired by the 'qcstm' package and presentation at ICFP 2020,
but using 'crowbar' instead, due to its integration with AFL.

This is a work in progress, transaction live updates do not work yet,
and should be split out from this series.

For convenience here is a series with all patches applied,
review welcome either there or on the mailing list:
https://github.com/edwintorok/xen/pull/1

This series hasn't been reviewed yet, but has been in development during
the XSA series.
It (and myself) kept finding new XSAs and bugs to fix, which left the test itself in
an unfinished state, it is possible to improve it to find more bugs.

Edwin Török (5):
tools/ocaml: add unit test skeleton with Dune build system
tools/ocaml/xenstored: implement the live migration binary format
tools/ocaml/xenstored: add binary dump format support
tools/ocaml/xenstored: add support for binary format
Add structured fuzzing unit test

tools/ocaml/.gitignore | 2 +
tools/ocaml/Makefile | 52 ++
tools/ocaml/dune-project | 5 +
tools/ocaml/libs/eventchn/dune | 8 +
tools/ocaml/libs/mmap/dune | 8 +
tools/ocaml/libs/xb/dune | 7 +
tools/ocaml/libs/xc/dune | 9 +
tools/ocaml/libs/xs/dune | 4 +
tools/ocaml/xen.opam | 0
tools/ocaml/xenstore.opam | 0
tools/ocaml/xenstored.opam | 18 +
tools/ocaml/xenstored/Makefile | 3 +-
tools/ocaml/xenstored/connection.ml | 63 +-
tools/ocaml/xenstored/disk.ml | 318 ++++++++
tools/ocaml/xenstored/dune | 19 +
tools/ocaml/xenstored/parse_arg.ml | 2 +-
tools/ocaml/xenstored/perms.ml | 2 +
tools/ocaml/xenstored/poll.ml | 3 +-
tools/ocaml/xenstored/process.ml | 12 +-
tools/ocaml/xenstored/store.ml | 1 +
tools/ocaml/xenstored/test/dune | 11 +
tools/ocaml/xenstored/test/generator.ml | 189 +++++
tools/ocaml/xenstored/test/model.ml | 253 ++++++
tools/ocaml/xenstored/test/old/arbitrary.ml | 261 +++++++
tools/ocaml/xenstored/test/old/gen_paths.ml | 66 ++
.../xenstored/test/old/xenstored_test.ml | 527 +++++++++++++
tools/ocaml/xenstored/test/pathtree.ml | 40 +
tools/ocaml/xenstored/test/testable.ml | 364 +++++++++
tools/ocaml/xenstored/test/types.ml | 427 ++++++++++
tools/ocaml/xenstored/test/xenctrl.ml | 48 ++
tools/ocaml/xenstored/test/xeneventchn.ml | 50 ++
tools/ocaml/xenstored/test/xenstored_test.ml | 147 ++++
tools/ocaml/xenstored/test/xs_protocol.ml | 733 ++++++++++++++++++
tools/ocaml/xenstored/transaction.ml | 119 ++-
tools/ocaml/xenstored/xenstored.ml | 205 ++++-
35 files changed, 3918 insertions(+), 58 deletions(-)
create mode 100644 tools/ocaml/.gitignore
create mode 100644 tools/ocaml/dune-project
create mode 100644 tools/ocaml/libs/eventchn/dune
create mode 100644 tools/ocaml/libs/mmap/dune
create mode 100644 tools/ocaml/libs/xb/dune
create mode 100644 tools/ocaml/libs/xc/dune
create mode 100644 tools/ocaml/libs/xs/dune
create mode 100644 tools/ocaml/xen.opam
create mode 100644 tools/ocaml/xenstore.opam
create mode 100644 tools/ocaml/xenstored.opam
create mode 100644 tools/ocaml/xenstored/dune
create mode 100644 tools/ocaml/xenstored/test/dune
create mode 100644 tools/ocaml/xenstored/test/generator.ml
create mode 100644 tools/ocaml/xenstored/test/model.ml
create mode 100644 tools/ocaml/xenstored/test/old/arbitrary.ml
create mode 100644 tools/ocaml/xenstored/test/old/gen_paths.ml
create mode 100644 tools/ocaml/xenstored/test/old/xenstored_test.ml
create mode 100644 tools/ocaml/xenstored/test/pathtree.ml
create mode 100644 tools/ocaml/xenstored/test/testable.ml
create mode 100644 tools/ocaml/xenstored/test/types.ml
create mode 100644 tools/ocaml/xenstored/test/xenctrl.ml
create mode 100644 tools/ocaml/xenstored/test/xeneventchn.ml
create mode 100644 tools/ocaml/xenstored/test/xenstored_test.ml
create mode 100644 tools/ocaml/xenstored/test/xs_protocol.ml

--
2.29.2