82816d2fd2804c7ccbdf88e0ecadf35b19cbc564 |
|
27-Oct-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: add a mock Add the MockCommandProcessor class, so that we can test how upper layers of wifilogd interact with the CommandProcessor. Along the way: - make CommandProcessor::ProcessCommand() a virtual method - make the CommandProcessor dtor virtual While there: fix some typos in TODOs. Bug: 32779626 Test: ./runtests.sh (on angler) Change-Id: I12d9560ed3a1bcd6bc90ffe444dc3ac6a473328e
/system/connectivity/wifilogd/command_processor.cpp
|
188f047fb8375c7ee9258172301a1bea0436fbf7 |
|
11-Nov-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: add setters for TimestampHeader - Add setters for the fields of TimestampHeader, so that we can use chaining to initialize a TimestampHeader. - Update CommandProcessor, to make use of this ability. - Move TimestampHeader out of command_processor.h, to reduce clutter in the header file. Bug: 32327379 Test: ./runtests.sh (on angler) Change-Id: I3ffb29d47160d533947012d9ede1cadd4d954935
/system/connectivity/wifilogd/command_processor.cpp
|
937164df3f181a273589ed0c12dcc3729bbd1d6d |
|
21-Oct-2016 |
mukesh agrawal <quiche@google.com> |
ByteBuffer: allow chaining of AppendOrDie() In some of our calling contexts, it would be more convenient to initialize a const ByteBuffer in a single expression. To that end: - Update ByteBuffer, to allow chaining of calls to AppendOrDie(). - Updating existing uses of ByteBuffer, to make use of this new capability (where appropriate). Bug: 32317095 Test: ./runtests.sh (on angler) Change-Id: I39585b204ee6cc112ebe233670be8a9ab30d584b
/system/connectivity/wifilogd/command_processor.cpp
|
b0f1f44fefbec18581aabf3289d3018fbf2214a3 |
|
21-Oct-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: ProcessInput(): improve opcode handling At present, unrecognized opcodes are silently ignored. That will make it hard to debug issues with buggy or corrupted clients. Add logging for the unrecognized opcode case, and leave a note to add a stats counter as well. Note that we use DEBUG level logging, because bad opcodes are unlikely to cause an externally observable problems in normal operation. (In normal operation, no one looks at logs.) Bug: 32242567 Test: ./runtests.sh (on angler) Change-Id: Idd447cc5dbf44c8853b9227afae4233ac50e1cf0
/system/connectivity/wifilogd/command_processor.cpp
|
93f78dc67ade6a4ed606e31db8ce7aa5765d9909 |
|
14-Oct-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: dump AsciiMessage payloads Update CommandProcessor::Dump(), to include the payload for AsciiMessages. Along the way: - extend SendAsciiMessageWithAdjustments(), to allow tweaking of the transport-layer packet size - simplify the loop in Dump() While there: elaborate the documentation for the |current_log_buffer_| field. The additional comments explain what validity assumptions can be made of data in |current_log_buffer_|. Bug: 32240979 Test: ./runtests.sh (on angler) Change-Id: I670b88782317e39e42f083cc298aa71075482a9c
/system/connectivity/wifilogd/command_processor.cpp
|
fd08064ec7ca120b3501c341c8dfde9fdd757316 |
|
08-Oct-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: start dump implementation Update CommandProcessor, to support dumping existing logs. In order to keep the CL size reasonable, this CL only implements dumping of the timestamps of each message. Dumping the payload will be added in a follow-on CL. Note that the new unit tests use ::testing::Invoke(), in a way that mixes the mocking and faking test strategies in a single object. The GMock documentation discourages this kind of mixing, in favor of splitting a class into one piece that is to be mocked, and another that is to be faked [1]. The reason we mix the strategies, despite the recommendation to the contrary, is that we don't always want to fake Os::Write(). Some times, we just want to mock that method. Along the way: - add a ScopedRewinder to MessageBuffer - add the kDumpBuffers command to protocol::Opcode. This command is numbered 0x20, to leave room for addition kWrite<MessageType> commands. [1] https://github.com/google/googletest/blob/master/googlemock/docs/v1_6/CookBook.md Specifically, "Having to mix a mock and a fake..." Bug: 32098312 Test: ./runtests.sh Change-Id: If221b47ae5615bbc114db5755ce9eb46b9934b6e
/system/connectivity/wifilogd/command_processor.cpp
|
cc8458a847dafc8be2ce5de5a0e39a292780e6d5 |
|
07-Oct-2016 |
mukesh agrawal <quiche@google.com> |
CommandProcessor: add fd argument to ProcessInput() Various commands (such as commands which request a log dump, or which write a blob to the log) will need to provide a file descriptor argument. Accordingly, we revise ProcessInput(), to support such an argument. Add tests that verify that a provided FD argument is closed when ProcessInput() returns. As noted in the test implementation, these tests aren't truly unit tests. But they're the best we can reasonably do, given how unique_fd works. Along the way: rename ProcessInput() to ProcessCommand(). The new name is more consistent with various bits of documentation (comments and type names). Bug: 32093334 Test: ./runtests.sh Change-Id: Ib5845dc4ec13d10564894c4dbe7b486e3351ed22
/system/connectivity/wifilogd/command_processor.cpp
|
6306897b7f84708d86774bcbfe2b7b0e629cd49e |
|
30-Sep-2016 |
mukesh agrawal <quiche@google.com> |
add command processor Add CommandProcessor, the component which will parse incoming protocol commands, and take the appropriate action. This initial implementation of CommandProcessor handles on protocol::kWriteAsciiMessage commands. Add unit tests for CommandProcessor as well. Note that these unit tests can't check that the messages were actually stored, because CommandProcessor doesn't yet provide the ability to read the stored data. As such, we'll add tests that verify that our logs were stored, when we add dump functionality to CommandProcessor. Bug: 31861976 Test: ./runtest.sh (on bullhead) Change-Id: I2f1eabbf4686f74d834e6837ec0ad5d24145f007
/system/connectivity/wifilogd/command_processor.cpp
|