Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7f7499ee
Commit
7f7499ee
authored
Jun 02, 2010
by
Pieter Noordhuis
Browse files
tags for existing tests
parent
73bd6c58
Changes
11
Show whitespace changes
Inline
Side-by-side
tests/integration/aof.tcl
View file @
7f7499ee
...
@@ -22,14 +22,15 @@ proc start_server_aof {overrides code} {
...
@@ -22,14 +22,15 @@ proc start_server_aof {overrides code} {
kill_server $srv
kill_server $srv
}
}
## Test the server doesn't start when the AOF contains an unfinished MULTI
tags
{
"aof"
}
{
create_aof
{
## Test the server doesn't start when the AOF contains an unfinished MULTI
create_aof
{
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand multi
]
append_to_aof
[
formatCommand multi
]
append_to_aof
[
formatCommand set bar world
]
append_to_aof
[
formatCommand set bar world
]
}
}
start_server_aof
[
list dir $server_path
]
{
start_server_aof
[
list dir $server_path
]
{
test
{
Unfinished MULTI: Server should not have been started
}
{
test
{
Unfinished MULTI: Server should not have been started
}
{
is_alive $srv
is_alive $srv
}
{
0
}
}
{
0
}
...
@@ -37,15 +38,15 @@ start_server_aof [list dir $server_path] {
...
@@ -37,15 +38,15 @@ start_server_aof [list dir $server_path] {
test
{
Unfinished MULTI: Server should have logged an error
}
{
test
{
Unfinished MULTI: Server should have logged an error
}
{
exec cat
[
dict get $srv stdout
]
| tail -n1
exec cat
[
dict get $srv stdout
]
| tail -n1
}
{
*Unexpected end of file reading the append only file*
}
}
{
*Unexpected end of file reading the append only file*
}
}
}
## Test that the server exits when the AOF contains a short read
## Test that the server exits when the AOF contains a short read
create_aof
{
create_aof
{
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
string range
[
formatCommand set bar world
]
0 end-1
]
append_to_aof
[
string range
[
formatCommand set bar world
]
0 end-1
]
}
}
start_server_aof
[
list dir $server_path
]
{
start_server_aof
[
list dir $server_path
]
{
test
{
Short read: Server should not have been started
}
{
test
{
Short read: Server should not have been started
}
{
is_alive $srv
is_alive $srv
}
{
0
}
}
{
0
}
...
@@ -53,22 +54,22 @@ start_server_aof [list dir $server_path] {
...
@@ -53,22 +54,22 @@ start_server_aof [list dir $server_path] {
test
{
Short read: Server should have logged an error
}
{
test
{
Short read: Server should have logged an error
}
{
exec cat
[
dict get $srv stdout
]
| tail -n1
exec cat
[
dict get $srv stdout
]
| tail -n1
}
{
*Bad file format reading the append only file*
}
}
{
*Bad file format reading the append only file*
}
}
}
## Test that redis-check-aof indeed sees this AOF is not valid
## Test that redis-check-aof indeed sees this AOF is not valid
test
{
Short read: Utility should confirm the AOF is not valid
}
{
test
{
Short read: Utility should confirm the AOF is not valid
}
{
catch
{
catch
{
exec ./redis-check-aof $aof_path
exec ./redis-check-aof $aof_path
}
str
}
str
set _ $str
set _ $str
}
{
*not valid*
}
}
{
*not valid*
}
test
{
Short read: Utility should be able to fix the AOF
}
{
test
{
Short read: Utility should be able to fix the AOF
}
{
exec echo y | ./redis-check-aof --fix $aof_path
exec echo y | ./redis-check-aof --fix $aof_path
}
{
*Successfully truncated AOF*
}
}
{
*Successfully truncated AOF*
}
## Test that the server can be started using the truncated AOF
## Test that the server can be started using the truncated AOF
start_server_aof
[
list dir $server_path
]
{
start_server_aof
[
list dir $server_path
]
{
test
{
Fixed AOF: Server should have been started
}
{
test
{
Fixed AOF: Server should have been started
}
{
is_alive $srv
is_alive $srv
}
{
1
}
}
{
1
}
...
@@ -77,4 +78,5 @@ start_server_aof [list dir $server_path] {
...
@@ -77,4 +78,5 @@ start_server_aof [list dir $server_path] {
set client
[
redis
[
dict get $srv host
]
[
dict get $srv port
]]
set client
[
redis
[
dict get $srv host
]
[
dict get $srv port
]]
list
[
$client
get foo
]
[
$client
get bar
]
list
[
$client
get foo
]
[
$client
get bar
]
}
{
hello
{}}
}
{
hello
{}}
}
}
}
tests/integration/replication.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"repl"
}
}
{
r set mykey foo
r set mykey foo
start_server
{}
{
start_server
{}
{
...
...
tests/unit/auth.tcl
View file @
7f7499ee
start_server
{
overrides
{
requirepass foobar
}}
{
start_server
{
tags
{
"auth"
}
overrides
{
requirepass foobar
}}
{
test
{
AUTH fails when a wrong password is given
}
{
test
{
AUTH fails when a wrong password is given
}
{
catch
{
r auth wrong!
}
err
catch
{
r auth wrong!
}
err
format $err
format $err
...
...
tests/unit/basic.tcl
View file @
7f7499ee
start_server
{
tags
{
basic
}}
{
start_server
{
tags
{
"
basic
"
}}
{
test
{
DEL all keys to start with a clean DB
}
{
test
{
DEL all keys to start with a clean DB
}
{
foreach key
[
r keys *
]
{
r del $key
}
foreach key
[
r keys *
]
{
r del $key
}
r dbsize
r dbsize
...
@@ -52,7 +52,7 @@ start_server {tags {basic}} {
...
@@ -52,7 +52,7 @@ start_server {tags {basic}} {
r get foo
r get foo
}
[
string repeat
"abcd"
1000000
]
}
[
string repeat
"abcd"
1000000
]
tags
{
slow
}
{
tags
{
"
slow
"
}
{
test
{
Very big payload random access
}
{
test
{
Very big payload random access
}
{
set err
{}
set err
{}
array set payload
{}
array set payload
{}
...
...
tests/unit/cas.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"cas"
}
}
{
test
{
EXEC works on WATCHed key not modified
}
{
test
{
EXEC works on WATCHed key not modified
}
{
r watch x y z
r watch x y z
r watch k
r watch k
...
...
tests/unit/expire.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"expire"
}
}
{
test
{
EXPIRE - don't set timeouts multiple times
}
{
test
{
EXPIRE - don't set timeouts multiple times
}
{
r set x foobar
r set x foobar
set v1
[
r expire x 5
]
set v1
[
r expire x 5
]
...
...
tests/unit/sort.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"sort"
}
}
{
test
{
SORT ALPHA against integer encoded strings
}
{
test
{
SORT ALPHA against integer encoded strings
}
{
r del mylist
r del mylist
r lpush mylist 2
r lpush mylist 2
...
@@ -8,6 +8,7 @@ start_server {} {
...
@@ -8,6 +8,7 @@ start_server {} {
r sort mylist alpha
r sort mylist alpha
}
{
1 10 2 3
}
}
{
1 10 2 3
}
tags
{
"slow"
}
{
test
{
Create a random list and a random set
}
{
test
{
Create a random list and a random set
}
{
set tosort
{}
set tosort
{}
array set seenrand
{}
array set seenrand
{}
...
@@ -132,6 +133,7 @@ start_server {} {
...
@@ -132,6 +133,7 @@ start_server {} {
flush stdout
flush stdout
format
{}
format
{}
}
{}
}
{}
}
test
{
SORT regression for issue #19, sorting floats
}
{
test
{
SORT regression for issue #19, sorting floats
}
{
r flushdb
r flushdb
...
...
tests/unit/type/hash.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"hash"
}
}
{
test
{
HSET/HLEN - Small hash creation
}
{
test
{
HSET/HLEN - Small hash creation
}
{
array set smallhash
{}
array set smallhash
{}
for
{
set i 0
}
{
$i
< 8
}
{
incr i
}
{
for
{
set i 0
}
{
$i
< 8
}
{
incr i
}
{
...
...
tests/unit/type/list.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"list"
}
}
{
test
{
Basic LPUSH, RPUSH, LLENGTH, LINDEX
}
{
test
{
Basic LPUSH, RPUSH, LLENGTH, LINDEX
}
{
set res
[
r lpush mylist a
]
set res
[
r lpush mylist a
]
append res
[
r lpush mylist b
]
append res
[
r lpush mylist b
]
...
...
tests/unit/type/set.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"set"
}
}
{
test
{
SADD, SCARD, SISMEMBER, SMEMBERS basics
}
{
test
{
SADD, SCARD, SISMEMBER, SMEMBERS basics
}
{
r sadd myset foo
r sadd myset foo
r sadd myset bar
r sadd myset bar
...
...
tests/unit/type/zset.tcl
View file @
7f7499ee
start_server
{}
{
start_server
{
tags
{
"zset"
}
}
{
test
{
ZSET basic ZADD and score update
}
{
test
{
ZSET basic ZADD and score update
}
{
r zadd ztmp 10 x
r zadd ztmp 10 x
r zadd ztmp 20 y
r zadd ztmp 20 y
...
@@ -162,6 +162,7 @@ start_server {} {
...
@@ -162,6 +162,7 @@ start_server {} {
r zrangebyscore zset 2 4 withscores
r zrangebyscore zset 2 4 withscores
}
{
b 2 c 3 d 4
}
}
{
b 2 c 3 d 4
}
tags
{
"slow"
}
{
test
{
ZRANGEBYSCORE fuzzy test, 100 ranges in 1000 elements sorted set
}
{
test
{
ZRANGEBYSCORE fuzzy test, 100 ranges in 1000 elements sorted set
}
{
set err
{}
set err
{}
r del zset
r del zset
...
@@ -241,6 +242,7 @@ start_server {} {
...
@@ -241,6 +242,7 @@ start_server {} {
}
}
set _ $err
set _ $err
}
{}
}
{}
}
test
{
ZRANGEBYSCORE with LIMIT
}
{
test
{
ZRANGEBYSCORE with LIMIT
}
{
r del zset
r del zset
...
@@ -356,6 +358,7 @@ start_server {} {
...
@@ -356,6 +358,7 @@ start_server {} {
list
[
r zinterstore zsetc 2 zseta zsetb aggregate max
]
[
r zrange zsetc 0 -1 withscores
]
list
[
r zinterstore zsetc 2 zseta zsetb aggregate max
]
[
r zrange zsetc 0 -1 withscores
]
}
{
2
{
b 2 c 3
}}
}
{
2
{
b 2 c 3
}}
tags
{
"slow"
}
{
test
{
ZSETs skiplist implementation backlink consistency test
}
{
test
{
ZSETs skiplist implementation backlink consistency test
}
{
set diff 0
set diff 0
set elements 10000
set elements 10000
...
@@ -397,6 +400,7 @@ start_server {} {
...
@@ -397,6 +400,7 @@ start_server {} {
}
}
set _ $err
set _ $err
}
{}
}
{}
}
test
{
ZSET element can't be set to nan with ZADD
}
{
test
{
ZSET element can't be set to nan with ZADD
}
{
set e
{}
set e
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment