FrostFS integration testcases
Find a file
Vladimir Domnich d9d74baa72 Add test suites for acl, container and node management
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>

commit f7c68cfb423e3213179521954dccb6053fc6382d
Merge: e234b61 99bfe6b
    Merge branch 'avolkov/add_ssh' into internal_tmp_b

commit 99bfe6b56cd75590f868313910068cf1a80bd43f
    Tick one more epoch.

commit bd70bc49391d578cdda727edb4dcd181b832bf1e
    Start nodes in case of test fail.

commit b3888ec62cfc3c18b1dff58962a94a3094342186
    Catch json decode error.

commit c18e415b783ec3e4ce804f43c19246240c186a97
    Add ssh-key access.

commit 7dbdeb653b7d5b7ab3874b546e05a48b502c2460
    Add some tests.

commit 844367c68638c7f97ba4860dd0069c07f499d66d
    Add some tests for nodes management.

commit 1b84b37048dcd3cc0888aa54639975fc11fb2d75
    Add some tests for nodes management.

commit b30c1336a6919e0c8e500bdf2a9be3d5a14470ea
    Add ssh execution option.

commit 2df40eca74ee20bd668778715185ffddda63cb05
    Change AWS cli v1 to cli v2.

commit 7403da3d7c2a5963cfbb12b7c0f3d1d641f52a7e
    Change AWS cli v1 to cli v2.

commit b110dcdb655a585e6c53e6ebc3eae7bf1f1e792f
    Change AWS cli v1 to cli v2.

commit 6183756a4c064c932ee193c2e08a79343017fa49
    Change AWS cli v1 to cli v2.

commit 398006544d60896faa3fc6e6a9dbb51ada06759c
    Fix container run.

commit e7202136dabbe7e2d3da508e0a2ec55a0d5cb67a
    Added tests with AWS CLI.

commit 042e1478ee1fd700c8572cbc6d0d9e6b312b8e8d
    Fix PR comments.

commit e234b61dbb9b8b10812e069322ab03615af0d44e
    Add debug for env.

commit 14febd06713dc03a8207bb80384acb4a7d32df0e
    Move env variables for pytest docker into env file.

commit bafdc6131b5ac855a43b672be194cde2ccf6f75b
    Move env variables for pytest docker into env file.

commit 27c2c6b11f51d2e3c085d44b814cb4c00f81b376
    Move env variables for pytest docker into env file.

commit e4db4948978e092adb83aeacdf06619f5ca2f242
    Merge branch 'master' into avolkov/try_pytest

commit c83a7e625e8daba3a40b65a1d69b2b1323e9ae28
    WIP.

commit 42489bbf8058acd2926cdb04074dc9a8ff86a0a0
    Merge branch 'avolkov/try_pytest' into internal_tmp_b

commit 62526d94dc2bf72372125bea119fa66f670cf7e1
    Improve allure attachments.

commit 4564dae697cb069ac45bc4ba7eb0b5bbdcf1d153
    Merge branch 'avolkov/try_pytest' into internal_tmp_b

commit ab65810b23410ca7382ed4bdd257addfa6619659
    Added tests for S3 API.

commit 846c495a846c977f3e5f0bada01e5a9691a81e3d
    Let's get NEOFS_IR_CONTRACTS_NEOFS from env.

commit c39bd88568b70ffcb76b76d68531b17d3747829d
    Added S3 test for versioning.

commit d7c9f351abc7e02d4ebf162475604a2d6b46e712
    Merge remote-tracking branch 'origin/avolkov/try_pytest' into internal_tmp_b

commit bfbed22a50ce4cb6a49de383cfef66452ba9f4c1
    Added some tests for S3 API and curl tests for HTTP.

commit 1c49def3ddd0b3f7cf97f131e269ad465c70a680
    Add yadro submodule

commit 2a91685f9108101ab523e05cc9287d0f5a20196b
    Fix.

commit 33fc2813e205766e69ef74a42a10850db6c63ce6
    Add debug.

commit aaaceca59e4c67253ecd4a741667b7327d1fb679
    Add env variables for data nodes.

commit 001cb26bcc22c8543fb2672564e898928d20622b
Merge: b48a87d c70da26
    Merge branch 'avolkov/try_pytest' into tmp_b

commit b48a87d9a09309fea671573ba6cf303c31b11b6a
    Added submodule

commit c70da265d319950977774e34740276f324eb57a7
    Added tests for S3 bucket API.

commit 3d335abe6de45d1859454f1ddf85a97514667b8f
    Added tests for S3 object API.

commit 2ac829c700f5bc20c28953f1d40cd953fed8b390
    flake8 changes for python_keywords module.

commit 2de5963e96b13a5e944906b695e5d9c0829de9ad
    Add pytest tests.

commit 4472c079b9dfd979b7c101bea32893c80cb1fe57
    Add pytest tests.

Signed-off-by: a.y.volkov <a.y.volkov@yadro.com>
2022-08-05 13:29:30 +03:00
build_assets [#145][#153]: added neofs-keywords as a module 2022-02-17 14:34:47 +03:00
configuration added yaml configuration file for devenv 2022-06-30 18:11:39 +03:00
neofs-keywords@1d7ebe1d6d Add test suites for acl, container and node management 2022-08-05 13:29:30 +03:00
neofs_cli_configs small fixes after [#237] 2022-06-29 16:30:45 +03:00
pytest_tests Add test suites for acl, container and node management 2022-08-05 13:29:30 +03:00
robot Add test suites for acl, container and node management 2022-08-05 13:29:30 +03:00
venv updated requirements.txt for venv.localtest 2022-07-15 17:04:42 +03:00
.flake8 Add pytest tests. 2022-07-08 17:45:32 +03:00
.gitignore Add test suites for acl, container and node management 2022-08-05 13:29:30 +03:00
.gitmodules fixes and refactoring in HTTP and S3 tests 2022-03-14 10:16:06 +03:00
Makefile Add test suites for acl, container and node management 2022-08-05 13:29:30 +03:00
README.md added pytest instructions into readme 2022-07-22 13:33:25 +03:00
requirements.txt [#103] Test to check eACL filter keys for objects 2021-11-24 16:54:00 +03:00
venv_template.mk python3.8 -> python3.9 in venv.localtest 2022-05-16 12:58:57 +03:00

Testcases execution

Initial preparation

  1. Install neofs-cli

    • git clone git@github.com:nspcc-dev/neofs-node.git
    • cd neofs-node
    • make
    • sudo cp bin/neofs-cli /usr/local/bin/neofs-cli
  2. Install neofs-authmate

    • git clone git@github.com:nspcc-dev/neofs-s3-gw.git
    • cd neofs-s3-gw
    • make
    • sudo cp bin/neofs-authmate /usr/local/bin/neofs-authmate
  3. Install neo-go

    • git clone git@github.com:nspcc-dev/neo-go.git
    • cd neo-go
    • git checkout v0.92.0 (or the current version in the neofs-dev-env)
    • make
    • sudo cp bin/neo-go /usr/local/bin/neo-go or download binary from releases: https://github.com/nspcc-dev/neo-go/releases
  4. Clone neofs-dev-env git clone git@github.com:nspcc-dev/neofs-dev-env.git

Note that we expect neofs-dev-env to be located under the <testcases_root_dir>/../neofs-dev-env directory. If you put this repo in any other place, manually set the full path to neofs-dev-env in the environment variable DEVENV_PATH at this step.

  1. Make sure you have installed all of the following prerequisites on your machine
make
python3.9
python3.9-dev
libssl-dev

As we use neofs-dev-env, you'll also need to install prerequisites of this repository.

Robot Framework

Run

  1. Prepare virtualenv
$ make venv.localtest
$ . venv.localtest/bin/activate
  1. Run tests

In the activated virtualenv, execute the following command(s) to run a singular testsuite or all the suites in the directory

$ robot --outputdir artifacts/ robot/testsuites/integration/<UserScenario>
$ robot --outputdir artifacts/ robot/testsuites/integration/<UserScenario>/<testcase>.robot

Generation of documentation

To generate Keywords documentation:

python3 -m robot.libdoc robot/resources/lib/neofs.py docs/NeoFS_Library.html
python3 -m robot.libdoc robot/resources/lib/payment_neogo.py docs/Payment_Library.html

To generate testcases documentation:

python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html

Source code overview

robot/ - Files related/depended on Robot Framework.

robot/resources/ - All resources (Robot Framework Keywords, Python Libraries, etc) which could be used for creating test suites.

robot/resources/lib/ - Common Python Libraries depended on Robot Framework (with Keywords). For example neofs.py, payment.py.

robot/variables/ - All variables for tests. It is possible to add the auto-loading logic of parameters from the smart-contract in the future. Contain python files.

robot/testsuites/ - Robot TestSuites and TestCases.

robot/testsuites/integration/ - Integration test suites and testcases

Code style

Robot Framework keyword should use space as a separator between particular words

The name of the library function in Robot Framework keyword usage and the name of the same function in the Python library must be identical.

The name of GLOBAL VARIABLE must be in UPPER CASE, the underscore ('_')' symbol must be used as a separator between words.

The name of local variable must be in lower case, the underscore symbol must be used as a separator between words.

The names of Python variables, functions and classes must comply with accepted rules, in particular: Name of variable/function must be in lower case with underscore symbol between words Name of class must start with a capital letter. It is not allowed to use underscore symbol in name, use capital for each particular word. For example: NeoFSConf

Name of other variables should not be ended with underscore symbol

On keywords definition, one should specify variable type, e.g. path: str

Robot style

You should always complete the [Tags] and [Documentation] sections for Testcases and Documentation for Test Suites.

Robot-framework User Guide

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html

PyTest

Tests written with PyTest framework are located under pytest_tests/testsuites directory.

Run and get report

  1. Prepare virtualenv
$ make venv.local-pytest
$ . venv.local-pytest/bin/activate
  1. Install Allure CLI

Allure CLI installation is not an easy task. You may select one of the following ways. If none of the options would help you please complete the instruction with your approach:

$ wget https://github.com/allure-framework/allure2/releases/download/2.18.1/allure_2.18.1-1_all.deb
$ sudo apt install ./allure_2.18.1-1_all.deb

You also need the default-jre package installed.

  1. Run tests

In the activated virtualenv, execute the following command(s) to run a singular testsuite or all the suites in the directory

$ pytest --alluredir my-allure-123 pytest_tests/testsuites/object/test_object_api.py
$ pytest --alluredir my-allure-123 pytest_tests/testsuites/
  1. Generate report

To generate a report, execute the command allure generate. The report will be under the allure-report directory.

$ allure generate my-allure-123
$ ls allure-report/
app.js  data  export  favicon.ico  history  index.html  plugins  styles.css  widgets

To inspect the report in a browser, run

$ allure serve my-allure-123