{"id":20367464,"url":"https://github.com/linux-test-project/usfstl","last_synced_at":"2025-04-12T05:27:14.618Z","repository":{"id":126475706,"uuid":"290999455","full_name":"linux-test-project/usfstl","owner":"linux-test-project","description":"User Space Firmware Simulation Testing Library (\"USFSTL\")","archived":false,"fork":false,"pushed_at":"2024-01-06T20:18:01.000Z","size":913,"stargazers_count":9,"open_issues_count":0,"forks_count":9,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-26T00:51:20.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linux-test-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-08-28T08:56:32.000Z","updated_at":"2024-04-26T13:29:41.000Z","dependencies_parsed_at":"2024-01-06T21:24:24.209Z","dependency_job_id":"f1e0b135-aa2e-4d13-8738-2c7a9ae5a812","html_url":"https://github.com/linux-test-project/usfstl","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/linux-test-project%2Fusfstl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-test-project%2Fusfstl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-test-project%2Fusfstl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-test-project%2Fusfstl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-test-project","download_url":"https://codeload.github.com/linux-test-project/usfstl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248521401,"owners_count":21118065,"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-15T00:32:13.628Z","updated_at":"2025-04-12T05:27:14.586Z","avatar_url":"https://github.com/linux-test-project.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# USFSTL\n\n## Introduction\n\nThis is the User Space Firmware Simulation Testing Library (\"USFSTL\")\n-- a simulation (and to some extent unit) testing framework (mostly)\nintended for firmware.\n\nThe library also integrates with User-Mode-Linux and vhost-user to\nallow simulating devices and testing them against a real (virtio)\ndriver running in Linux. If you came here just for this, take a look\nat the vlab/ directory and the code under control/ first.\n\n## License\n\nThis library/code is licensed under BSD-3-Clause, see the\n[LICENSE](LICENSE) file.\n\n## Contributions\n\nWe welcome contributions to this code, please take a look at the\n[CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n## Capabilities\n\nThe library (and associated tools) offer the following:\n\n### Job Scheduler\n\nThere's support for scheduling \"jobs\", which are really just function\ncallbacks to occur at a specific point in time. This might be useful\nby itself, but is mostly used together with the contexts to provide a\ncooperative multi-threading implementation (tasks).\n\nThe job scheduler can also be used together with User-Mode-Linux, we\nhave a global scheduler for the \"time-travel=ext:...\" protocol that\nLinux supports. This tool (under control/) also supports virtio-net\ndevices using the vhost-user capability.\n\n### Simulation-capable vhost-user support\n\nWith a few extensions to the vhost-user protocol that are implemented\nhere and in the User-Mode-Linux virtio driver, the protocol becomes\ncapable of doing time-independent simulation.\n\n### Contexts\n\nContexts are execution contexts, provided either by threads (pthread,\navailable on Windows and Linux), fibers (Windows) or ucontexts (Linux).\nThis allows having different pieces of code execute semi-concurrently.\nIn this, context switching would have to be implemented manually.\n\n### Tasks / Semaphores\n\nThis is a full cooperative multi-threading implementation that allows\nswitching between tasks, locking (semaphores), relative priorities,\nand (through interaction between the scheduler and tasks) grouping\ntasks and blocking groups for execution, e.g. to implement critical\nsections.\n\n### Function stubbing\n\nThis allows skipping or replacing any inner function calls that may\nbe made, in order to test.\n\n### Static function calling\n\nThis allows calling a function that's marked static in the tested\ncode (assuming you make the compiler not inline it.)\n\n### Assert mechanism\n\nThere are various assert macros that fail a test and print out a\nmore or less verbose message, including stack dump.\n\n### Multi-process testing / RPC framework\n\nThe RPC framework is geared towards simulation and will automatically\npropagate the current time on RPC calls, etc.\n\n### Logging framework\n\nA very basic logging framework exists that can take advantage of the\nRPC mechanisms to have central logging when multiple binaries are\ninvolved in a test.\n\n### Test runner\n\nMultiple tests can be linked into the same binary (though they\ncurrently need to have the same tested files, outside of which\nfunction calls are not permitted), and the test runner will run\nand summarize the tests, this is provide as a main() function in\nthe USFSTL library that gets linked with the test cases.\n\n### Global data handling\n\nGlobal data is saved at the beginning and restored after each test\nrun to ensure a clean state for the next test.\n\n\n## Security\n\nWe do not expect this library to be used in any context other than\ntesting, and as such don't expect that there will be any security\nissues.\n\nHowever, should you nevertheless find a security issue, please report\nit privately to johannes@sipsolutions.net, rather than filing a github\nticket.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-test-project%2Fusfstl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-test-project%2Fusfstl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-test-project%2Fusfstl/lists"}