{ "info": { "author": "John Carr", "author_email": "john.carr@isotoma.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX", "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 :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "=================\nFakeChrootFixture\n=================\n\nThis package provides a fixtures_ compatible fixture for building and\nexecuting integration tests in a copy-on-write chroot environment without\nrequiring the tests to be run as root.\n\nIn order to use it you will need fakeroot_, fakechroot_ and cowdancer_.\n\nThis code was extracted and refactored from the test harness within Yaybu_.\n\n.. _fixtures: http://pypi.python.org/pypi/fixtures\n.. _yaybu: http://yaybu.com\n.. _fakechroot: https://github.com/fakechroot/fakechroot/wiki\n.. _fakeroot: http://fakeroot.alioth.debian.org\n.. _cowdancer: http://www.netfort.gr.jp/~dancer/software/cowdancer.html.en\n\n\nSo what does it do then?\n========================\n\nThe first test to use the fixture will create (or refresh) a chroot. We use\nfakechroot magic to do this in userspace without root. Each test is then run in\na cheap copy of this chroot. So each test gets its own clean (and fresh) chroot.\n\nThis chroot is perfect for testing. You can perform actions against a seeming\ncomplete system and at the same time poke and prod at it from outside.\n\n\nHow do I use it?\n================\n\nSomething like this::\n\n import unittest2\n from fakechroot import TestCase\n\n class TestInAChroot(TestCase):\n def test_true(self):\n retval = self.chroot.call([\"/bin/true\"])\n self.failUnlessEqual(retval, 0)\n\n\nWhat other cool API's are there?\n================================\n\nThe fixture object has a bunch of API helpers on it so you can write your tests\nas though they were in the chroot. All the calls below will take a path in the\nchroot (such as ``/foo``) and operate on the fully expanded path (which might\nbe ``/home/john/Projects/myproject/tmp2234a/foo``).\n\nThese were added as Yaybu needed them - patches for more are welcome.\n\n``FakeChrootFixture.call``\n Executes a command inside the chroot with the appropriate LD_PRELOAD\n setup.\n\n``FakeChrootFixture.exists``\n Returns ``True`` if a path inside the chroot exists.\n\n``FakeChrootFixture.isdir``\n Returns ``True`` is a path in the chroot is a directory.\n\n``FakeChrootFixture.mkdir``\n Creates a directory inside the chroot.\n\n``FakeChrootFixture.open``\n Returns a file inside the chroot for read or write operations.\n\n``FakeChrootFixture.touch``\n Runs the ``touch`` binary inside the chroot.\n \n``FakeChrootFixture.chmod``\n Runs the ``chmod`` binary inside the chroot. We can't directly use\n ``os.chmod`` as it doesn't notify ``faked`` about the change.\n\n``FakeChrootFixture.readlink``\n Grabs the value of a symlink. As this can contain the entire path of the\n chroot we strip off the chroot path.\n\n``FakeChrootFixture.symlink``\n Actually creates a symlink within the chroot.\n\n``FakeChrootFixture.stat``\n Performs an ``os.stat`` on the path.\n\n\nHow does it work?\n=================\n\nThis works through a trio of ``LD_PRELOAD`` libs that essentially monkey patch\nthe chroot to think they have more privileged access than they do.\n\nThe ``fakeroot`` package is used to fool your code into thinking it is root and\nthat changes it is making as root (such as ``chmod``, for example) are taking\neffect. A special ``faked`` daemon is used to coordinate this between\nprocesses.\n\nThe ``fakechroot`` package is used to fool your code into thinking that the\n``chroot`` syscall worked. This means that any code perform file operations is\ntricked at a syscall level into acting on ``~/yourchroot/tmp/foo`` when it\ninnocently thinks it just touched ``/tmp/foo``.\n\nThe ``cowdancer`` package is what provides copy-on-write in userspace. The only\nrequirement is a filesystem that supports hard links. You create a copy on your\nbase image with ``cp -al``. This creates a farm of hardlinks. The ``cowdancer``\npatches then force any changes that would have been written to the base image\nto be written into a new file (thus breaking the hard link).\n\n\nWhat are the limitations?\n=========================\n\nYour code only thinks it has root. So you can't bind port 80 or anything like\nthat.\n\nRight now we only actively support Ubuntu. In particular, we are only actively\ntesting with Lucid and Precise. Whilst other Unixes may be supported in future\nsupport for OS X is unfortunately unlikely (there is nothing like debootstrap)\nand Windows doesn't have the concept of chroots.\n\nThere is some overhead to using a system like this. We have tuned some of this\naway (for example, we setup the ``LD_PRELOAD`` stuff by hand to shave 3 process\ninvocations per ``.call()``), but you are still introducing a fair bit of\nindirection. You won't be running hundreds of test cases per second.\n\nAll three libraries on their own are clever hacks. They are heavily used in\nDebian, but they likely still have bugs. And when combined together those bugs\nare likely magnified. This fixture will let you run some tests that might have\npreviously required root as a normal user, thus avoid running the code you just\nutterly broke as root. But that's still enough power to wipe ``~``!\n\n\nWhat are the alternatives?\n==========================\n\nRunning your code in a VM is the best test, but even with snapshots running\neach test in a clean environment would be a pain.\n\nThere have been lots of advances in Kernel namespacing. LXC could be a suitable\nalternative - it depends on your use case.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/yaybu/fakechroot", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "fakechroot", "package_url": "https://pypi.org/project/fakechroot/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fakechroot/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/yaybu/fakechroot" }, "release_url": "https://pypi.org/project/fakechroot/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "A fixture for using a fakechroot environment in your tests", "version": "0.2.1" }, "last_serial": 1113197, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "d2b5bf0311ae21bcd11fccb62d5f1785", "sha256": "0e944d6077eb6436d22b5e6806b3181e8f1bc6eb5981b2c94955a603275a94de" }, "downloads": -1, "filename": "fakechroot-0.0.0.zip", "has_sig": false, "md5_digest": "d2b5bf0311ae21bcd11fccb62d5f1785", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15276, "upload_time": "2013-06-09T09:44:17", "url": "https://files.pythonhosted.org/packages/34/ce/91660cb16bd5178352c39a6e548ccbb79b845b071839cba12594e1addd88/fakechroot-0.0.0.zip" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "b63867aedda974d63f3beaf5769923b4", "sha256": "61f94179dccaf17b0d4f718702b98f71fbde18356f65f8a54001b04c165f098a" }, "downloads": -1, "filename": "fakechroot-0.0.1.zip", "has_sig": false, "md5_digest": "b63867aedda974d63f3beaf5769923b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20534, "upload_time": "2013-06-09T10:56:35", "url": "https://files.pythonhosted.org/packages/a6/10/c778c8ebdd79a1e72a38f66d4f787796088b9186b937572fd282c3b05db2/fakechroot-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "af3a6228ea71f54557aa20071b5c9475", "sha256": "46f5393466de22429900333a90d59af22a08cad62b7397c0e5535aa36d26e656" }, "downloads": -1, "filename": "fakechroot-0.0.2.zip", "has_sig": false, "md5_digest": "af3a6228ea71f54557aa20071b5c9475", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20629, "upload_time": "2013-06-09T10:59:24", "url": "https://files.pythonhosted.org/packages/91/50/3dd23f42cafee7bded30c1fdf1adccac412d627a561e0e82929ee8a2fe5d/fakechroot-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a2e966bb8ff2ca8acf8dd7e46f9b6094", "sha256": "a1c41cb966ed570295679e689fd9ab55613cee480383091b5c902789b1b9f3f1" }, "downloads": -1, "filename": "fakechroot-0.0.3.zip", "has_sig": false, "md5_digest": "a2e966bb8ff2ca8acf8dd7e46f9b6094", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21753, "upload_time": "2013-06-09T11:02:21", "url": "https://files.pythonhosted.org/packages/bb/ad/e2848a17107157057bc673d07c14cdefc9d79e86e9f5910bd3b4444269ea/fakechroot-0.0.3.zip" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "1808e25c492e865a9f4434085703c6cd", "sha256": "fd43b65d723585ce141e9921709ed57d066f9e88ce19d71b773df0d4014d7fc9" }, "downloads": -1, "filename": "fakechroot-0.0.4.zip", "has_sig": false, "md5_digest": "1808e25c492e865a9f4434085703c6cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21933, "upload_time": "2013-06-09T11:15:27", "url": "https://files.pythonhosted.org/packages/cf/06/c399cff73d2301173b32b8d3b008cc38c16c955f3bcbe2f99c41d1263bb4/fakechroot-0.0.4.zip" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "36b5f947698e0f74344080eb271fe5cd", "sha256": "3e25cdb525cd07cb8a3367dd32e8968970055dd932b9d24a240342fb8a84c156" }, "downloads": -1, "filename": "fakechroot-0.0.5.zip", "has_sig": false, "md5_digest": "36b5f947698e0f74344080eb271fe5cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23401, "upload_time": "2013-06-12T09:45:27", "url": "https://files.pythonhosted.org/packages/2d/48/72ef8e2596b76ce00468a29cd6c97234b8401f95cdcdffd11b3631c0a7f5/fakechroot-0.0.5.zip" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "54fea89cb96e9a83be2f3b1f8113555b", "sha256": "64fd9ee90772a0e572cb4dd1df142e5730375e7c4d0a169d42c6766af8891fc3" }, "downloads": -1, "filename": "fakechroot-0.0.6.zip", "has_sig": false, "md5_digest": "54fea89cb96e9a83be2f3b1f8113555b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23463, "upload_time": "2013-09-15T14:15:12", "url": "https://files.pythonhosted.org/packages/d9/1d/4fcab6b62addcaabaa653463bc114f39134c7144be18f4fadac5ff82744d/fakechroot-0.0.6.zip" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "a485757196965e3355ac21df7fd343a5", "sha256": "e0f5ee2494d3825a899a66d6586c24d88fc2b9a38185445e7490104d9d37bec1" }, "downloads": -1, "filename": "fakechroot-0.0.7.tar.gz", "has_sig": false, "md5_digest": "a485757196965e3355ac21df7fd343a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13267, "upload_time": "2014-02-27T20:06:39", "url": "https://files.pythonhosted.org/packages/b9/99/b0aed193e47f414104f52b99aa15be8e70ce6f102faf74a5578d6a5c560e/fakechroot-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "49eed244626eaf1011f2797303632068", "sha256": "67c989ae566379acd58faebb0d7fe1eadca330c56cbbc412be60f7ea147278e9" }, "downloads": -1, "filename": "fakechroot-0.0.8.zip", "has_sig": false, "md5_digest": "49eed244626eaf1011f2797303632068", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19525, "upload_time": "2014-03-31T09:09:44", "url": "https://files.pythonhosted.org/packages/5e/f8/fbb2ea204f14785938e06a1b5467a399e806a9a05ddfe0ce49a634349951/fakechroot-0.0.8.zip" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "c6c413f109b23e45fb2fe6d535b63f38", "sha256": "ce7b4a77aa0e5a5836bce5eb6cd9fda0f4292675f1d8cb3fbc1c28dcd45aa720" }, "downloads": -1, "filename": "fakechroot-0.0.9.zip", "has_sig": false, "md5_digest": "c6c413f109b23e45fb2fe6d535b63f38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19545, "upload_time": "2014-04-05T18:50:16", "url": "https://files.pythonhosted.org/packages/9c/47/3b0740f891a5d73e7a23aa6eb6a97fcbfc6323c903ee4a74aaafa81f51cd/fakechroot-0.0.9.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "155ece25f0616f207e6fe688750b2d63", "sha256": "3cd10f6ad8edcc9263a2e449a5891ad9adca5b3426fb5b0b24c6a7098a7319e9" }, "downloads": -1, "filename": "fakechroot-0.2.0.zip", "has_sig": false, "md5_digest": "155ece25f0616f207e6fe688750b2d63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20335, "upload_time": "2014-06-01T16:04:57", "url": "https://files.pythonhosted.org/packages/3a/04/6be9fd9ffe2c436e1f75216ec5c4eb7751afcf1d8c5c7358fa718975e50b/fakechroot-0.2.0.zip" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "fa7fce2cb1284f355b45cc0e775fc3ce", "sha256": "56d9c744723948aed8dc50d979989bff3b2549499cc35406061a8ac497fa8678" }, "downloads": -1, "filename": "fakechroot-0.2.1.zip", "has_sig": false, "md5_digest": "fa7fce2cb1284f355b45cc0e775fc3ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21209, "upload_time": "2014-06-03T22:04:32", "url": "https://files.pythonhosted.org/packages/65/21/7d184e36728908267f79c6774bba9de52aa9efbcb99142a1c766e811ff88/fakechroot-0.2.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fa7fce2cb1284f355b45cc0e775fc3ce", "sha256": "56d9c744723948aed8dc50d979989bff3b2549499cc35406061a8ac497fa8678" }, "downloads": -1, "filename": "fakechroot-0.2.1.zip", "has_sig": false, "md5_digest": "fa7fce2cb1284f355b45cc0e775fc3ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21209, "upload_time": "2014-06-03T22:04:32", "url": "https://files.pythonhosted.org/packages/65/21/7d184e36728908267f79c6774bba9de52aa9efbcb99142a1c766e811ff88/fakechroot-0.2.1.zip" } ] }