diff options
-rwxr-xr-x | lib/zephyr_tests.py | 2 | ||||
-rw-r--r-- | lib/zephyr_tests.txt | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py index 5855238..e44652e 100755 --- a/lib/zephyr_tests.py +++ b/lib/zephyr_tests.py @@ -340,6 +340,8 @@ class libZephyr(object): "ZMakeAscii", "ZMakeZcode", "ZGetDestAddr", + "ZSetFD", + "ZPending", ] def __init__(self, library_path=None): """connect to the library and build the wrappers""" diff --git a/lib/zephyr_tests.txt b/lib/zephyr_tests.txt index e54a1e9..d7679fa 100644 --- a/lib/zephyr_tests.txt +++ b/lib/zephyr_tests.txt @@ -241,6 +241,29 @@ Same thing with ZMakeZcode, a compact binary format that is still NUL-terminated >>> assert outbuf.value == ref, "%r != %r" % (outbuf.value, ref) +Queued Packet Tests +=================== + +Eventually we'll want tests that install a realm (or several) and +actually send and receive packets against them, so-called "system +tests". In the meantime, a faster and more local test that +synthesizes packets and feeds them through the queuing mechanism will +get us some more coverage. + + >>> read_end, write_end = os.pipe() + >>> assert _z.ZSetFD(read_end) == 0 + >>> assert _z.ZPending() == 0 + +TODO: cook up test-specific notices, but for now we've got some lying +around from above... + + >>> zwhole = string_at(zbuf, size=zbuflen) + >>> wrote = os.write(write_end, zwhole) + >>> assert wrote == zbuflen.value, "%s != %s" % (wrote, zbuflen.value) + >>> zcount = _z.ZPending() + +zcount ends up being -1, because recvfrom gives 'Socket operation on +non-socket' (ENOTSOCK). Instead we need to actually create a local socket... Coverage: |