{"id":27295099,"url":"https://github.com/contiv/remotessh","last_synced_at":"2025-07-06T20:07:45.026Z","repository":{"id":57484594,"uuid":"47094934","full_name":"contiv/remotessh","owner":"contiv","description":"A library with strategies for SSH integration testing","archived":false,"fork":false,"pushed_at":"2017-10-30T23:46:42.000Z","size":915,"stargazers_count":6,"open_issues_count":1,"forks_count":14,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-11T22:58:20.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contiv.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}},"created_at":"2015-11-30T04:18:35.000Z","updated_at":"2023-11-03T22:46:23.000Z","dependencies_parsed_at":"2022-09-01T23:11:04.957Z","dependency_job_id":null,"html_url":"https://github.com/contiv/remotessh","commit_stats":null,"previous_names":["contiv/vagrantssh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/contiv/remotessh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contiv%2Fremotessh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contiv%2Fremotessh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contiv%2Fremotessh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contiv%2Fremotessh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contiv","download_url":"https://codeload.github.com/contiv/remotessh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contiv%2Fremotessh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263966168,"owners_count":23536814,"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-04-11T22:58:18.742Z","updated_at":"2025-07-06T20:07:45.006Z","avatar_url":"https://github.com/contiv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## remotessh: Test your remote files through SSH with a simple library.\n\ngodoc is [here](https://godoc.org/github.com/contiv/remotessh)\n\nUse this library to do remote testing of vagrant nodes.\n\nFor example, this will select the \"mynode\" node and run \"ls\" on it.\n\n```go\n    vagrant := \u0026Vagrant{}\n    vagrant.Setup(false, \"\", 3) // 3 node cluster, do not run `vagrant up`.\n    out, err := vagrant.GetNode(\"mynode\").RunCommandWithOutput(\"ls\")\n    if err != nil {\n      // exit status != 0\n      panic(err)\n    }\n\n    fmt.Println(out) // already a string\n```\n\nSimilarly for a Baremetal node:\n\n```go\nhosts := []HostInfo{\n\t\t{\n\t\t\tName:        \"self\",\n\t\t\tSSHAddr:     \"127.0.0.1\",\n\t\t\tSSHPort:     \"22\",\n\t\t\tUser:        \"vagrant\",\n\t\t\tPrivKeyFile: \"/vagrant/testdata/insecure_private_key\",\n\t\t},\n\t\t{\n\t\t\tName:        \"self1\",\n\t\t\tSSHAddr:     \"127.0.0.1\",\n\t\t\tSSHPort:     \"22\",\n\t\t\tUser:        \"vagrant\",\n\t\t\tPrivKeyFile: \"/vagrant/testdata/insecure_private_key\",\n\t\t},\n\t}\n\tbm := \u0026Baremetal{}\n\tc.Assert(bm.Setup(hosts), IsNil)\n    out, err := bm.GetNode(\"mynode\").RunCommandWithOutput(\"ls\")\n    if err != nil {\n      // exit status != 0\n      panic(err)\n    }\n\n    fmt.Println(out) // already a string\n```\n\nIf you want to walk nodes, you have a few options:\n\nSequentially:\n\n```go\n    vagrant := \u0026remotessh.Vagrant{}\n    vagrant.Setup(false, \"\", 3)\n    for _, node := range vagrant.GetNodes() {\n      node.RunCommand(\"something\")\n    }\n```\n\nIn Parallel:\n\n```go\n    vagrant := \u0026remotessh.Vagrant{}\n    vagrant.Setup(false, \"\", 3)\n    err := vagrant.IterateNodes(func (node remotessh.TestbedNode) error {\n      return node.RunCommand(\"docker ps -aq | xargs docker rm\")\n    })\n\n    if err != nil {\n      // one or more nodes failed\n      panic(err)\n    }\n```\n\nCopyright 2014 Cisco Systems Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontiv%2Fremotessh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontiv%2Fremotessh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontiv%2Fremotessh/lists"}