github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/python/tests/s3compat/README.md (about) 1 # Minio s3 tests 2 3 This directory contains a modified version of the s3 tests from the [Minio Python SDK](https://github.com/minio/minio-py). 4 * `minio_helpers.py` replaces the default minio client initialization and test setup. 5 * `run_tests` serves as an entry point and specifies which tests to include in a given test run. 6 * `tests.py` is imported directly from the minio functional test suite and is unmodified. 7 8 The goal of this module is to debug and maintain AIS s3 compatibility 9 10 These tests are NOT verified as working on Windows, and many may not work properly because the tests expect to run 11 against the Minio client. 12 13 The tests are divided into two sections: 14 1. Verified as working -- AIS responds as an s3 client should 15 2. Unverified -- these tests expect s3 behavior AIS does not currently support. 16 17 --- 18 19 ## Cluster configuration 20 21 First, the AIS cluster to test against must be configured to run as an s3 client and run with AWS-style MD5 checksums. 22 This can be set with AIS cli. 23 24 ais config cluster features S3-API-via-Root 25 ais config cluster checksum.type=md5 26 27 --- 28 29 ## Environment variables 30 31 The default is to run all tests (`S3_COMPAT_RUN_ALL=True`). 32 To run only tests we expect to succeed, set the environment variable `S3_COMPAT_RUN_ALL=False` 33 34 To run a specific set of tests, set the environment variable `S3_COMPAT_TEST_LIST` to the test names separated by commas 35 e.g. 36 37 export S3_COMPAT_TEST_LIST="test_remove_object,test_remove_object_version" 38 39 To exit tests on the first failure, set the environment variable `S3_COMPAT_STRICT=True` 40 41 Additional cluster connection details can be defined with the following parameters: 42 * AIS_ENDPOINT (default localhost:8080) 43 * ACCESS_KEY 44 * SECRET_KEY 45 46 --- 47 48 ## Running compatibility tests 49 See above [Environment variables](#environment-variables) section for selecting tests to run. 50 51 Because these tests use the Minio client rather than boto3, running does not require importing the 52 `aistore.botocore_patch` module. 53 54 55 From `/python` directory: 56 57 make python_s3_compat_test 58 59 Or: 60 - Install the prerequisites from the requirements file: `pip3 install -r tests/s3compat/requirements` 61 - Run `python3 tests/s3compat/run_tests.py` 62 63 64 ## References 65 66 * [Minio Python SDK](https://github.com/minio/minio-py) 67 * [Python Tests README](https://github.com/NVIDIA/aistore/tree/main/python/tests/README.md)