Closed mob5566 closed 2 months ago
Very cool! Taking as is. Looks great!
Suggestion: move the test stuff into lib/fs/v9p to go along with it. I'm starting to move things out of that app into sub modules for various things and trying to generally switch standalone things to the unittest framework. I think FS tests are probably not usable as a unittest per se, since they require the system be set up a particular way, but as an example lib/fs/fat has a test sub module with all the stuff there.
Oh there's a WITH_TESTS build variable and #define that you can switch including the submodule on.
Hi @travisg,
That sounds great! I should have moved the testing code along with the modules, right? The folder app/tests
will contain unittests only. Do I understand correctly?
With the following changes, the VirtIO 9p device can be exported as a LK filesystem and use the file APIs, e.g.
fs_open_file
,fs_read_file
,fs_write_file
, etc.An example of using LK command
ls
to examine the shared filesystem is provided.On the other hand, I add an example test
v9fs_tests
to validate the basic functions of the VirtIO 9p filesystem. The test does a similar check asapp/tests/v9p_tests.c
. It mount the littlekernel codebase onto/v9p
and dump the first 1024 bytes of theLICENSE
file.