From 8f9c18edf229c010229fa3cd65c7d77bb6bd566b Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 19 Feb 2016 17:06:41 +0300 Subject: [PATCH] Add Redis backend to the test suite --- .travis.yml | 1 + test/ejabberd_SUITE.erl | 9 ++++- test/ejabberd_SUITE_data/ejabberd.yml | 56 +++++++++++++++++++++++++++ test/suite.hrl | 1 + 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ba2fc3521..153631809 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ otp_release: services: - riak + - redis-server before_install: # diff --git a/test/ejabberd_SUITE.erl b/test/ejabberd_SUITE.erl index 947bc4bd5..1b8d5f477 100644 --- a/test/ejabberd_SUITE.erl +++ b/test/ejabberd_SUITE.erl @@ -47,6 +47,9 @@ init_per_group(no_db, Config) -> init_per_group(mnesia, Config) -> mod_muc:shutdown_rooms(?MNESIA_VHOST), 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) -> case catch ejabberd_odbc:sql_query(?MYSQL_VHOST, [<<"select 1;">>]) of {selected, _, _} -> @@ -92,6 +95,8 @@ init_per_group(_GroupName, Config) -> end_per_group(mnesia, _Config) -> ok; +end_per_group(redis, _Config) -> + ok; end_per_group(mysql, _Config) -> ok; end_per_group(pgsql, _Config) -> @@ -227,7 +232,7 @@ db_tests(riak) -> {test_roster_remove, [parallel], [roster_remove_master, roster_remove_slave]}]; -db_tests(mnesia) -> +db_tests(DB) when DB == mnesia; DB == redis -> [{single_user, [sequence], [test_register, auth_plain, @@ -322,6 +327,7 @@ groups() -> {extauth, [sequence], extauth_tests()}, {no_db, [sequence], no_db_tests()}, {mnesia, [sequence], db_tests(mnesia)}, + {redis, [sequence], db_tests(redis)}, {mysql, [sequence], db_tests(mysql)}, {pgsql, [sequence], db_tests(pgsql)}, {sqlite, [sequence], db_tests(sqlite)}, @@ -331,6 +337,7 @@ all() -> [{group, ldap}, {group, no_db}, {group, mnesia}, + {group, redis}, {group, mysql}, {group, pgsql}, {group, sqlite}, diff --git a/test/ejabberd_SUITE_data/ejabberd.yml b/test/ejabberd_SUITE_data/ejabberd.yml index 30eaa5edd..5507900b8 100644 --- a/test/ejabberd_SUITE_data/ejabberd.yml +++ b/test/ejabberd_SUITE_data/ejabberd.yml @@ -220,6 +220,61 @@ Welcome to this XMPP server." welcome_message: subject: "Welcome!" 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." mod_stats: [] mod_time: [] @@ -295,6 +350,7 @@ Welcome to this XMPP server." hosts: - "localhost" - "mnesia.localhost" + - "redis.localhost" - "mysql.localhost" - "pgsql.localhost" - "extauth.localhost" diff --git a/test/suite.hrl b/test/suite.hrl index 5638fdb75..fb6b4f3ac 100644 --- a/test/suite.hrl +++ b/test/suite.hrl @@ -74,6 +74,7 @@ -define(COMMON_VHOST, <<"localhost">>). -define(MNESIA_VHOST, <<"mnesia.localhost">>). +-define(REDIS_VHOST, <<"redis.localhost">>). -define(MYSQL_VHOST, <<"mysql.localhost">>). -define(PGSQL_VHOST, <<"pgsql.localhost">>). -define(SQLITE_VHOST, <<"sqlite.localhost">>).