Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ev3dev sysfs simulation#783

JakubVanek started this conversation inGeneral
Discussion options

splitting from the main issue (#765) to prevent polluting it

Currently, "standard" filesystems can indeed used for ev3dev /sys emulation. This is intended primarily for unit testing. The way it works is by creating the necessary files & folders usingfake_ev3dev helper classes and then relying on sensors reading their attributes as regular files from a mock sysfs directory. All sysfs structures should exist underCURRENT_ROOT_PATH; this is/sys/class on EV3 and a custom temporary directory when running unit tests.

Sysfs and real filesystem sometimes behave differently; this can be observed ontruncate()/write() behaviour and more. For now, these differences need to be worked around, as most of the current unit tests likely use the regular files to mock things.

The emulation accuracy could theoretically be improved by implementing a custom filesystem throughFUSE. That would allow implementing special handling of the individual syscalls to more closely follow the behaviour of real /sys. However, while it looks interesting, I'm not sure there's much to be gained by implementing that.

@dwalend@jabrena

You must be logged in to vote

Replies: 1 comment

Comment options

He have discussed it in the past@JakubVanek

If with current model, we can test, we have one model.
We are not able to refactor everything in every time.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@JakubVanek@jabrena

[8]ページ先頭

©2009-2025 Movatter.jp