S3-test performed by using an interface compatibility test ceph

Verbatim https://www.dazhuanlan.com/2019/08/26/5d63059f52453/



s3

Foreword

ceph of rgw able to provide a compatibility interface s3, since it is compatible, of course, will not be compatible with all interfaces, then we need to have a tool to interface validation and testing, other testing tools that have similar inside posix interface authentication tool, such tool is running test, to pass or not pass the output list of

There is a nice place with such tools is the ability to verify the interface, the interface to avoid damage caused by updated versions

installation

Direct clone of the official branches down, much of the total number of documents, quickly download

[root@lab101 s3]
[root@lab101 s3]

Note that at this place there are versions of the points, when testing required by the corresponding version, here jewel version we tested is switched to the branch (critical step) jewel of

[root@lab101 s3-tests]# git branch -a
[root@lab101 s3-tests]# git checkout -b jewel remotes/origin/ceph-jewel
[root@lab101 s3-tests]# ./bootstrap

Enter the directory which is initialized to perform ./bootstrap related work, this is to download some related libraries and software packages, and created a python virtual environment, if copied from elsewhere over the code is best removed python virtual environment , let the process to re-create their own set of environmental

After performing the test configuration is to create a finished document test.conf

[DEFAULT]
## this section is just used as default for all the "s3 *"
## sections, you can place these variables also directly there

## replace with e.g. "localhost" to run against local software
host = 192.168.19.101

## uncomment the port to use something other than 80
port = 7481

## say "no" to disable TLS
is_secure = no

[fixtures]
## all the buckets created will start with this prefix;
## {random} will be filled with random characters to pad
## the prefix to 30 characters long, and avoid collisions
bucket prefix = cephtest-{random}-

[s3 main]
## the tests assume two accounts are defined, "main" and "alt".

## user_id is a 64-character hexstring
user_id = test01

## display name typically looks more like a unix login, "jdoe" etc
display_name = test01

## replace these with your access keys
access_key = test01
secret_key = test01

## replace with key id obtained when secret is created, or delete if KMS not tested
#kms_keyid = 01234567-89ab-cdef-0123-456789abcdef

[s3 alt]
## another user account, used for ACL-related tests
user_id = test02
display_name = test02
## the "alt" user needs to have email set, too
email = [email protected]
access_key = test02
secret_key = test02

The above information is required to create a good user ahead of time, with this machine radosgw-admin command in the cluster can be created

radosgw-admin user create --uid=test01 --display-name=test01 --access-key=test01 --secret-key=test01 --email=test[email protected]
radosgw-admin user create --uid=test02 --display-name=test02 --access-key=test02 --secret-key=test02 --email=test[email protected]

创建好了以后就可以开始测试了

[root@lab101 s3-tests]# S3TEST_CONF=test.conf ./virtualenv/bin/nosetests -a '!fails_on_rgw'
..................................................SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.....................................................................................................................SSSS.......................................................................................................................................SSSS.......................................................
----------------------------------------------------------------------
Ran 408 tests in 122.087s

OK (SKIP=51)

正常测试完就应该是上面的ok的状态,也有可能某个版本的测试用例是写的支持,但是rgw也不一定就做好了,这个需要自己判断一下

总结

了解软件适配的接口,针对接口进行相关测试即可

变更记录

Why Who When
创建 Wuhan - operation and maintenance - mill slag 2018-06-27
Modify configuration files to user error Wuhan - operation and maintenance - mill slag 2018-09-04

Guess you like

Origin www.cnblogs.com/petewell/p/11410492.html