25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Add Redis backend to the test suite

This commit is contained in:
Evgeniy Khramtsov 2016-02-19 17:06:41 +03:00
parent 4b0860e7de
commit 8f9c18edf2
4 changed files with 66 additions and 1 deletions

View File

@ -7,6 +7,7 @@ otp_release:
services: services:
- riak - riak
- redis-server
before_install: before_install:
# #

View File

@ -47,6 +47,9 @@ init_per_group(no_db, Config) ->
init_per_group(mnesia, Config) -> init_per_group(mnesia, Config) ->
mod_muc:shutdown_rooms(?MNESIA_VHOST), mod_muc:shutdown_rooms(?MNESIA_VHOST),
set_opt(server, ?MNESIA_VHOST, Config); set_opt(server, ?MNESIA_VHOST, Config);
init_per_group(redis, Config) ->
mod_muc:shutdown_rooms(?REDIS_VHOST),
set_opt(server, ?REDIS_VHOST, Config);
init_per_group(mysql, Config) -> init_per_group(mysql, Config) ->
case catch ejabberd_odbc:sql_query(?MYSQL_VHOST, [<<"select 1;">>]) of case catch ejabberd_odbc:sql_query(?MYSQL_VHOST, [<<"select 1;">>]) of
{selected, _, _} -> {selected, _, _} ->
@ -92,6 +95,8 @@ init_per_group(_GroupName, Config) ->
end_per_group(mnesia, _Config) -> end_per_group(mnesia, _Config) ->
ok; ok;
end_per_group(redis, _Config) ->
ok;
end_per_group(mysql, _Config) -> end_per_group(mysql, _Config) ->
ok; ok;
end_per_group(pgsql, _Config) -> end_per_group(pgsql, _Config) ->
@ -227,7 +232,7 @@ db_tests(riak) ->
{test_roster_remove, [parallel], {test_roster_remove, [parallel],
[roster_remove_master, [roster_remove_master,
roster_remove_slave]}]; roster_remove_slave]}];
db_tests(mnesia) -> db_tests(DB) when DB == mnesia; DB == redis ->
[{single_user, [sequence], [{single_user, [sequence],
[test_register, [test_register,
auth_plain, auth_plain,
@ -322,6 +327,7 @@ groups() ->
{extauth, [sequence], extauth_tests()}, {extauth, [sequence], extauth_tests()},
{no_db, [sequence], no_db_tests()}, {no_db, [sequence], no_db_tests()},
{mnesia, [sequence], db_tests(mnesia)}, {mnesia, [sequence], db_tests(mnesia)},
{redis, [sequence], db_tests(redis)},
{mysql, [sequence], db_tests(mysql)}, {mysql, [sequence], db_tests(mysql)},
{pgsql, [sequence], db_tests(pgsql)}, {pgsql, [sequence], db_tests(pgsql)},
{sqlite, [sequence], db_tests(sqlite)}, {sqlite, [sequence], db_tests(sqlite)},
@ -331,6 +337,7 @@ all() ->
[{group, ldap}, [{group, ldap},
{group, no_db}, {group, no_db},
{group, mnesia}, {group, mnesia},
{group, redis},
{group, mysql}, {group, mysql},
{group, pgsql}, {group, pgsql},
{group, sqlite}, {group, sqlite},

View File

@ -220,6 +220,61 @@ Welcome to this XMPP server."
welcome_message: welcome_message:
subject: "Welcome!" subject: "Welcome!"
body: "Hi. body: "Hi.
Welcome to this XMPP server."
mod_stats: []
mod_time: []
mod_version: []
"redis.localhost":
auth_method: internal
sm_db_type: redis
modules:
mod_announce:
db_type: internal
access: local
mod_blocking: []
mod_caps:
db_type: internal
mod_last:
db_type: internal
mod_muc:
db_type: internal
mod_offline:
db_type: internal
mod_privacy:
db_type: internal
mod_private:
db_type: internal
mod_pubsub:
access_createnode: pubsub_createnode
ignore_pep_from_offline: true
last_item_cache: false
plugins:
- "flat"
- "hometree"
- "pep"
mod_roster:
versioning: true
store_current_id: true
db_type: internal
mod_mam:
db_type: internal
mod_vcard:
db_type: internal
mod_vcard_xupdate:
db_type: internal
mod_carboncopy: []
mod_client_state:
drop_chat_states: true
queue_presence: true
mod_adhoc: []
mod_configure: []
mod_disco: []
mod_ping: []
mod_proxy65: []
mod_register:
welcome_message:
subject: "Welcome!"
body: "Hi.
Welcome to this XMPP server." Welcome to this XMPP server."
mod_stats: [] mod_stats: []
mod_time: [] mod_time: []
@ -295,6 +350,7 @@ Welcome to this XMPP server."
hosts: hosts:
- "localhost" - "localhost"
- "mnesia.localhost" - "mnesia.localhost"
- "redis.localhost"
- "mysql.localhost" - "mysql.localhost"
- "pgsql.localhost" - "pgsql.localhost"
- "extauth.localhost" - "extauth.localhost"

View File

@ -74,6 +74,7 @@
-define(COMMON_VHOST, <<"localhost">>). -define(COMMON_VHOST, <<"localhost">>).
-define(MNESIA_VHOST, <<"mnesia.localhost">>). -define(MNESIA_VHOST, <<"mnesia.localhost">>).
-define(REDIS_VHOST, <<"redis.localhost">>).
-define(MYSQL_VHOST, <<"mysql.localhost">>). -define(MYSQL_VHOST, <<"mysql.localhost">>).
-define(PGSQL_VHOST, <<"pgsql.localhost">>). -define(PGSQL_VHOST, <<"pgsql.localhost">>).
-define(SQLITE_VHOST, <<"sqlite.localhost">>). -define(SQLITE_VHOST, <<"sqlite.localhost">>).