rahix
c4e0d9dfe7
Improve test coverage
...
Add missing tests to fully cover the BaseControl codebase (execution
coverage). The only missing pieces are now uuid and os.clock coverage.
Importantly, these changes do not guarantee full coverage of failure
modes - but at least more possible failures are covered now.
3 years ago
rahix
d2a1a8ebe5
Use local reference to Network in constructor
...
To allow customizing the bc module in compatibility wrappers, use the
local reference instead of a global one. This means a wrapper module
could set `BaseControl.Network` to a different default.
5 years ago
rahix
22328f313d
Add fallback when uuid is not available
...
If the `uuid` module does not exist, fall back to a primitive ID
generation mechanism based on just math.random(). The fallback
mechanism provides the same amount of entropy so we can be sure this
won't degrade quality of the identifiers.
5 years ago
rahix
e2da98fbf4
Fallback to os.clock() if computer.uptime() is not available
...
To be compatible with systems that don't have computer.uptime(), use
os.clock() as a fallback. The time is only used for timeout
calculations.
5 years ago
rahix
67cbb5badc
Move serialization import into network implementation
...
The (default) network implementation is the only place where
`serialization` is used. Thus, move the import into its constructor so
we don't unnecessarily load the module unconditionally.
5 years ago
rahix
4a5349be96
Switch from lunit to u-test
...
lunit is unmaintained since ~2011. Switch to u-test [1] instead which
seems to be more actively maintained.
[1]: https://github.com/IUdalov/u-test
5 years ago
rahix
0d852d7aac
Make cleanup more robust
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
af97600952
Actually include bit32
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
13b8fe9cea
Use bit32 for Lua 5.2 compatibility
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b44f63a1bb
Use bit32 for lua 5.2 compat
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c27e889d45
Cancel listeners when closing
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
11babfad9e
Cleanup
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
2b935b87e4
Add timeout to call_sync
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
253e04ff5d
Implement batch register
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e8ec24dacc
Small refactor
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
50ae923ef7
Add late installed listeners
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c33fdd41a6
Implement listen cancelling
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
719201e950
Implement listening
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
8fb07e22cc
Implement close()
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
d6aa1637f1
Test fixes
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
1a9422af7d
Better errors and return codes
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c6f019f271
No reannouncing self
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
28a52cfd7d
Only announce if bc has names
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b9c3674755
Actually make bc timeout
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
9f10348b58
Implement finalize
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
1b73d0d04c
Make get and call_sync error
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
4b5fcf3d99
More tests
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
9c44faa811
Fix network mock
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
646a5b28fd
Update README
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
62658906d8
Fix lunit not honoring "-t"
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
3b290e6853
Move pulling into network
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
0eed392d6e
Fix pull-filters
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
888ad288af
Implement call_sync
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e4f19c3e20
Implement simple verb calling
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c6bbdcf984
Modularize tests
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
da6c36922b
Add get and pull
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
7063e7445d
Basic network
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e328ae0ab9
Improve table hierarchy
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
f9a14ecaeb
Implement set and call
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
3508870c7f
A new beginning
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b2a12cc2dc
Refactor dummies
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
6c51c4cb4e
Fix indent
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
9f8e62923e
Update README again
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
132cfb9921
Update README
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b205779a29
Rewrite attempt 1
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
126d420e3c
Update README
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
3c4920489a
Cleanup
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c3ce5b0ac8
Fix some variables being non-local
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
9c32c826ea
More parameter verb-call checks
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
dc0e021ef6
Add test for verb parameter
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago