Skip to content

Commit 7cb42c9

Browse files
committed
add test for modules load/unload and config rewrite
1 parent 2ff5306 commit 7cb42c9

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

runtest-moduleapi

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $TCLSH tests/test_helper.tcl \
1919
--single unit/moduleapi/fork \
2020
--single unit/moduleapi/testrdb \
2121
--single unit/moduleapi/infotest \
22+
--single unit/moduleapi/infra \
2223
--single unit/moduleapi/propagate \
2324
--single unit/moduleapi/hooks \
2425
--single unit/moduleapi/misc \

tests/unit/moduleapi/infra.tcl

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set testmodule [file normalize tests/modules/infotest.so]
2+
3+
test {modules config rewrite} {
4+
5+
start_server {tags {"modules"}} {
6+
r module load $testmodule
7+
8+
assert_equal [lindex [lindex [r module list] 0] 1] infotest
9+
10+
r config rewrite
11+
restart_server 0 true false
12+
13+
assert_equal [lindex [lindex [r module list] 0] 1] infotest
14+
15+
r module unload infotest
16+
17+
r config rewrite
18+
restart_server 0 true false
19+
20+
assert_equal [llength [r module list]] 0
21+
}
22+
}

0 commit comments

Comments
 (0)