This directory contains tests for the DMDEVFS module.
The primary tests verify that the DMDEVFS module builds correctly and produces the expected output files. These tests run automatically on CI.
To run the tests locally:
mkdir build_tests
cd build_tests
cmake .. -DDMOD_MODE=DMOD_MODULE -DDMDEVFS_BUILD_TESTS=ON
cmake --build .
ctest --output-on-failureFor more comprehensive testing, you can use the fs_tester tool from the dmvfs repository.
We provide a convenience script to run integration tests:
# 1. Build dmdevfs
mkdir build && cd build
cmake .. -DDMOD_MODE=DMOD_MODULE
cmake --build .
cd ..
# 2. Clone and build dmvfs with fs_tester
git clone https://github.com/choco-technologies/dmvfs.git /tmp/dmvfs
cd /tmp/dmvfs
mkdir build && cd build
cmake .. -DDMVFS_BUILD_TESTS=ON
cmake --build .
# 3. Run integration tests
cd /path/to/dmdevfs
./tests/run_integration_tests.sh /tmp/dmvfs/build/tests/fs_tester build/dmf/dmdevfs.dmfThe fs_tester can test DMDEVFS in read-only mode:
# Clone dmvfs if you haven't already
git clone https://github.com/choco-technologies/dmvfs.git
# Build fs_tester
cd dmvfs
mkdir build && cd build
cmake .. -DDMVFS_BUILD_TESTS=ON
cmake --build .
# Run tests on dmdevfs module (read-only mode)
./tests/fs_tester --read-only-fs path/to/dmdevfs.dmfCurrent automated tests verify:
- Module compilation succeeds
- Module output files are generated
- Build system integration works correctly
With fs_tester integration:
- File system interface implementation
- Read operations on device drivers
- Directory operations
- File metadata operations
Future test improvements could include:
- Device driver mock for testing file operations
- Write operation tests (if supported by drivers)
- Performance benchmarks
DMDEVFS is a device driver-based filesystem that depends on:
- Device driver modules (dmdrvi implementations)
- Configuration files specifying device mappings
- Actual hardware or mocked drivers
Full integration testing requires these dependencies to be available. The current test suite focuses on verifying the core module builds correctly. Device driver integration testing should be done with specific driver implementations.
The CI pipeline automatically:
- Builds the dmdevfs module
- Runs build verification tests
- Verifies the module files are created
To add fs_tester to CI in the future, the workflow would need to:
- Clone and build dmvfs
- Run fs_tester against the built dmdevfs module
- Report results
This can be added once device driver mocks or test drivers are available.