{"id":16221588,"url":"https://github.com/rahix/tbot","last_synced_at":"2025-04-05T15:07:24.615Z","repository":{"id":33365469,"uuid":"157848261","full_name":"Rahix/tbot","owner":"Rahix","description":"Automation/Testing tool for Embedded Linux Development","archived":false,"fork":false,"pushed_at":"2024-11-01T15:02:21.000Z","size":8674,"stargazers_count":92,"open_issues_count":31,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T15:58:12.653Z","etag":null,"topics":["automation","developer-tools","embedded-linux"],"latest_commit_sha":null,"homepage":"https://tbot.tools","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/Rahix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T09:59:06.000Z","updated_at":"2025-03-05T13:42:48.000Z","dependencies_parsed_at":"2024-05-18T12:40:00.308Z","dependency_job_id":"0756e1b5-7301-4ea9-8b7f-8177161f6345","html_url":"https://github.com/Rahix/tbot","commit_stats":{"total_commits":1337,"total_committers":16,"mean_commits":83.5625,"dds":"0.17875841436050866","last_synced_commit":"4e6d3f29fe6c25e53850ef5f696d4564457b7f3b"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Ftbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Ftbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Ftbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahix%2Ftbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahix","download_url":"https://codeload.github.com/Rahix/tbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353745,"owners_count":20925329,"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":["automation","developer-tools","embedded-linux"],"created_at":"2024-10-10T12:09:00.433Z","updated_at":"2025-04-05T15:07:24.586Z","avatar_url":"https://github.com/Rahix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Documentation/static/tbot-logo-header.png\" alt=\"tbot\" /\u003e\u003cbr /\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.8-blue.svg\" alt=\"Python 3.8\" /\u003e\u003c/a\u003e\n  \u003ca href=\"http://mypy-lang.org/\"\u003e\u003cimg src=\"http://www.mypy-lang.org/static/mypy_badge.svg\" alt=\"Checked with mypy\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/ambv/black\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style: black\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Rahix/tbot/actions\"\u003e\u003cimg src=\"https://github.com/Rahix/tbot/workflows/tbot%20selftest%20CI/badge.svg\" alt=\"tbot selftest CI\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/Rahix/tbot\"\u003e\u003cimg src=\"https://codecov.io/gh/Rahix/tbot/graph/badge.svg?token=JkCGa8W3vM\" /\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  Embedded Test \u0026amp; Automation Tool\n\u003c/p\u003e\n\nWelcome to *tbot*!  *tbot* automates the development workflow for embedded\nsystems software.  This automation can then also be used for running tests\nagainst real hardware, even in CI.\n\nAt its core, tbot is a library for interacting with remote hosts over various\nconnections.  For example, a target board can be accessed via serial console.\nOr a TFTP-server via SSH.  tbot allows managing all these connections in\n\"parallel\".  This means, you can orchestrate complex sequences of interaction\nbetween them.\n\nAt the moment, the main focus of tbot lies in embedded Linux systems.  Support\nfor other systems is definitely intended to be added, too.\n\nMost info about *tbot* can be found in its documentation at\n\u003chttps://tbot.tools\u003e.  You can also join our mailing list,\n[tbot AT lists.denx.de](https://lists.denx.de/listinfo/tbot).\n\n---\n\n## Installation\n```bash\npip3 install --user -U git+https://github.com/rahix/tbot@v0.10.9\n```\n\nIf you haven't done it already, you need to add ``~/.local/bin`` to your ``$PATH``.\n\n\n### Completions\n*tbot* supports command line completions.  Install them with the following commands:\n\n```bash\ncurl --create-dirs -L -o ~/.local/lib/tbot/completions.sh https://github.com/Rahix/tbot/raw/master/completions.sh\necho \"source ~/.local/lib/tbot/completions.sh\" \u003e\u003e~/.bashrc\n```\n\n## Usecase Examples\nTo show what tbot can help you with, here are a few simple example usecases:\n\n#### Boot into Linux and run a few commands over serial console\n```python\n@tbot.testcase\ndef test_linux_simple():\n    # request serial connection to Linux on the board\n    with tbot.ctx.request(tbot.role.BoardLinux) as lnx:\n        # now we can run commands\n        lnx.exec0(\"uname\", \"-a\")\n\n        # or, for example, read a file from the target\n        cmdline = (lnx.fsroot / \"proc\" / \"cmdline\").read_text()\n```\n\n#### Define custom bootloader commands to boot Linux\n```python\nclass CustomBoardLinux(board.LinuxUbootConnector, board.LinuxBootLogin, linux.Bash):\n    username = \"root\"\n    password = None\n\n    def do_boot(self, uboot):\n        # set `autoload` env-var to false to prevent automatic DHCP-boot\n        uboot.env(\"autoload\", \"false\")\n\n        # get an IP-address\n        uboot.exec0(\"dhcp\")\n\n        # download kernel + initramfs from TFTP server\n        loadaddr = 0x82000000\n        uboot.exec0(\"tftp\", hex(loadaddr), f\"{tftp_ip}:{kernel_image_path}\")\n\n        # and boot it!\n        return uboot.boot(\"bootm\", hex(loadaddr))\n```\n\n#### Network speed test between a board and server\n```python\n@tbot.testcase\ndef test_ethernet_speed():\n    with tbot.ctx() as cx:\n        # boot into Linux on the board and acquire a shell-session\n        lnx = cx.request(tbot.role.BoardLinux)\n\n        # use ssh to connect to a network server to test against\n        lh = cx.request(tbot.role.LabHost)\n\n        # start iperf server\n        with lh.run(\"iperf\", \"-s\") as iperf_server:\n            # and display its output while waiting for startup\n            iperf_server.read_until_timeout(2)\n\n            # now run iperf client on DUT\n            tx_report = lnx.exec0(\"iperf\", \"-c\", server_ip)\n\n            # exit the server with CTRL-C\n            tbot.log.message(\"Server Output:\")\n            iperf_server.sendcontrol(\"C\")\n            iperf_server.terminate0()\n```\n\n## Contributing\nHelp is really appreciated!  Please take a look at *tbot*'s [contribution\nguidelines](CONTRIBUTING.md) for more info.  If you are unsure about anything,\nplease open an issue or consult the mailing list first!\n\n## License\ntbot is licensed under the `GNU General Public License v3.0 or later`.  See\n[LICENSE](LICENSE) for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Ftbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahix%2Ftbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahix%2Ftbot/lists"}