search for: from_bytes

Displaying 2 results from an estimated 2 matches for "from_bytes".

Did you mean: free_bytes
2019 Sep 28
0
[PATCH nbdkit v2 4/4] info: Add tests for time, uptime and conntime modes.
...fn rm -f $files + +# Run nbdkit. +start_nbdkit -P info-conntime.pid -U $sock info mode=conntime + +export sock +nbdsh -c - <<'EOF' +import os +import time + +h.connect_unix (os.environ["sock"]) + +size = h.get_size () +assert size == 12 + +buf = h.pread (size, 0) +secs = int.from_bytes (buf[0:8], byteorder='big') +usecs = int.from_bytes (buf[8:12], byteorder='big') +print ("%d, %d" % (secs, usecs)) + +assert abs (secs) <= 60 +EOF diff --git a/tests/test-info-time.sh b/tests/test-info-time.sh new file mode 100755 index 0000000..c3e82e8 --- /dev/null ++...
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361 v2: - Adds a patch to rename the reflection plugin to the info plugin. - Adds tests. Rich.