- Ensure that s3cmd is installed and that
~/.s3cfgcontains access credentials for the Basho account. - Ensure that riak_test builds are in place for:
- Riak
- Riak EE
- Riak CS
- Stanchion
- Setup a
~/.riak_test.configfile like this:
{default, [
{rt_max_wait_time, 180000},
{rt_retry_delay, 1000}
]}.
{rtdev, [
{rt_deps, [
"/Users/kelly/basho/riak_test_builds/riak/deps",
"deps"
]},
{rt_retry_delay, 500},
{rt_harness, rtdev},
{rtdev_path, [{root, "/Users/kelly/rt/riak"},
{current, "/Users/kelly/rt/riak/current"},
{ee_root, "/Users/kelly/rt/riak_ee"},
{ee_current, "/Users/kelly/rt/riak_ee/current"}
]}
]}.
{rt_cs_dev, [
{rt_project, "riak_cs"},
{rt_deps, [
"/Users/kelly/basho/riak_test_builds/riak/deps",
"/Users/kelly/basho/riak_test_builds/riak_cs/deps",
"/Users/kelly/basho/riak_test_builds/stanchion/deps"
]},
{rt_retry_delay, 500},
{rt_harness, rt_cs_dev},
{build_paths, [{root, "/Users/kelly/rt/riak"},
{current, "/Users/kelly/rt/riak/current"},
{ee_root, "/Users/kelly/rt/riak_ee"},
{ee_current, "/Users/kelly/rt/riak_ee/current"},
{cs_root, "/Users/kelly/rt/riak_cs"},
{cs_current, "/Users/kelly/rt/riak_cs/current"},
{stanchion_root, "/Users/kelly/rt/stanchion"},
{stanchion_current, "/Users/kelly/rt/stanchion/current"}
]},
{test_paths, ["/Users/kelly/basho/riak_test_builds/riak_cs/riak_test/ebin"]},
{src_paths, [{cs_src_root, "/Users/kelly/basho/riak_test_builds/riak_cs"}]},
{build_type, oss},
{backend, {multi_backend, bitcask}},
{flavor, basic}
]}.Running the RiakCS tests for riak_test use a different test harness
(rt_cs_dev) than running the Riak tests and so requires a separate
configuration section. Notice the extra riak_ee/deps, riak_cs/deps
and stanchion/deps in the rt_deps section. RT_DEST_DIR should be
replaced by the path used when setting up riak_test builds for Riak
(by default $HOME/rt/riak). The same should be done for
RTEE_DEST_DIR (default $HOME/rt/riak_ee), RTCS_DEST_DIR (default
$HOME/rt/riak_cs) and RTSTANCHION_DEST_DIR (default
$HOME/rt/stanchion).
The build_type option is used to differentiate between an
open-source (oss) build of RiakCS and the enterprise version (ee).
The default is oss and this option can be omitted when these tests
are used by open-source users.
The backend option is used to indicate which Riak backend option
should be used. The valid options are {multi_backend, bitcask} and
memory. {multi_backend, bitcask} is the default option and
represents the default recommended backed for production use of
RiakCS.
The test_paths option is a list of fully-qualified paths which
riak_test will use to find additional tests. Since the Riak CS tests
do not live inside the riak_test repository and escript, this should
point to the compiled tests in riak_cs/riak_test/ebin.
The flavor option is used to vary environment setup. Some
riak_test modules use only S3 API and does not depend on details,
such as number of riak nodes, riak's backend, MDC or not, multibag or
not. By adding flavor setting to riak_test config, such generic test
cases can be utilized to verify Riak CS's behavior in various setups.
The scope of setup functions affected by flavors are rtcs:setup/1
and rtcs:setup/2. Other setup functions, for example
rtcs:setup2x2 used by repl_test, does not change their behavior.
The valid option values are basic (default) and {multibag, disjoint}.
{multibag, disjoint} setup multibag environment with 3 bags, the master
bag with two riak nodes and two additional bags with one riak node each.
-
To build the
riak_testfiles use thecompile-riak-testMakefile target or run./rebar riak_test_compile. -
The Riak client tests are now automated by the
tests/external_client_tests.erltest. There are several prerequisites:
- Your $PATH must have
erlavailable. - Your $PATH must have a version of Python available that also has access to the Boto S3 libraries.
- Your $PATH must have Clojure's "lein" available. "lein" is the main executable for the Leinigen tool.
- Your system must have libevent installed. If you see an error for a missing 'event.h' file during test runs, this is because libevent is not installed.
-
Before running the Riak client tests, your
~/.riak_test.configfile must contain an entry forcs_src_rootin thesrc_pathslist, as shown above. The source in this directory must be successfully compiled using the top levelmake alltarget. -
Before running the Riak client tests, you must first use the commands
make clean-client-testand thenmake compile-client-test. -
To execute a test, run the following from the
riak_testrepo:./riak_test -c rt_cs_dev -t TEST_NAME