leofs_test2
is a integration test tool for LeoFS clusters. Tests/Scenarios depend on Erlang and can communicate with the cluster using the distributed Erlang.
- "leofs_test2" requires Erlang R16B03-1 or later.
- "leofs_test2" uses the rebar build system. Makefile so that simply running "make" at the top level should work.
$ git clone https://github.com/leo-project/leofs_test2.git
$ cd leofs_test2
$ make
- Add a domain for the LeoFS bucket in
/etc/hosts
$ sudo vi /etc/hosts
## Replace {BUCKET_NAME} with the name of the bucket ##
127.0.0.1 localhost <BUCKET_NAME>.localhost
- Build a LeoFS of your test with "bootstrap.sh" which is included in LeoFS source code
$ cd <leofs-root-dir>/
$ sh bootstrap.sh build integration-test
- leofs_test2 has options as follows. You can set suitable option(s) with tests.
$ ./leofs_test --help
Usage: leofs_test [-b <bucket>] [-c <cookie>] [-d <leofs_dir>] [-k <keys>] [-m <manager>] [-t <test>] [-h] [-v]
-b, --bucket Target a bucket
-c, --cookie Distributed-cookie for communication with LeoFS
-d, --dir LeoFS directory
-k, --keys Total number of keys
-m, --manager LeoFS Manager
-t, --test Execute a test
-h, --help Show the program options
-v, --version Show version information
-
Default value of options
- bucket: "backup"
- cookie: "401321b4"
- keys: 10000
- manager: 'manager_0@127.0.0.1'
-
Example - Execute the scenarios
$ ./leofs_test -d <leofs-package-dir> -b <bucket> -k 10000 -c leofs_test
...
::: START :::
[SCENARIO-1]
* create_bucket (create a bucket)
* put_objects (put objects)-------------------------------------------|
* check_redundancies (check redundancies of replicas)-----------------|
* del_objects (del objects)-------------------------------------------|
* check_redundancies (check redundancies of replicas)-----------------|
...
[SCENARIO-5]
* remove_avs (remove avs of a node)
* recover_node (recover data of a node)
* watch_mq (watch state of mq)-----------------------------|
* check_redundancies (check redundancies of replicas)-----------------|
::: Finished (1617sec) :::
- Example - Execute only a test
$ ./leofs_test -d /home/yosuke/dev/leo/test/leofs-1.2.5-dev/package -t check_redundancies
...
:: TEST: check_redundancies (check redundancies of replicas)::::
[TEST]
* check_redundancies (check redundancies of replicas)-----------------|
::: Finished (13sec) :::
v0.4: Improve the basic scenarios retrieved from leofs-adm's commands Phase 1 (LeoFS 1.4.2 will come out with v0.4 tests passed)
- check whether mq-(suspend|resume|stats) works
- check whether recover-(file|node|consistency) works
- check whether compaction-(suspend|resume) works
- check whether du works
- check whether purge-cache works
- check whether (backup|restore)-mnesia works
- check whether dump-ring works
- check whether update-consistency-level works
- check whether update-log-level works
- check whether user related functions work
- check whether endpoint related functions work
- check whether bucket related functions work
- check whether rollback works
- check whether multipart uploads work
- move onto rebar3
- add the scenario-7 for the scrub cluster usecase
- check whether recover-(ring|cluster|disk)
- check whether du detail works
- check whether remove-gateway works
- check whether update-managers works
- check whether multi-dc related functions work
- check whether chown-bucket works
- check whether update-acl works
- check whether leo_storage cluster works with one storage being dead
- check whether leo_storage cluster fail-back
- check whether leo_storage cluster respond an expected error in case # of replicas < N
- check whether leo_storage cluster works while compaction is ongoing
- check whether leo_storage cluster works while rebalance is ongoing
- check whether leo_storage cluster works while compaction AND rebalance are ongoing
LeoProject/LeoFS is sponsored by Rakuten, Inc. and Rakuten Institute of Technology.