{"id":20331008,"url":"https://github.com/cans/ssh-harness","last_synced_at":"2026-06-07T17:31:47.784Z","repository":{"id":30170111,"uuid":"33720464","full_name":"cans/ssh-harness","owner":"cans","description":"A Test Harness for SSH dependant applications","archived":false,"fork":false,"pushed_at":"2015-04-10T09:37:44.000Z","size":324,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T15:24:20.577Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cans.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2015-04-10T09:30:31.000Z","updated_at":"2015-04-10T09:37:44.000Z","dependencies_parsed_at":"2022-08-28T05:50:11.914Z","dependency_job_id":null,"html_url":"https://github.com/cans/ssh-harness","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/cans%2Fssh-harness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fssh-harness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fssh-harness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fssh-harness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cans","download_url":"https://codeload.github.com/cans/ssh-harness/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241845874,"owners_count":20029956,"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":"2024-11-14T20:18:28.040Z","updated_at":"2026-06-07T17:31:47.752Z","avatar_url":"https://github.com/cans.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SSH-HARNESS: A Test Harness for SSH dependant applications\n==========================================================\n\n\nThe ``ssh_harness`` python package provides a ``unittest.TestCase`` subclass\nfor integration testing programs that requires the presence of a SSH daemon\nrunning. The TestCase spawns a SSH daemon before running your test suite and\ntakes care of cleaning-up behind itself, when you are done.\n\nTo be as close as what would be a production environment, it uses OpenSSH as\na ssh daemon.\n\n\nFeatures\n--------\n\n- Supports Public Key authentication\n- Secure: ssh daemon is bound to the loopback address so to not open a port\n  to the outside world while your tests are running.\n- Configurable: you can change many of the daemon settings, as well as the\n  location of all tools used while running the tests, this way you can\n  easily run your tests again custom compiled versions of ssh.\n\n\n\nHow does one use ssh-harness\n----------------------------\n\n\nYou basically use it like any other TestCase class from Python's unittest\nframework:\n\n::\n\n   # -*- coding: utf-8; -*-\n   from ssh_harness import PubKeyAuthSshClientTestCase\n\n   import your_code\n\n\n   class MyTestCase(PubKeyAuthSshHarness):\n\n       def test_something(self):\n           # use your_code, assert something\n           pass\n\n\nThe important bits are: importing the\n:class:`ssh_harness.PubKeyAuthSshClientTestCase` (l. 2) and inheriting from\nit (l. 6).\n\nWith that little code, you start a SSH server, bound to the loopback interface\non port 2200. This is of course, is the default configuration, which you can\nchange if need be.\n\n\nRoadmap\n-------\n\nThe ``ssh_harness`` was hacked out of the need of integration testing a\nproject of mine (`vcs-ssh \u003chttp://www.caniart.net/devel/vcs-ssh/\u003e`_). It\nas grown to a little project of its own. But there is no long-term road-map\nfor its development, apart from:\n\n- First there is some refactoring to be made to improve the configurability\n  of the system. And also avoid shared state at the class level between the\n  test-case class and its sub-classes which sometimes leads to odd-behaviours.\n- Then there are ideas that may be implemented has need or demand arises.\n  To name a few:\n\n  * Provide ability to configure an :file:`authorized_keys` file on a per\n    test-case basis (it is now on a per test-suite basis).\n  * Provide the ability to chroot the tests;\n  * Provide the ability to restart the ssh daemon on demand or on a per\n    test-case basis (not sure the later is really usefull)\n  * You name it...\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fssh-harness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcans%2Fssh-harness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fssh-harness/lists"}