Modules hooks: initial Tcl test file.
This commit is contained in:
parent
7cefbeaad5
commit
39f2ab595c
@ -13,4 +13,4 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
make -C tests/modules && \
|
make -C tests/modules && \
|
||||||
$TCLSH tests/test_helper.tcl --single unit/moduleapi/commandfilter --single unit/moduleapi/fork --single unit/moduleapi/testrdb --single unit/moduleapi/infotest --single unit/moduleapi/propagate "${@}"
|
$TCLSH tests/test_helper.tcl --single unit/moduleapi/commandfilter --single unit/moduleapi/fork --single unit/moduleapi/testrdb --single unit/moduleapi/infotest --single unit/moduleapi/propagate --single unit/moduleapi/hooks "${@}"
|
||||||
|
18
tests/unit/moduleapi/hooks.tcl
Normal file
18
tests/unit/moduleapi/hooks.tcl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
set testmodule [file normalize tests/modules/hooks.so]
|
||||||
|
|
||||||
|
tags "modules" {
|
||||||
|
start_server {} {
|
||||||
|
r module load $testmodule
|
||||||
|
test {Test clients connection / disconnection hooks} {
|
||||||
|
for {set j 0} {$j < 2} {incr j} {
|
||||||
|
set rd1 [redis_deferring_client]
|
||||||
|
$rd1 close
|
||||||
|
}
|
||||||
|
|
||||||
|
r select 0
|
||||||
|
puts "Keys: [r keys *]"
|
||||||
|
assert {[r llen connected] > 1}
|
||||||
|
assert {[r llen disconnected] > 1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user