{"id":25284269,"url":"https://github.com/elastos/elastos.hive.httpapitests","last_synced_at":"2025-04-06T14:35:38.242Z","repository":{"id":75483094,"uuid":"163483185","full_name":"elastos/Elastos.Hive.HttpAPITests","owner":"elastos","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-30T11:46:22.000Z","size":107,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-02-12T20:38:47.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-29T06:28:58.000Z","updated_at":"2021-11-12T03:21:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"98b4d95d-7222-4298-9e2d-8120a4d93407","html_url":"https://github.com/elastos/Elastos.Hive.HttpAPITests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.Hive.HttpAPITests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.Hive.HttpAPITests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.Hive.HttpAPITests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastos%2FElastos.Hive.HttpAPITests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastos","download_url":"https://codeload.github.com/elastos/Elastos.Hive.HttpAPITests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247496582,"owners_count":20948261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-12T20:37:05.834Z","updated_at":"2025-04-06T14:35:38.232Z","avatar_url":"https://github.com/elastos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"HTTP.API Testing Framework \n======================================\n# Overview\n    This framework for ipfs-cluster http api testing. \n    Use this framework, you can config a file which will make the framework runs the specified testcase suite. \n    After each running, you can find log file and report html in \"result\" folder, the report will show the pass, fail or error cases.\n    \n# Framework Layout\n\n* `config`(This is a directory.)\n    * `ipfs.conf` (A configuration file for ipfs cluster information)\n\n* `function`(This is a directory.)\n    * `ela_log.py` (Program file for log functions.)\n    * `func.py` (Program file for public functions.)\n    \n* `testCases` (This is a directory. It contains each test case file.)\n\n* `result` (This is a directory. It contains log and report directory for each running.)\n \n* `testFiles` (This is a directory. It contains config files for test cases and program.)\n    * `data.conf` (A file contains test data for each test case.)\n    \n* `http_api.py` (Framework start program file.)\n* `read_conf.py` (Function program file for read config information)\n* `run_case_list.txt` (Text file for config which test cases should run.)\n\n# Deployment Method\n\n* Setup python2.7 environment on windows 7 system.\n    \n\n::\n    \n    (1) Download \"Windows x86-64 MSI installer\" from https://www.python.org/downloads/release/python-2713/    \n    (2) Double click and install the package and add environment variables(C:\\Python27\\;C:\\Python27\\Scripts) into os path.\n     \n* Some python setup package can integrate \"pip\" tool. If not you should download and setup pip tools.\n\n::\n    \n    On windows OS run \"cmd\" command run `pip` if return \"Not internal or external commands or runnable programs\" means you don not have the tool.\n    \n    Method 1: \n        Use `easy_install` command, run `easy_install pip` \n    Method 2: \n        (1) Download \"pip-19.0.1.tar.gz\" from https://pypi.org/project/pip/#files .\n        (2) Decompression the tar.gz.\n        (3) Open `cmd` go into the pip directory, then run `python ez_setup`.\n    Method 3:\n        Downloading https://bootstrap.pypa.io/get-pip.py and running `python get-pip.py`\n     \n* Use pip tool setup some libraries. \n    \n    Command such as : pip install \"package-name\"\n    \n    ```shell\n    $ pip install html-testrunner\n    $ pip install requests\n    $ pip install requests_toolbelt\n    ```\n\t\n\tShould install html-testrunner, requests, requests_toolbelt.\n\n* If you can not import HTMTTestRunner, can download HTMLTestRunner.py (https://pypi.org/project/HTMLTestRunner/) then put into directory such as python27/lib\n* If you run this framework on windows OS, you should setup \"curl\" command. Download curl from https://curl.haxx.se/windows/\n* Config run_case_list.txt. If the line start with \"#\", framework will not run the cases.\n\n\n# How to config\n* Modify `run_case_list.txt`. Write all files name in it. The files name from directory `testCase`. If you don't want to some cases. Make the line start with \"#\".\n\n ::\n \n    testVersion\n    testId\n    testPeers\n    testPeersPid\n    testPins\n    testPinsCidSync\n    testPinsCidrRecover\n    testPinsRecover\n    testApiV0UidNew\n    testApiV0UidLogin\n    testApiV0UidInfo\n    testApiV0PinAdd\n    testApiV0PinLs\n    testApiV0PinRm\n    testApiV0FileLs\n    testApiV0FileAdd\n    testApiV0FileGet\n    testApiV0FileCat\n    testApiV0FilesCp\n    testApiV0FilesFlush\n    testApiV0FilesLs\n    testApiV0FilesMkdir\n    testApiV0FilesMv\n    testApiV0FilesRead\n    testApiV0FilesRm\n    testApiV0FilesStat\n    testApiV0FilesWrite\n    testApiV0NamePublish\n\n* Modify `config\\ipfs.conf`. The file contains ipfs-cluster information. There are three important parameters should be set.\n \n ::\n    \n    ipfs_master_api_baseurl         =   http://10.10.88.88      # One ipfs-cluster node http-api address baseurl. \n    ipfs_master_api_port\t          =   9094                    # The node api port number.\n    ipfs_master_api_endpoint_port   =   9095                    # The node api endpoint port.\n    \n    An example of http-api address: http://10.10.88.88:9094/version\n    \n    \n* Modify `testFiles\\data.conf`. The file contains testing data for each api. \n\n ::\n \n    In this document you can config test data for each http-api. Then each \u003ctestcase\u003e.py file will use the testing data to do test. \n    For example:\n    \n\n        [API_V0_UID_NEW]                                    # Branch name, use upper letters and \"_\".  /api/v0/uid/new =\u003e API_V0_UID_NEW\n        api = /api/v0/uid/new                               # HTTP-API string\n        normal_response_body = {\"UID\":\"\",\"PeerID\":\"\"}       # Response body.\n                                \n        other_parameters_cases   =                          # Some api strings for test.\n\n                    XXX=1,\n                    verbose=1\u0026xxx=1,\n                    xxx=xxx\u0026verbose=0,\n                    quiet=1\u0026verbose=1,\n                    quiet=1\u0026verbose=0,\n                    quiet=0\u0026verbose=0,\n                    quiet=0\u0026verbose=xxx,\n                    quiet=xxx\u0026verbose=1\n            \n    You can also config some testing data in [common] branch. \n\n# Start testing and check result\n\n* Run command.\n    ```shell\n    $ python http_api.py\n    ```\n* Check result in the directory \"result\".\n  Each time run the framework will generate a new folder named \u003ctime\u003e in \"result\". It contains two files: output.log and report.html.\n  \n  ::\n        \n        You can check the log file for testing detail.\n        \n        2019-01-28 15:46:58,163 - root - INFO - -------------------------\n        2019-01-28 15:46:58,163 - root - INFO - [testApiV0UidLogin.py] TEST CASE: [test_normal_get]\n        2019-01-28 15:46:58,163 - root - INFO - -------------------------\n        2019-01-28 15:46:58,163 - root - INFO - curl --connect-timeout 10 -m 10 http://10.10.88.88:9095/api/v0/uid/new\n        2019-01-28 15:46:58,855 - root - INFO - uid-6024939e-5280-40dc-a507-798ba140672b\n        2019-01-28 15:46:58,857 - root - INFO - curl --connect-timeout 10 -m 10 -o /dev/null -s -w %{http_code} \"http://10.10.88.88:9095/api/v0/uid/login?uid=uid-6024939e-5280-40dc-a507-798ba140672b\"\n        2019-01-28 15:46:59,055 - root - INFO - 200\n        2019-01-28 15:46:59,069 - root - INFO - -------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastos%2Felastos.hive.httpapitests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastos%2Felastos.hive.httpapitests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastos%2Felastos.hive.httpapitests/lists"}