# *** 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
#
# 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
if {[incr wait 10] % 1000 == 0} {
puts "Waiting for process $pid to exit..."
}
- exec kill $pid
+ catch {exec kill $pid}
after 10
}
}
}
}
+set ::global_overrides {}
proc start_server {filename overrides {code undefined}} {
set data [split [exec cat "tests/assets/$filename"] "\n"]
set config {}
# 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
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"
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