Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
6185fd35
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6185fd35
编写于
5月 20, 2010
作者:
A
antirez
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'test_vm' of
git://github.com/pietern/redis
上级
8513a757
f166bb1d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
14 deletion
+27
-14
tests/assets/default.conf
tests/assets/default.conf
+3
-7
tests/support/server.tcl
tests/support/server.tcl
+4
-3
tests/test_helper.tcl
tests/test_helper.tcl
+20
-4
未找到文件。
tests/assets/default.conf
浏览文件 @
6185fd35
...
...
@@ -220,7 +220,7 @@ vm-enabled no
# *** WARNING *** if you are using a shared hosting the default of putting
# the swap file under /tmp is not secure. Create a dir with access granted
# only to Redis user and configure Redis to create the swap file there.
vm
-
swap
-
file
/
tmp
/
redis
.
swap
vm
-
swap
-
file
redis
.
swap
# vm-max-memory configures the VM to use at max the specified amount of
# RAM. Everything that deos not fit will be swapped on disk *if* possible, that
...
...
@@ -249,12 +249,8 @@ vm-page-size 32
#
# The total swap size is vm-page-size * vm-pages
#
# With the default of 32-bytes memory pages and 134217728 pages Redis will
# use a 4 GB swap file, that will use 16 MB of RAM for the page table.
#
# It's better to use the smallest acceptable value for your application,
# but the default is large in order to work in most conditions.
vm
-
pages
134217728
# 32M swap should be enough for testing.
vm
-
pages
1048576
# Max number of VM I/O threads running at the same time.
# This threads are used to read/write data from/to swap file, since they
...
...
tests/support/server.tcl
浏览文件 @
6185fd35
...
...
@@ -26,7 +26,7 @@ proc kill_server config {
if
{[
incr wait 10
]
% 1000 == 0
}
{
puts
"Waiting for process
$pid
to exit..."
}
exec kill $pid
catch
{
exec kill $pid
}
after 10
}
}
...
...
@@ -40,6 +40,7 @@ proc is_alive config {
}
}
set ::global_overrides
{}
proc start_server
{
filename overrides
{
code undefined
}}
{
set data
[
split
[
exec cat
"tests/assets/
$filename
"
]
"
\n
"
]
set config
{}
...
...
@@ -58,8 +59,8 @@ proc start_server {filename overrides {code undefined}} {
# start every server on a different port
dict set config port
[
incr ::port
]
# apply overrides from arguments
foreach override
$overrides
{
# apply overrides from
global space and
arguments
foreach override
[
concat $::global_overrides $overrides
]
{
set directive
[
lrange $override 0 0
]
set arguments
[
lrange $override 1 end
]
dict set config $directive $arguments
...
...
tests/test_helper.tcl
浏览文件 @
6185fd35
...
...
@@ -49,7 +49,13 @@ proc s {args} {
status
[
srv $level
"client"
]
[
lindex $args 0
]
}
proc cleanup
{}
{
exec rm -rf
{*}
[
glob tests/tmp/redis.conf.*
]
exec rm -rf
{*}
[
glob tests/tmp/server.*
]
}
proc main
{}
{
cleanup
execute_tests
"unit/auth"
execute_tests
"unit/protocol"
execute_tests
"unit/basic"
...
...
@@ -62,15 +68,25 @@ proc main {} {
execute_tests
"unit/other"
execute_tests
"integration/replication"
execute_tests
"integration/aof"
# run tests with VM enabled
set ::global_overrides
[
list
[
list vm-enabled yes
]]
execute_tests
"unit/protocol"
execute_tests
"unit/basic"
execute_tests
"unit/type/list"
execute_tests
"unit/type/set"
execute_tests
"unit/type/zset"
execute_tests
"unit/type/hash"
execute_tests
"unit/sort"
execute_tests
"unit/expire"
execute_tests
"unit/other"
puts
"
\n
[
expr $::passed+$::failed
]
tests,
$::passed
passed,
$::failed
failed"
if
{
$::failed
> 0
}
{
puts
"
\n
*** WARNING!!!
$::failed
FAILED TESTS ***
\n
"
}
# clean up tmp
exec rm -rf
{*}
[
glob tests/tmp/redis.conf.*
]
exec rm -rf
{*}
[
glob tests/tmp/server.*
]
cleanup
}
main
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录