summaryrefslogtreecommitdiffhomepage
path: root/test/fuse/README.md
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-08-14 09:54:35 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-16 12:19:30 -0700
commita289c3862653cded271408b31a9e704be615503a (patch)
tree6a8e93dd076ecd1ac59bdbb621ae310c27b114bf /test/fuse/README.md
parent15ff2893d9bf896cc33e880983cb800cd71c946b (diff)
Add functions in FUSE integration test to get metrics from FUSE server
This commit adds 3 utility functions to ensure all received requests and preset responses are consumed. 1. Get number of unconsumed requests (received by the FUSE server but not consumed by the testing thread). 2. Get number of unsent responses (set by the testing thread but not processed by the FUSE server). 3. Get total bytes of the received requests (to ensure some operations don't trigger FUSE requests). Fixes #3607
Diffstat (limited to 'test/fuse/README.md')
-rw-r--r--test/fuse/README.md27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/fuse/README.md b/test/fuse/README.md
index c5909a166..7a1839714 100644
--- a/test/fuse/README.md
+++ b/test/fuse/README.md
@@ -86,6 +86,20 @@ complete a command and when the server awaits the next instruction.
| =[Test actual request] |
| |
| >TearDown() |
+ | ... |
+ | >GetServerNumUnsentResponses() |
+ | [write data to socket] |
+ | [wait server complete] |
+ | | [socket event arrive]
+ | | >ServerHandleCommand()
+ | | >ServerSendData()
+ | | [write data to socket]
+ | | <ServerSendData()
+ | | =ServerCompleteWith()
+ | [read data from socket] |
+ | [test if all succeeded] |
+ | <GetServerNumUnsentResponses() |
+ | | <ServerHandleCommand()
| =UnmountFuse() |
| <TearDown() |
| <TEST_F() |
@@ -164,11 +178,10 @@ To add a new `FuseTestCmd`, one must comply with following format:
many bytes you want to send along with the command and what you will expect
to receive. Finally it should block and wait for a success indicator from
the FUSE server.
-3. Add a `ServerReceiveXXX()` or `ServerSendXXX()` private function in
- `FuseTest`. It is mandatory to set it private since only the FUSE server
- (forked from `FuseTest` base class) can call it. This is the handler of a
- specific `FuseTestCmd` and the format of the data should be consistent with
- what client expects in the previous step.
-4. Add a case in the switch condition of `ServerHandleCommand()` to route the
- command to the server handler described in the previous step.
+3. Add a handler logic in the switch condition of `ServerHandleCommand()`. Use
+ `ServerSendData()` or declare a new private function such as
+ `ServerReceiveXXX()` or `ServerSendXXX()`. It is mandatory to set it private
+ since only the FUSE server (forked from `FuseTest` base class) can call it.
+ This is the server part of the specific `FuseTestCmd` and the format of the
+ data should be consistent with what the client expects in the previous step.