Permalink
Browse files

Fixed test for riak_schema

  • Loading branch information...
Joe DeVivo
Joe DeVivo committed Feb 13, 2014
1 parent f406a1b commit 2a371b67c3d7392f75df7ec78c798fe9dc493b4d
Showing with 25 additions and 6 deletions.
  1. +25 −6 apps/riak/test/riak_schema_test.erl
@@ -4,7 +4,7 @@
basic_schema_test() ->
Config = cuttlefish_unit:generate_templated_config(
- ["../../../rel/files/riak.schema"], [], context()),
+ ["../../../rel/files/riak.schema"], [], context(), predefined_schema()),

This comment has been minimized.

Show comment Hide comment
@edgtf

edgtf Sep 12, 2014

  •           ["../../../rel/files/riak.schema"], [], context()),
    
  •           ["../../../rel/files/riak.schema"], [], context()),
    
@edgtf

edgtf Sep 12, 2014

  •           ["../../../rel/files/riak.schema"], [], context()),
    
  •           ["../../../rel/files/riak.schema"], [], context()),
    
cuttlefish_unit:assert_config(Config, "lager.handlers",
[
@@ -47,7 +47,7 @@ override_schema_test() ->
{["distributed_cookie"], "tyktorp"}],
Config = cuttlefish_unit:generate_templated_config(
- ["../../../rel/files/riak.schema"], Conf, context()),
+ ["../../../rel/files/riak.schema"], Conf, context(), predefined_schema()),
cuttlefish_unit:assert_config(Config, "lager.handlers",
[{lager_syslog_backend, ["riak", daemon, info]},
@@ -77,29 +77,48 @@ override_schema_test() ->
crash_log_test() ->
Conf = [{["log", "crash"], off}],
Config = cuttlefish_unit:generate_templated_config(
- ["../../../rel/files/riak.schema"], Conf, context()),
+ ["../../../rel/files/riak.schema"], Conf, context(), predefined_schema()),
cuttlefish_unit:assert_config(Config, "lager.crash_log", undefined),
ok.
devrel_test() ->
RelConfig = cuttlefish_unit:generate_templated_config(
["../../../rel/files/riak.schema",
"../../../deps/eleveldb/priv/eleveldb.schema"],
- [], context()),
+ [], context(), predefined_schema()),
cuttlefish_unit:assert_config(RelConfig, "eleveldb.limited_developer_mem", false),
cuttlefish_unit:assert_not_configured(RelConfig, "vm_args.-shutdown_time"),
DevRelConfig = cuttlefish_unit:generate_templated_config(
["../../../rel/files/riak.schema",
"../../../deps/eleveldb/priv/eleveldb.schema"], [],
- lists:keyreplace(devrel, 1, context(), {devrel, true})),
+ lists:keyreplace(devrel, 1, context(), {devrel, true}), predefined_schema()),
+
cuttlefish_unit:assert_config(DevRelConfig, "eleveldb.limited_developer_mem", true),
cuttlefish_unit:assert_config(DevRelConfig, "vm_args.-shutdown_time", 10000),
ok.
context() ->
[{console_log_default, file},
{platform_log_dir, "./log"},
- {platform_data_dir, "./data"},
{devrel, false}].
+
+%% This predefined schema covers riak's dependency on
+%% platform_log_dir
+predefined_schema() ->
+ Mappings = [cuttlefish_mapping:parse({mapping,
+ "platform_log_dir",
+ "riak_core.platform_log_dir", [
+ {default, "./log"},
+ {datatype, directory}
+ ]}),
+ cuttlefish_mapping:parse({mapping,
+ "platform_data_dir",
+ "riak_core.platform_data_dir", [
+ {default, "./data"},
+ {datatype, directory}
+ ]})
+ ],
+
+ {[], Mappings, []}.

0 comments on commit 2a371b6

Please sign in to comment.