basho/riak_core — pull request #460 by jrwest (2013-11-26 20:35:08+00:00)
Title: Validate Bucket Type Properties Required by Core

The `claimant` and `active` properties added in #402 need to immutable. addresses #442

The eqc test included in this PR adds coverage around the creation semantics of Bucket Types that was missing. The test reproduces the previously mentioned issue if https://github.com/basho/riak_core/commit/bc0d3989fb0de21cf2f9c6dac9c175c193602c4c is not applied. The test should pass with the change.

The test does not have all the coverage I would like. Since it tests on a single node, Bucket Types are never in the `created` state -- they move immediately to `ready` -- and we don't test the time between creation and propagation. For this, it will be better to make the test run inside a `riak_test`.

With that in mind, and because `eunit` was giving me a hard time, the test cannot be run via `eunit` (or `make test`). Instead it can be run like this:

Compile via rebar (or whatever method you use, I do this in edts normally):

```
./rebar skip_deps=true eunit suites=dne
```

Start Erlang and Run:
```
$ erl -pa deps/*/ebin -pa .eunit
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

Eshell V5.10.3 (abort with ^G)
1> btypes_eqc:run_eqc(1000).
```