-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help on mocking physical usb device #180
Comments
Well, two general approaches:
Seems like you are going for option 1. Option 2 is obviously much simpler, but requires re-generating the recording when something changes (e.g. libfprint uses this, but doing a recording of a fingerprint device is very simple and quick). You can do it with umockdev, but it isn't the most convenient. For an example, maybe see the libusb tests which are written in C and have custom handling of URB submission and reaping (you can use any other programming language if you prefer). Have a look specifically at The main caveat might be that libusb will busy loop, always thinking it can reap an URB. But that is unlikely to be a big issue in a test environment. I suspect there are other options to do all this, and I really have no idea whether umockdev is the best tool in your case. |
Well, I am saying "any other programming language". I haven't actually tried it, I hope it works, but there might be weird things happening when accessing the binary buffers within the |
Thanks for the inputs. I am going through the tests and will get back if needed. |
Firstly thanks for the wonderful tool.
Requirement:
I want to use umockdev for mocking USB device and want inputs on how to do that.
I don't have the physical device (it is client owned lab device), but I have the communication requests and responses which the device sends and expect.
Below is the illustration
also to mention recording the device commands is complicated process (multiple approvals and environment issues).
I have to create a virtual device(software mock of actual device) for E2E testing.
Please let me know if this is possible(and how) using umockdev . TIA
The text was updated successfully, but these errors were encountered: