-
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
sysfs "trailing newline" behaviour can't be easily mocked #175
Comments
Heh, I was actually thinking of abusing that in the libfprint test suite to see whether libfprint wrote the file. But, I guess I could also look a the ctime. |
At first sight that sounds like issue #115 which was fixed more than two years ago in commit 1b58d24. But that was about umockdev-record, and it seems you try this directly with "echo", outside of any umockdev stuff.
Supposedly you wanted to do This "reading automatically implies a newline" seems driver specific, especially for binary attributes:
But this is inconsistent also for textual attributes:
I.e. the (this is my actual system, not mocked). So this seems so arbitrary and coincidental that I'm afraid libumockdev just can't emulate that. Or did I misunderstand you? If so, what precisely did you expect to happen with your commands? |
Right. The kernel doesn't make a difference here.
I don't expect binary attributes to be adding data, obviously, but text, and single value ones almost always do though:
Obviously umockdev doesn't know which attributes behave this way, but we do because we have the sources for it. It would be useful to be able to do that for specific attributes, to mock the kernel more closely and catch more potential mistakes. |
If I were to write a sysfs attribute, in most cases,
cat
ing it back should result in the same data I wrote, plus a newline being printed. Unfortunately, there doesn't seem to be a way to mock that behaviour in umockdev.See https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/347 for a bug I couldn't test in the test suite.
The text was updated successfully, but these errors were encountered: