Skip to content

Commit

Permalink
update ceph s3 version to newest
Browse files Browse the repository at this point in the history
Signed-off-by: nadav mizrahi <[email protected]>
  • Loading branch information
nadavMiz committed Jun 6, 2023
1 parent a6d99e0 commit 78543b2
Show file tree
Hide file tree
Showing 8 changed files with 973 additions and 922 deletions.
85 changes: 42 additions & 43 deletions docs/dev_guide/ceph_s3_tests/ceph_s3_tests_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export PYTHONWARNINGS="ignore"
### 5) Run a Test (Inside The Tester Pod)
To run a test, from noobaa working directory:
```bash
S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf ./src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/bin/nosetests <test_name>
S3TEST_CONF=$PWD/src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf tox -c src/test/system_tests/ceph_s3_tests/s3_tests/tox.ini $PWD/src/test/system_tests/ceph_s3_tests/s3-tests/<test_name>
```
This should run the test on the noobaa deployment we've set up.

Expand Down Expand Up @@ -173,34 +173,24 @@ Since the file `./src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/fun
5) Build the tester image again, deploy noobaa, and run the test (repeat the steps starting from 'Build Core And Tester Images (Noobaa-Core)' above).

#### B. Temporary change - this change will be saved in the file inside the container, useful when you need a small change.
1) Find container ID: `minikube ssh docker container ls | grep test`
2) Enter container as the root user: `minikube ssh "docker container exec -it -u 0 <Container ID> /bin/bash"`
3) Change file permissions: `chmod 777 ./src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py`

You can edit the test by going to the test file and editing the test function. e.g. if you are working on test `s3tests_boto3.functional.test_s3:test_set_bucket_tagging` then you should `vi ./src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py` and search for the function `test_set_bucket_tagging`.
## Compare to AWS Response (Inside Tester Pod)
Prerequisites:
Following the 'Run a Single Ceph S3 Test' steps until 'Deploy The Tester Deployment (Noobaa-Core Tab)'.

In this section we will do some manual changes that will allow you to check AWS response for a specific test (tests that do not use neither ACL nor tenant group).
1) Find container ID: `minikube ssh docker container ls | grep test`
2) Enter container as the root user: `minikube ssh "docker container exec -it -u 0 <Container ID> /bin/bash"` (We use root user because we want to change content of read-only files).
3) Go to noobaa working directory: `cd /root/node_modules/noobaa-core/`
4) Run the script that will create the necessary accounts in noobaa and update the Ceph S3 tests config file accordingly: `node ./src/test/system_tests/ceph_s3_tests/test_ceph_s3_config_setup.js`
5) Change the configuration file to match AWS details, `vi ./src/test/system_tests/ceph_s3_tests/test_ceph_s3_config_setup.js`:
1) copy configuration file:
```bash
cp .src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf .src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf.aws
```
2) Change the new configuration file to match AWS details, `vi .src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf.aws`:
* host = s3.amazonaws.com
* bucket prefix = choose_name (for example: `bucket prefix = foo-bucket` you will need to manually delete it from AWS, and its name will be `foo-bucket1`, it adds suffix of 1).
* access_key, secret_key appears 3 times each in the file.
6) Since we changed the name of the bucket and we will manually delete the bucket we will remove it from the code (add comments lines) by `vi ./src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/__init__.py` inside `teardown` and `setup` functions:
```python
# nuke_prefixed_buckets(prefix=prefix)
# nuke_prefixed_buckets(prefix=prefix, client=alt_client)
# nuke_prefixed_buckets(prefix=prefix, client=tenant_client)
```
7) Run a single test:
3) Running tests with the new configuration files will run against AWS:
```bash
S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf ./src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/bin/nosetests <test_name>
S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf.aws tox -c src/test/system_tests/ceph_s3_tests/s3_tests/tox.ini $PWD/src/test/system_tests/ceph_s3_tests/s3-tests/<test_name>
```
8) Manually delete the bucket that was created in you AWS account (for example `foo-bucket1`).
## Examples

## Running All the Tests
Expand All @@ -225,38 +215,47 @@ CEPH TEST SUMMARY: Suite contains 812, ran 387 tests, Passed: 387, Skipped: 0, F
Following the 'Run a Single Ceph S3 Test' steps.

### 1) Test Pass
For example: `s3tests_boto3.functional.test_s3:test_basic_key_count`
For example: `s3tests_boto3/functional/test_s3.py::test_basic_key_count`
```
bash-4.4$ S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf ./src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/bin/nosetests s3tests_boto3.functional.test_s3:test_basic_key_count
.
----------------------------------------------------------------------
Ran 1 test in 4.914s
bash-4.4$ S3TEST_CONF=$PWD/src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf tox -c src/test/system_tests/ceph_s3_tests/s3-tests/tox.ini -- --disable-pytest-warnings $PWD/src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py::test_account_usage
...
====================================================================================== 1 passed, 1 warning in 15.71s =======================================================================================
_________________________________________________________________________________________________ summary __________________________________________________________________________________________________
py: commands succeeded
congratulations :)
OK
```
### 2) Test Fail
For example: `s3tests_boto3.functional.test_s3:test_account_usage`
For example: `s3tests_boto3/functional/test_s3::test_account_usage.py`

```
bash-4.4$ S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf ./src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/bin/nosetests s3tests_boto3.functional.test_s3:test_account_usage
E
======================================================================
ERROR: s3tests_boto3.functional.test_s3.test_account_usage
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/node_modules/noobaa-core/src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/lib/python3.6/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/root/node_modules/noobaa-core/src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py", line 1325, in test_account_usage
summary = parsed['Summary']
KeyError: 'Summary'
-------------------- >> begin captured logging << --------------------
bash-4.4$ S3TEST_CONF=$PWD/src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf tox -c src/test/system_tests/ceph_s3_tests/s3-tests/tox.ini src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.
...
<view the logs>
================================================================================================= FAILURES =================================================================================================
____________________________________________________________________________________________ test_account_usage ____________________________________________________________________________________________
...
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 1 test in 0.391s
------------------------------------------------------------------------------------------ Captured stdout setup -------------------------------------------------------------------------------------------
...
----------------------------------------------------------------------------------------- Captured stdout teardown -----------------------------------------------------------------------------------------
...
========================================================================================= short test summary info ==========================================================================================
FAILED s3tests_boto3/functional/test_s3.py::test_account_usage - KeyError: 'Summary'
====================================================================================== 1 failed, 2 warnings in 4.01s =======================================================================================
ERROR: InvocationError for command '/root/node_modules/noobaa-core/src/test/system_tests/ceph_s3_tests/s3-tests/.tox/py/bin/pytest --disable-pytest-warnings /root/node_modules/noobaa-core/src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py::test_account_usage' (exited with code 1)
_________________________________________________________________________________________________ summary __________________________________________________________________________________________________
ERROR: py: commands failed
FAILED (errors=1)
Expand All @@ -266,7 +265,7 @@ If you will use a test name that not written in the defined structure (as mentio

For example: `s3tests_boto3.functional.test_s3.test_account_usage` instead of `s3tests_boto3.functional.test_s3:test_account_usage` (notice the use of the sign `:` before test).
```
bash-4.4$ S3TEST_CONF=src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf ./src/test/system_tests/ceph_s3_tests/s3-tests/virtualenv/bin/nosetests s3tests_boto3.functional.test_s3.test_account_usage
bash-4.4$ S3TEST_CONF=$PWD/src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf .tox -c src/test/system_tests/ceph_s3_tests/s3-tests/tox.ini src/test/system_tests/ceph_s3_tests/s3-tests/s3tests_boto3/functional/test_s3.py::test_account_usage
----------------------------------------------------------------------
Ran 0 tests in 0.389s
Expand Down
Loading

0 comments on commit 78543b2

Please sign in to comment.