Skip to content

MeshEnvy/lofs-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoFS Test - Comprehensive Filesystem Testing Suite

A Meshtastic firmware plugin that runs comprehensive tests for the LoFS unified filesystem

LoFS Test is a testing plugin that validates LoFS (LittleFS + SD card File System) functionality. It runs automatically when the module is initialized and provides detailed test results via serial output.

Installation

Using Mesh Forge (easy)

Use our Mesh Forge build profile to flash a LoFS Test-enabled version of Meshtastic to your device.

Build it yourself

LoFS Test is a Meshtastic plugin that is automatically discovered and integrated by the Mesh Plugin Manager (MPM). To install LoFS Test:

  1. Install the Mesh Plugin Manager:
pip install mesh-plugin-manager
  1. Install LoFS Test:
cd /path/to/meshtastic/firmware
mpm init
mpm install lofs-test
  1. Build and flash:
pio run -e t-deck -t upload

Usage

The test suite runs automatically when the module is initialized (during device boot). To view the test results:

  1. Connect to serial monitor:
pio run -t monitor

Or if you're already in the PlatformIO environment:

pio device monitor
  1. Look for the test output:

The test suite will output detailed results starting with:

INFO  | ??:??:?? X === LoFS Comprehensive Test Suite ===

The tests run automatically and include:

  • Test 1: Filesystem Availability - Checks if LittleFS and SD card are available
  • Test 2: Filesystem Space Information - Reports total, used, and free space
  • Test 3: Basic File Operations (LittleFS) - Write, read, exists operations
  • Test 4: Basic File Operations (SD Card) - Same operations on SD card (if available)
  • Test 5: Directory Operations - Create and verify directories
  • Test 6: File Size Verification - Tests various file sizes (0 to 2048 bytes)
  • Test 7: Cross-Filesystem Operations - Copy files between LittleFS and SD card
  • Test 8: Same-Filesystem Rename - Rename operations within same filesystem
  • Test 9: Error Cases - Invalid paths, non-existent files, etc.
  • Test 10: Cleanup - Removes all test files and directories

All test results are logged with INFO level, making them easy to spot in the serial output. Tests that require SD card functionality will be skipped if no SD card is detected.

Test Output Example

INFO  | ??:??:?? 2 === LoFS Comprehensive Test Suite ===
INFO  | ??:??:?? 2 
INFO  | ??:??:?? 2 --- Test 1: Filesystem Availability ---
INFO  | ??:??:?? 2 LittleFS available: YES
INFO  | ??:??:?? 2 SD Card available: NO
INFO  | ??:??:?? 2 
INFO  | ??:??:?? 2 --- Test 2: Filesystem Space Information ---
INFO  | ??:??:?? 2 LittleFS - Total: 1572864 bytes (1536.00 KB, 1.50 MB)
...

Notes

  • The test suite runs once during module initialization (device boot)
  • Tests are non-destructive - all test files are cleaned up automatically
  • SD card tests require HAS_SDCARD to be defined in your build configuration
  • On ESP32, you may see harmless VFS warnings when checking for non-existent files - these can be ignored

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published