{"id":25000549,"url":"https://github.com/gluster/glusto-tests","last_synced_at":"2025-07-05T22:33:24.990Z","repository":{"id":11324299,"uuid":"69304030","full_name":"gluster/glusto-tests","owner":"gluster","description":"Functional test framework for glusterfs.","archived":false,"fork":false,"pushed_at":"2022-02-14T13:47:45.000Z","size":3452,"stargazers_count":19,"open_issues_count":0,"forks_count":43,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-12T08:52:23.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gluster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-27T00:26:13.000Z","updated_at":"2022-01-06T07:39:45.000Z","dependencies_parsed_at":"2022-07-26T15:32:28.962Z","dependency_job_id":null,"html_url":"https://github.com/gluster/glusto-tests","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gluster/glusto-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fglusto-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fglusto-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fglusto-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fglusto-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gluster","download_url":"https://codeload.github.com/gluster/glusto-tests/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fglusto-tests/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261931544,"owners_count":23232106,"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-04T19:35:42.831Z","updated_at":"2025-06-25T18:35:39.015Z","avatar_url":"https://github.com/gluster.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glusto Tests\n\n`glusto-tests` repo contains automated testcases for testing gluster software.\nIt provides the Libraries/Modules necessary for automating the gluster tests.\nLatest Code for this repo is managed on review.gluster.org\n\nThe Libraries/Modules/Tests in glusto-tests are written using the `glusto`\nframework. TestCases in glusto-tests can we written/run using standard\nPyUnit, PyTest or Nose methodologies as supported by `glusto` framework.\n\nRefer the [glusto-doc](http://glusto.readthedocs.io/en/latest/) for info on `glusto` framework.\nIssues need to be filled against the [Github](https://github.com/gluster/glusto-tests/issues) repo.\n\nTo automate/run glusto-tests we need to install the following packages:\n---------------------------------------------------------------------\n-   glusto\n-   glustolibs-gluster\n-   glustolibs-io\n-   glustolibs-misc\n-   gdeploy\n\nHow to install glusto:\n----------------------\nOne can use either of the two methods.\n\n-   using pip\n\n        # pip install --upgrade git+git://github.com/loadtheaccumulator/glusto.git\n\n-   using git\n\n        # git clone https://github.com/loadtheaccumulator/glusto.git\n        # cd glusto\n        # python setup.py install\n\nFor more info refer the [docs](http://glusto.readthedocs.io/en/latest/userguide/install.html).\n\nHow to install the glustolibs-gluster, glustolibs-io and glustolibs-misc libraries:\n----------------------------------------------------------------------------------------------\n    # git clone http://review.gluster.org/glusto-tests\n    # cd glusto-tests/glustolibs-gluster\n    # python setup.py install\n    # cd ../../glusto-tests/glustolibs-io\n    # python setup.py install\n    # cd ../../glusto-tests/glustolibs-misc\n    # python setup.py install\n\nHow to install gdeploy:\n--------------------------------\n-   Install latest version of gdeploy from the following [link](https://copr.fedorainfracloud.org/coprs/sac/gdeploy/package/gdeploy/).\n\nTo install glusto-tests dependencies:\n--------------------------------------------------\n- `python-docx`, `sh` and `numpy` has to be installed to run IO and validate it on client node.\n    - To install run :\n\n\t\t\t    # curl \"https://bootstrap.pypa.io/get-pip.py\" -o \"get-pip.py\"\n\t\t\t    # python get-pip.py\n\t\t\t    # pip install --pre python-docx\n\t\t\t    # pip install numpy\n\t\t\t    # pip install sh\n\n- `arequal` needs to be installed on all servers and clients.\n\t- To install download the below repo into /etc/yum.repos.d/\n\n\t\t\t# wget https://copr.fedorainfracloud.org/coprs/nigelbabu/arequal/repo/epel-7/nigelbabu-arequal-epel-7.repo\n\t\t\t# yum install arequal\n\nPre-requisites to run glusto-tests:\n----------------------------------------------\n- Make sure glusto, glusto-tests  are installed on the node from where you would want to run the gluster tests.\n- Running Gluster Cluster( 6 Servers and 2 Clients )\n- Gluster client packages should be installed on Clients\n- Setup passwordless ssh from the glusto-tests management node to all.\n- Install glusto-tests dependencies on servers and clients.\n- Crefi should be installed on all the clients.\n\n  ```\n  $ pip install crefi\n  $ pip install pyxattr\n  ```\n\n- Setup bricks on all servers:\n  - To create bricks refer to [doc](https://gluster.readthedocs.io/en/latest/Administrator%20Guide/formatting-and-mounting-bricks/) **OR** Run gdeploy as shown below.\n\t1. Edit the `gdeploy_sample_config.conf` present in `examples` as shown below and also configure passwordless ssh to all servers:\n    ```\n    [hosts]\n    server-vm1\n    server-vm2\n    server-vm3\n    server-vm4\n    server-vm5\n    server-vm6\n\n    [backend-setup]\n    devices\n    vgs\n    pools\n    lvs\n    mountpoints\n    ```\n   \t**Note:**\n   \tFor more details you can view a sample config file avaliable at ``/usr/share/doc/gdeploy/examples/gluster.conf.sample`` which will be installed with gdeploy.\n\n\t2. Run gdeploy using the below command:\n    ```\n    gdeploy -c gdeploy_sample_config.conf\n    ```\n**Note:**\n\n\t- To run cifs protocol:\n\t\t1.CIFS packages need to be installed on the server\n\t\t2.Samba services need to be ACTIVE\n\t\t3.cifs-utils need to be installed on the client\n\t- To run nfs protocol, nfs packages must be installed on server and client\n\n For more info how to run glusto-tests from the scratch including creating OS, server, etc.. refer [link](https://github.com/gluster/glusto-tests/blob/master/docs/userguide/HOWTO)\n\nHow to run the test case:\n----------------------------------\n-  Update the information about the servers, clients, servers_info, client_info on the [config_file](https://github.com/gluster/glusto-tests/blob/master/tests/gluster_basic_config.yml), this information is enough to run all test cases. But if you need to override the default values of volumes, mount.. etc which is defined in gluster_base_class then use  [config](https://github.com/gluster/glusto-tests/blob/master/tests/gluster_tests_config.yml) and update the information accordingly.\nRefer the following for more info [link](http://glusto.readthedocs.io/en/latest/userguide/configurable.html).\n\n-   glusto-tests are run using the `glusto` command available after installing the glusto framework. The various options to run tests as provided by glusto framework: PyUnit Tests, PyTest Tests, Nose Tests.\nThe most common used is Pytest.\n\t- **Running PyTest Tests**\n\t\t- To run all tests that are marked with tag 'bvt':\n\n\t\t\t\t# glusto -c config.yml --pytest='-v -x tests -m bvt'\n\t\t- To run all tests that are under bvt folder:\n\n\t\t\t\t# glusto -c config.yml --pytest='-v -s bvt/'\n\t\t- To run a single test case:\n\n\t\t\t\t# glusto -c config.yml --pytest='-v -s -k test_demo1'\n\nFor more info about running tests on PyUnit, Pytest and Nose Tests, refer the [docs](http://glusto.readthedocs.io/en/latest/userguide/glusto.html#options-for-running-unit-tests).\n\nglusto-tests can also be executed using `tox`:\n\n       # tox -e functional -- glusto -c 'config.yml' --pytest='-v -s -k test_demo1'\n\nglusto-tests can also be executed with python3 using `tox`:\n\n       # tox -e functional3 -- glusto -c 'config.yml' --pytest='-v -s -k test_demo1'\n\n**NOTE:**\n- Please note that glusto-tests is not completely compatible with python3.\n- You would not need to install the glusto or glusto-tests libraries while running it\n  using `tox`. For more info about tox refer the [docs](https://tox.readthedocs.io/en/latest/#).\n\nWriting tests in glusto-tests:\n----------------------------------\n- `tests` directory in glusto-tests contain testcases. Testcases are written as component wise.\nTestcases name and file name should should start with **test_**.\n\n- TestCases in glusto-tests can be written using standard PyUnit, PyTest or Nose methodologies as supported by `glusto` framework.\n\t- One can follow the [PyUnit](http://glusto.readthedocs.io/en/latest/userguide/unittest.html) docs to write PyUnit tests, or [PyTest](http://glusto.readthedocs.io/en/latest/userguide/pytest.html) docs to write PyTest tests, or [Nose](http://glusto.readthedocs.io/en/latest/userguide/nosetests.html) docs to write Nose tests.\n\n**While writing testcases or libraries follow:**\n\n- Please follow the [PEP008 style-guide](https://www.python.org/dev/peps/pep-0008/).\n- Makes sure all the pylint and pyflakes error are fixed.\n\tFor example\n\n\t\t- C0326: Exactly one space required around assignment\n\t\t- C0111: Missing module doc-string (missing-doc string)\n\t\t- W: 50: Too long line\n\n\tFor more information on [pylint](https://docs.pylint.org/en/1.6.0/tutorial.html) and on [pyflakes](http://flake8.pycqa.org/en/latest/index.html).\n\tWe can check for pyflakes and pylint errors:\n\t```\n\t# flake8 \u003ctest_script.py\u003e\n\tor\n\t# flake8 \u003cpath_to_directory\u003e\n\t# pylint -j 4 --rcfile=/glusto-tests/.pylintrc \u003ctest_script.py\u003e\n\t```\n- Optimize the code as much as possible. Eliminate the repetitive steps, write it has separate function.\n- Use proper python standards on returning values. This style guide is a list of do's and don’ts for[ Python programs](http://google.github.io/styleguide/pyguide.html).\n- Add docstring to every function you write\nFor example: This is an example of a module level function\n  ```\n\t   def module(param1, param2):\n       \"\"\"\n       Explain what the module function does in breif\n\n       Args:\n           param1: The first parameter.\n           param2: The second parameter.\n\n       Returns:\n           The return value of the function.\n       \"\"\"\n  ```\n\n- Make sure the log messages are grammatically correct and have no spelling mistakes.\n\n- Comment every step of the test case/libraries, log the test step, test result, failure and success.\nFor example:\n   ```\n   def test_peer_status(self):\n       # peer status from mnode\n       g.log.info(\"Get peer status from node %s\", self.mnode)\n       ret, out, err = peer_status(self.mnode)\n       self.assertEqual(ret, 0, \"Failed to get peer status from node %s: %s\" % (self.mnode, err))\n       g.log.info(\"Successfully got peer status from node %s:\\n%s\", self.mnode, out)\n   ```\n\n\n- Don't not use print statements in test-cases/libraries because prints statements are not captured in log files. Use logger functions to dump messages into log file.\n\nFor more info how to write testcases [developing-guide](https://github.com/gluster/glusto-tests/blob/master/docs/userguide/developer-guide.rst)\n\nLogging:\n--------------\nLog file name and Log level can be passed as argument to glusto command while\nrunning the glusto-tests. For example:\n\n    # glusto -c 'config.yml' -l /tmp/glustotests_bvt.log --log-level DEBUG --pytest='-v -x tests -m bvt'\n\nOne can configure log files, log levels in the testcases as well. For details\non how to use glusto framework for configuring logs in tests Refer the following [docs](http://glusto.readthedocs.io/en/latest/userguide/loggable.html).\n\nDefault log location is: `/tmp/glustomain.log`\n\nNote: When using `glusto` via the Python Interactive Interpreter,\nthe default log location is `/tmp/glusto.log`.\n\nLicense\n-------\n[GPLv3](https://github.com/gluster/glusto-tests/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgluster%2Fglusto-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgluster%2Fglusto-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgluster%2Fglusto-tests/lists"}