MINOR: debug: add CLI command "debug dev write" to write an arbitrary size
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Mar 2020 16:16:24 +0000 (17:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Mar 2020 16:20:15 +0000 (17:20 +0100)
commit6cbe62b8580f982f09be4cdd6f693dc159978fb3
tree55c1f5b2bb082f4530f45592d6aad46ed0de0d8a
parentd04a2a665496a6ebd831118337f182badb28ddcf
MINOR: debug: add CLI command "debug dev write" to write an arbitrary size

This command is used to produce an arbitrary amount of data on the
output. It can be used to test the CLI's state machine as well as
the internal parts related to applets an I/O. A typical test consists
in asking for all sizes from 0 to 16384:

  $ (echo "prompt;expert-mode on";for i in {0..16384}; do
     echo "debug dev write $i"; done) | socat - /tmp/sock1 | wc -c
  134258738

A better test would consist in first waiting for the response before
sending a new request.

This command is not restricted to the admin since it's harmless.
src/debug.c