测试玻璃墙AWS产品的小包装

glasswall-aws-product-test-automation的Python项目详细描述


aws产品测试自动化

用于测试Glasswall AWS产品端点的小软件包

入门

首次下载:

pip install glasswall-aws-product-test-automation

要升级:

^{pr2}$

先决条件

用法

使用jwt_令牌运行产品:

s93_test_automation --product "PRODUCT" --key_type "jwt_token"  --endpoint "ENDPOINT" --api_key "API_KEY" --jwt_token "JWT_TOKEN" --invalid_token "INVALID_TOKEN"

要使用x\u api_密钥为产品运行:

s93_test_automation --product "PRODUCT" --key_type "x_api_key" --endpoint "ENDPOINT" --api_key "API_KEY" --x_api_key "X_API_KEY"

参数

ArgumentShortNecessityDescription
--product-pRequired(str) Name of a product corresponding to a directory in s93_test_automation/integration_tests.e.g. ^{}
--endpoint-eRequired(str) API Gateway product endpoint url. e.g. ^{}
--key_type-kRequired(str) What type of access key is being used.e.g. ^{}
--api_key-aRequired(str) An AWS API key that grants access to the presigned url generator.e.g. ^{}
--x_api_key-xOptional(str) An AWS API key that grants access to the endpoint specified as well as other Glasswall product endpoints.e.g. ^{}
--jwt_token-jOptional(str) An authorization token that grants access to the endpoint specified.e.g. ^{}
--invalid_token-iOptional(str) An invalid version of the jwt_token that will not grant access to the endpoint specified .e.g. ^{}
--test_files-tOptionalThis functionality is currently disabled.(str) A directory containing external files to perform basic status code tests on. Defaults to ^{}
--logging_level-lOptional(str) The logging level of the Python logging module. Defaults to ^{}. Valid values are: ^{},^{},^{},^{},^{},^{}

示例运行(2020/07/17)

s93_test_automation --product "rebuild" --key_type "x_api_key" --endpoint "***" --api_key "***" --x_api_key "***"
INFO:glasswall:Setting up Test_rebuild_base64
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_xapi_base64.Test_rebuild_base64)
1Test_File submit using base64 code & less than 6mb with valid x-api key is successful ... ok
test_post___bmp_32kb_invalid_api_key___returns_status_code_403 (test_rebuild_xapi_base64.Test_rebuild_base64)
3-Test_File submit using base64 code & less than 6mb with invalid x-api key is unsuccessful ... ok
test_post___bmp_over_6mb___returns_status_code_413 (test_rebuild_xapi_base64.Test_rebuild_base64)
2-Test_Accurate error returned for a over 6mb file submit using base64 code with valid x-api key ... skipped '6 - 10mb edge case, results in status_code 500'
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_xapi_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_xapi_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_xapi_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___external_files___returns_200_ok_for_all_files (test_rebuild_xapi_base64.Test_rebuild_base64) ... skipped ''
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_xapi_base64.Test_rebuild_base64)
12-Test_upload of files with issues and or malware using base64 code with valid x-api key ... ok
test_post___txt_1kb___returns_status_code_422 (test_rebuild_xapi_base64.Test_rebuild_base64)
10-Test_unsupported file upload using base64 code & less than 6mb with valid x-api key is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_xapi_base64.Test_rebuild_base64)
12-Test_upload of files with issues and or malware using base64 code with valid x-api key ... ok
INFO:glasswall:Setting up Test_rebuild_file
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_xapi_file.Test_rebuild_file)
1Test_File submit using file endpoint & less than 6mb with valid x-api key is successful ... ok
test_post___bmp_32kb_invalid_x_api_key___returns_status_code_403 (test_rebuild_xapi_file.Test_rebuild_file)
3-Test_File submit using file endpoint & less than 6mb with invalid x-api key is unsuccessful ... ok
test_post___bmp_over_6mb___returns_status_code_413 (test_rebuild_xapi_file.Test_rebuild_file)
2-Test_Accurate error returned for a over 6mb file submit using file endpoint with valid x-api key ... skipped '6 - 10mb edge case, results in status_code 500'
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_xapi_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_xapi_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_xapi_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___external_files___returns_200_ok_for_all_files (test_rebuild_xapi_file.Test_rebuild_file) ... skipped ''
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_xapi_file.Test_rebuild_file)
12-Test_upload of files with issues and or malware using file endpoint with valid x-api key ... ok
test_post___txt_1kb___returns_status_code_422 (test_rebuild_xapi_file.Test_rebuild_file)
10-Test_unsupported file upload using file endpoint & less than 6mb with valid x-api key is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_xapi_file.Test_rebuild_file)
12-Test_upload of files with issues and or malware using file endpoint with valid x-api key ... ok
INFO:glasswall:Setting up Test_rebuild_url
INFO:glasswall:Generating presigned urls...
INFO:glasswall:File uploaded to: customer-uploaded-files/b1d9261c-06c1-41e1-9290-8111decd60a2/17-07-2020 05:04:46/bmp_32kb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/6fc09b7a-c613-48c3-b8c7-8658da349c5a/17-07-2020 05:04:49/bmp_5.93mb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/8834a213-54a8-45db-87bc-0b62b9d10c03/17-07-2020 05:04:50/bmp_6.12mb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/b70670c1-1481-48b3-900e-6b6d4d267817/17-07-2020 05:04:51/txt_1kb.txt
INFO:glasswall:File uploaded to: customer-uploaded-files/7e6d42e1-379f-4b75-94af-ad3744418eb7/17-07-2020 05:04:51/doc_embedded_images_12kb.docx
INFO:glasswall:File uploaded to: customer-uploaded-files/07c1dd4b-f7df-4bcf-adae-57ea18b01cb5/17-07-2020 05:04:51/CalcTest.xls
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_xapi_url.Test_rebuild_url)
5-Test_File submit using pre-signed url with valid x-api key is successful ... ok
test_post___bmp_32kb_invalid_api_key___returns_status_code_403 (test_rebuild_xapi_url.Test_rebuild_url)
6b-Test_File submit using pre-signed url with invalid x-api key is unsuccessful ... ok
test_post___bmp_32kb_no_api_key___returns_status_code_403 (test_rebuild_xapi_url.Test_rebuild_url)
6a-Test_File submit using pre-signed url with no x-api key is unsuccessful ... ok
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_xapi_url.Test_rebuild_url)
7a-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_xapi_url.Test_rebuild_url)
7c-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_xapi_url.Test_rebuild_url)
7b-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_xapi_url.Test_rebuild_url)
11b-Test_upload of files with issues and or malware using presigned with valid x-api key ... skipped 'waiting for update to the presigned url lambda to allow files with no extension'
test_post___txt_1kb___returns_status_code_422 (test_rebuild_xapi_url.Test_rebuild_url)
9-Test_unsupported file upload using pre-signed url with valid x-api key is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_xapi_url.Test_rebuild_url)
11a-Test_upload of files with issues and or malware using presigned with valid x-api key ... ok

----------------------------------------------------------------------
Ran 29 tests in 11.399s

OK (skipped=5)



s93_test_automation --product "rebuild" --key_type "jwt_token" --endpoint "***" --api_key "***" --jwt_token "***" --invalid_token "***"
INFO:glasswall:Setting up Test_rebuild_base64
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_jwt_base64.Test_rebuild_base64)
1Test_File submit using base64 code & less than 6mb with valid jwt token is successful ... ok
test_post___bmp_32kb_invalid_token___returns_status_code_403 (test_rebuild_jwt_base64.Test_rebuild_base64)
3-Test_File submit using base64 code & less than 6mb with invalid jwt token is unsuccessful ... ok
test_post___bmp_over_6mb___returns_status_code_413 (test_rebuild_jwt_base64.Test_rebuild_base64)
2-Test_Accurate error returned for a over 6mb file submit using base64 code with valid jwt token ... skipped '6 - 10mb edge case, results in status_code 500'
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_jwt_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_jwt_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_jwt_base64.Test_rebuild_base64)
4-Test_The default cmp policy is applied to submitted file using base64 code ... ok
test_post___external_files___returns_200_ok_for_all_files (test_rebuild_jwt_base64.Test_rebuild_base64) ... skipped ''
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_jwt_base64.Test_rebuild_base64)
12-Test_upload of files with issues and or malware using base64 code with valid jwt token ... ok
test_post___txt_1kb___returns_status_code_422 (test_rebuild_jwt_base64.Test_rebuild_base64)
10-Test_unsupported file upload using base64 code & less than 6mb with valid jwt token is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_jwt_base64.Test_rebuild_base64)
12-Test_upload of files with issues and or malware using base64 code with valid jwt token ... ok
INFO:glasswall:Setting up Test_rebuild_file
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_jwt_file.Test_rebuild_file)
1Test_File submit using file endpoint & less than 6mb with valid jwt token is successful ... ok
test_post___bmp_32kb_invalid_token___returns_status_code_403 (test_rebuild_jwt_file.Test_rebuild_file)
3-Test_File submit using file endpoint & less than 6mb with invalid token is unsuccessful ... ok
test_post___bmp_over_6mb___returns_status_code_413 (test_rebuild_jwt_file.Test_rebuild_file)
2-Test_Accurate error returned for a over 6mb file submit using file endpoint with valid jwt token ... skipped '6 - 10mb edge case, results in status_code 500'
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_jwt_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_jwt_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_jwt_file.Test_rebuild_file)
4-Test_The default cmp policy is applied to submitted file using file endpoint ... ok
test_post___external_files___returns_200_ok_for_all_files (test_rebuild_jwt_file.Test_rebuild_file) ... skipped ''
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_jwt_file.Test_rebuild_file)
12-Test_upload of files with issues and or malware using file endpoint with valid jwt token ... ok
test_post___txt_1kb___returns_status_code_422 (test_rebuild_jwt_file.Test_rebuild_file)
10-Test_unsupported file upload using file endpoint & less than 6mb with valid jwt token is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_jwt_file.Test_rebuild_file)
12-Test_upload of files with issues and or malware using file endpoint with valid jwt token ... ok
INFO:glasswall:Setting up Test_rebuild_url
INFO:glasswall:Generating presigned urls...
INFO:glasswall:File uploaded to: customer-uploaded-files/ef394621-5904-45ff-b20a-c8f531fd6711/17-07-2020 05:07:14/bmp_32kb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/2bddfa9f-fbeb-4f2e-bb77-1fa38cc18947/17-07-2020 05:07:14/bmp_5.93mb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/9bc2bc11-b09c-4cd0-aed3-149350f0858a/17-07-2020 05:07:16/bmp_6.12mb.bmp
INFO:glasswall:File uploaded to: customer-uploaded-files/5da1f694-a6d3-4499-961c-29ab0e35b177/17-07-2020 05:07:17/txt_1kb.txt
INFO:glasswall:File uploaded to: customer-uploaded-files/1c94b1bb-bb49-4fdf-b79c-efbbfbc0a4e0/17-07-2020 05:07:17/doc_embedded_images_12kb.docx
INFO:glasswall:File uploaded to: customer-uploaded-files/73c69a0c-057d-41a5-ad9b-078fc65d1426/17-07-2020 05:07:17/CalcTest.xls
test_post___bmp_32kb___returns_status_code_200_protected_file (test_rebuild_jwt_url.Test_rebuild_url)
5-Test_File submit using pre-signed url with valid jwt token is successful ... ok
test_post___bmp_32kb_invalid_token___returns_status_code_403 (test_rebuild_jwt_url.Test_rebuild_url)
6b-Test_File submit using pre-signed url with invalid token is unsuccessful ... ok
test_post___bmp_32kb_no_jwt_token___returns_status_code_403 (test_rebuild_jwt_url.Test_rebuild_url)
6a-Test_File submit using pre-signed url with no jwt token is unsuccessful ... ok
test_post___doc_embedded_images_12kb_content_management_policy_allow___returns_status_code_200_identical_file (test_rebuild_jwt_url.Test_rebuild_url)
7a-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___doc_embedded_images_12kb_content_management_policy_disallow___returns_status_code_200_disallowed_json (test_rebuild_jwt_url.Test_rebuild_url)
7c-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___doc_embedded_images_12kb_content_management_policy_sanitise___returns_status_code_200_sanitised_file (test_rebuild_jwt_url.Test_rebuild_url)
7b-Test_The default cmp policy is applied to submitted file using pre-signed url ... ok
test_post___jpeg_corrupt_10kb___returns_status_code_422 (test_rebuild_jwt_url.Test_rebuild_url)
11b-Test_upload of files with issues and or malware using presigned with valid jwt token ... skipped 'waiting for update to the presigned url lambda to allow files with no extension'
test_post___txt_1kb___returns_status_code_422 (test_rebuild_jwt_url.Test_rebuild_url)
9-Test_unsupported file upload using pre-signed url with valid jwt token is unsuccessful ... ok
test_post___xls_malware_macro_48kb___returns_status_code_200_sanitised_file (test_rebuild_jwt_url.Test_rebuild_url)
11a-Test_upload of files with issues and or malware using presigned with valid jwt token ... ok

----------------------------------------------------------------------
Ran 29 tests in 12.822s

OK (skipped=5)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java希望直接扫描要上传到网页的文档   java JavaFX使对象可见,但不使用(忽略)点击   java LibGdx奇怪的纹理行为   java JavaFx ComboBox在第一次单击时未获得正确的值   api WebDav服务器库最好使用Java   java在Android中维护应用程序状态   java保存在Android中拖放RecyclerView后所做的更改我已经阅读了所有内容   无法读取项目中所需库tomcatembedwebsocket的java存档,或者该存档不是有效的ZIP文件   c#类在系统中有哪些关联?如何在UML中最好地表示它们?   java如何使用bazaar访问两台计算机上的同一文件夹   Java易失性与缓存一致性   java如何解决http11。校长:例外?   java liferaymavenplugin从maven Liferay 6.2.5(6.2 ga6)部署war   安卓的jar for java在哪里。木卫一。文件   java邻接矩阵中BFS的顺序是什么?   虚拟机如何从java启动linux虚拟机?   向DefaultListModel添加元素时java JList未更新   java JMSListener批注无法与REST服务一起使用   java DirectoryStream返回路径的顺序是什么?文件名,上次修改,文件大小?   java DropWizard Hibernate doc想说什么?