{ "info": { "author": "Bruno Rocha", "author_email": "rochacbruno@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "==================\nSatellite-Populate\n==================\n\n\n.. image:: https://img.shields.io/pypi/v/satellite-populate.svg\n :target: https://pypi.python.org/pypi/satellite-populate\n\n.. image:: https://img.shields.io/travis/SatelliteQE/satellite-populate.svg\n :target: https://travis-ci.org/SatelliteQE/satellite-populate\n\n.. image:: https://readthedocs.org/projects/satellite-populate/badge/?version=latest\n :target: https://satellite-populate.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/satelliteqe/satellite-populate/shield.svg\n :target: https://pyup.io/repos/github/satelliteqe/satellite-populate/\n :alt: Updates\n\n\nPopulate and Validate the System using YAML\n\n\n* Free software: GNU General Public License v3\n* Documentation: https://satellite-populate.readthedocs.io.\n\n\nInstallation\n------------\n\nTo install latest released version::\n\n pip install satellite-populate\n\nTo install from github master branch::\n\n pip install https://github.com/SatelliteQE/satellite-populate/tarball/master\n\nFor development::\n\n # fork https://github.com/SatelliteQE/satellite-populate/ to YOUR_GITHUB\n # clone your repo locally\n git clone git@github.com:YOUR_GITHUB/satellite-populate.git\n cd satellite-populate\n\n # add upstream remote\n git remote add upstream git@github.com:SatelliteQE/satellite-populate.git\n\n # create a virtualenv\n mkvirtualenv satellite-populate\n workon satellite-populate\n\n # install for development (editable)\n pip install -r requirements.txt\n\n\nTesting if installation is good::\n\n $ satellite-populate --test\n satellite_populate.base - INFO - ECHO: Hello, if you can see this it means that I am working!!!\n\n\nFeatures\n--------\n\nYAML based actions\n++++++++++++++++++\n\nData population definition goes to YAML file e.g ``office.yaml`` in the following\nexample we are going to create 2 organizations and 2 admin users using lists::\n\n\n vars:\n\n org_names:\n - Dunder Mifflin\n - Wernham Hogg\n\n user_list:\n - firstname: Michael\n lastname: Scott\n\n - firstname: David\n lastname: Brent\n\n actions:\n\n - model: Organization\n with_items: org_names\n register: default_orgs\n data:\n name: \"{{ item }}\"\n label: org{{ item.replace(' ', '') }}\n description: This is a satellite organization named {{ item }}\n\n - model: User\n with_items: user_list\n data:\n admin: true\n firstname: \"{{ item.firstname }}\"\n lastname: \"{{ item.lastname }}\"\n login: \"{{ '{0}{1}'.format(item.firstname[0], item.lastname) | lower }}\"\n password:\n from_factory: alpha\n organization:\n from_registry: default_orgs\n default_organization:\n from_registry: default_orgs[loop_index]\n\n\nOn the populate file you can define CRUD actions such as **create**, **delete**, **update**\nif ``action:`` is not defined, the default will be ``create``.\n\nAnd also there is **special actions** and **custom actions** explained later.\n\nPopulate Satellite With Entities\n++++++++++++++++++++++++++++++++\n\nConsidering ``office.yaml`` file above you can populate satellite system with the\ncommand line::\n\n $ satellite-populate office.yaml -h yourserver.com --output=office.yaml -v\n\nIn the above command line ``-h`` stands for ``--hostname``, ``--output`` is the\noutput file which will be written to be used to validate the system, and ``-v`` is\nthe verbose level.\n\nTo see the list of available arguments please run::\n\n # satellite-populate --help\n\nValidate if system have entities\n++++++++++++++++++++++++++++++++\n\nOnce you run ``satellite-populate`` you can use the outputted file to validate the system.\nas all the output files are named as ``validation_.yaml`` in office example you can run::\n\n $ satellite-populate validation_office.yaml -v\n\nUsing that validation file the system will be checked for entities existence, read-only.\nThe Validation file exists because during the population dynamic data is generated such as\npasswords and strings ``from_factory`` and also some entities can be deleted or updated\nso validation file takes care of it.\n\nSpecial actions\n+++++++++++++++\n\nSome builtin special actions are:\n\n- assertion\n- echo\n- register\n- unregister\n\n\nIn the following example we are going to run a complete test case using\nactions defined in YAML file, if validation fails system returns status 0\nwhich can be used to automate tests::\n\n # A TEST CASE USING SPECIAL ACTIONS\n # Create a plain vanilla activation key\n # Check that activation key is created and its \"unlimited_hosts\"\n # attribute defaults to true\n\n - action: create\n log: Create a plain vanilla activation key\n model: ActivationKey\n register: vanilla_key\n data:\n name: vanilla\n organization:\n from_registry: default_orgs[0]\n\n - action: assertion\n log: >\n Check that activation key is created and its \"unlimited_hosts\"\n attribute defaults to true\n operation: eq\n register: vanilla_key_unlimited_hosts\n data:\n - from_registry: vanilla_key.unlimited_hosts\n - true\n\n - action: echo\n log: Vanilla Key Unlimited Host is False!!!!\n level: error\n print: true\n when: vanilla_key_unlimited_hosts == False\n\n - action: echo\n log: Vanilla Key Unlimited Host is True!!!!\n level: info\n print: true\n when: vanilla_key_unlimited_hosts\n\n - action: register\n data:\n you_must_update_vanilla_key: true\n when: vanilla_key_unlimited_hosts == False\n\nCustom actions\n++++++++++++++\n\nAnd you can also have special actions defined in a custom populator.\n\nLets say you have this python module in your project, properly available on\nPYTHONPATH::\n\n from satellite_populate.api import APIPopulator\n\n class MyPopulator(APIPopulator):\n def action_writeinfile(self, rendered_data, action_data):\n with open(rendered_data['path'], 'w') as output:\n output.write(rendered_data['content'])\n\nNow go to your ``test.yaml`` and write::\n\n config:\n populator: mine\n populators:\n mine:\n module: mypath.mymodule.MyPopulator\n\n actions:\n\n - action: writeinfile\n path: /tmp/test.txt\n text: Hello World!!!\n\nand run:\n\n $ satellite-populate test.yaml -v\n\nDecorator for test cases\n++++++++++++++++++++++++\n\nHaving a data_file like::\n\n actions:\n - model: Organization\n register: organization_1\n data:\n name: My Org\n\nThen you can use in decorators::\n\n @populate_with('file.yaml')\n def test_case_(self):\n 'My Org exists in system test anything here'\n\nAnd getting the populated entities inside the test_case::\n\n @populate_with('file.yaml', context_name='my_context')\n def test_case_(self, my_context=None):\n assert my_context.organization_1.name == 'My Org'\n\n You can also set a customized context wrapper to the\n context_wrapper argument::\n\n def my_custom_context_wrapper(result):\n # create an object using result\n my_context = MyResultContext(result)\n return my_context\n\n @populate_with('file.yaml', context_name='my_context',\n content_wrapper=my_custom_context_wrapper)\n def test_case_(self, my_context=None):\n # assert with some expression using my_context object returned\n # my_custom_context_wrapper\n assert some_expression\n\nNOTE::\n\n That is important that ``context`` argument always be declared using\n either a default value ``my_context=None`` or handle in ``**kwargs``\n Otherwise ``py.test`` may try to use this as a fixture placeholder.\n\n if context_wrapper is set to None, my_context will be the pure unmodified\n result of populate function.\n\n\nSatellite versions\n------------------\n\nThis code is by default prepared to run against Satellite **latest** version\nwhich means the use of the **latest** master from **nailgun** repository.\n\nIf you need to run this tool in older versions e.g: to tun upgrade tests, you\nhave to setup **nailgun** version.\n\nYou have 2 options:\n\nManually\n++++++++\n\nbefore installing satellite-populate install specific nailgun version as\nthe following list.\n\n- Satellite 6.1.x::\n\n pip install -e git+https://github.com/SatelliteQE/nailgun.git@0.28.0#egg=nailgun\n pip install satellite-populate\n\n- Satellite 6.2.x::\n\n pip install -e git+https://github.com/SatelliteQE/nailgun.git@6.2.z#egg=nailgun\n pip install satellite-populate\n\n- Satellite 6.3.x (latest)::\n\n pip install -e git+https://github.com/SatelliteQE/nailgun.git#egg=nailgun\n pip install satellite-populate\n\n\n\nDocker\n++++++\n\n\nIf you need to run ``satellite-populate`` in older Satellite versions you can\nuse the ``docker images`` so it will manage the correct nailgun version to\nbe used with that specific system version.\n\nhttps://hub.docker.com/r/satelliteqe/satellite-populate/\n\n\nFirst pull image from Docker Hub::\n\n docker pull satelliteqe/satellite-populate:latest\n\nChange ``:latest`` to specific tag. e.g: ``:6.1`` or ``:6.2``\n\n\nTest it::\n\n docker run satelliteqe/satellite-populate --test\n\nThen run::\n\n docker run -v $PWD:/datafiles satelliteqe/satellite-populate /datafiles/theoffice.yaml -v -h server.com\n\nYou must map your local folder containing datafiles\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n\n=======\nHistory\n=======\n\n0.1.3 (2017-01-13)\n------------------\n\n* Docker support\n\n0.1.2 (2017-01-12)\n------------------\n\n* Fix decorators.\n\n0.1.0 (2017-01-10)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SatelliteQE/satellite-populate", "keywords": "satellite_populate", "license": "GNU General Public License v3", "maintainer": "", "maintainer_email": "", "name": "satellite_populate", "package_url": "https://pypi.org/project/satellite_populate/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/satellite_populate/", "project_urls": { "Homepage": "https://github.com/SatelliteQE/satellite-populate" }, "release_url": "https://pypi.org/project/satellite_populate/0.1.3/", "requires_dist": [ "Click (>=6.0)", "PyYAML", "coloredlogs", "import-string", "jinja2", "six" ], "requires_python": "", "summary": "Populate and Validate the System using YAML", "version": "0.1.3" }, "last_serial": 2572964, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a83d7a6fc63dd1e46efac7d2037cb109", "sha256": "5fc839e9f414240d8c239f6d1102f5e1740af53833de06b74a81a51567b0df83" }, "downloads": -1, "filename": "satellite_populate-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a83d7a6fc63dd1e46efac7d2037cb109", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 18468, "upload_time": "2017-01-10T05:45:29", "url": "https://files.pythonhosted.org/packages/74/0b/b55983db372290efe2e98592e6815de4044f281cd07d688090da8a7acea5/satellite_populate-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73b529638f40d3457bc236e14db6f390", "sha256": "f73d072f9b62a2a542ff05faf88484ee005d4f35c21a657dfac87b5a4ad18952" }, "downloads": -1, "filename": "satellite_populate-0.1.0.tar.gz", "has_sig": false, "md5_digest": "73b529638f40d3457bc236e14db6f390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26283, "upload_time": "2017-01-10T05:45:26", "url": "https://files.pythonhosted.org/packages/8e/63/ff27c7e099020391f92f1d0676da7d642caa9e28ba34d92cbc44cbbd5bc7/satellite_populate-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7e240d0be7702e141468628e4e40081f", "sha256": "a8342861289beaf626c140bb3b8128df2bca4efbb4f994efd7b7da23f8683491" }, "downloads": -1, "filename": "satellite_populate-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e240d0be7702e141468628e4e40081f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25050, "upload_time": "2017-01-12T18:38:33", "url": "https://files.pythonhosted.org/packages/31/94/ef10a7ff739d8354662b0bcdaf58929762ed4e8354e578fd5dbafb474082/satellite_populate-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b6a3a7284a25524864a2ccf157c12ce", "sha256": "ec28b168a2fedc0d65aa317edf2999fa6bc4081ae184e1e0a33d275773486bbb" }, "downloads": -1, "filename": "satellite_populate-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9b6a3a7284a25524864a2ccf157c12ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33883, "upload_time": "2017-01-12T18:38:35", "url": "https://files.pythonhosted.org/packages/c1/11/ae4d7b35e64716d5d5e3963b1a15d61655f4ab759c7a7e87a1dc3b65c298/satellite_populate-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9cd7bc134cb27489fe0f18e311f320c3", "sha256": "afd2811b23a3cfb6d0a645630630f8e3dc9fe9d01bbacddf308f346c72b34228" }, "downloads": -1, "filename": "satellite_populate-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9cd7bc134cb27489fe0f18e311f320c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26884, "upload_time": "2017-01-13T21:45:05", "url": "https://files.pythonhosted.org/packages/2f/38/fce96dab4f2d5cc60aa4a6482f68f5e336f35c4bb65e6b8d20afc41eba49/satellite_populate-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "539de05adae0a8b988db845e3f987dba", "sha256": "93f5e17e751d8f0584f963ad67d2213c233cb728d116bacc74da5c5767cbd2e4" }, "downloads": -1, "filename": "satellite_populate-0.1.3.tar.gz", "has_sig": false, "md5_digest": "539de05adae0a8b988db845e3f987dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36190, "upload_time": "2017-01-13T21:45:08", "url": "https://files.pythonhosted.org/packages/df/1a/b4d3ffd6a5e54d909cd91a042e9057d142fb1f6ba2a0219f6e7899c80cc1/satellite_populate-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9cd7bc134cb27489fe0f18e311f320c3", "sha256": "afd2811b23a3cfb6d0a645630630f8e3dc9fe9d01bbacddf308f346c72b34228" }, "downloads": -1, "filename": "satellite_populate-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9cd7bc134cb27489fe0f18e311f320c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26884, "upload_time": "2017-01-13T21:45:05", "url": "https://files.pythonhosted.org/packages/2f/38/fce96dab4f2d5cc60aa4a6482f68f5e336f35c4bb65e6b8d20afc41eba49/satellite_populate-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "539de05adae0a8b988db845e3f987dba", "sha256": "93f5e17e751d8f0584f963ad67d2213c233cb728d116bacc74da5c5767cbd2e4" }, "downloads": -1, "filename": "satellite_populate-0.1.3.tar.gz", "has_sig": false, "md5_digest": "539de05adae0a8b988db845e3f987dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36190, "upload_time": "2017-01-13T21:45:08", "url": "https://files.pythonhosted.org/packages/df/1a/b4d3ffd6a5e54d909cd91a042e9057d142fb1f6ba2a0219f6e7899c80cc1/satellite_populate-0.1.3.tar.gz" } ] }