# Test Case: LZ4 Compression Basic Support

**Test ID**: TC084-lz4-basic  

**G5 fixture contract**: Use [G5-MANUAL-SETUP.md](G5-MANUAL-SETUP.md).
Its generated paths, source comparisons, structured corruption offsets, and
cleanup rules supersede placeholder examples in this file.
**Category**: Compression  
**Priority**: Critical  
**Regression**: None

## Objective
Verify basic LZ4 compression support for reading compressed files.

## Preconditions
- EROFS image with LZ4 compression: `test-lz4-basic.erofs`
- Test file: `/files/test-lz4.txt` (1MB, highly compressible)
- Mount point: `/mnt/test`

## Test Steps
1. Mount the LZ4-compressed image:
   ```
   mount -t erofs /dev/md0 /mnt/test
   ```

2. Read entire compressed file:
   ```
   cat /mnt/test/files/test-lz4.txt > /tmp/output.txt
   ```

3. Verify file size:
   ```
   stat -f %z /mnt/test/files/test-lz4.txt
   ```

4. Compare with reference (uncompressed):
   ```
   cmp /tmp/output.txt /tmp/reference.txt
   ```

5. Test multiple LZ4-compressed files:
   ```
   for f in /mnt/test/files/lz4-*.txt; do
     cat "$f" > /dev/null
   done
   ```

## Expected Results
- Step 1: Mount succeeds
- Step 2: File read successfully, decompressed transparently
- Step 3: Size matches original uncompressed size (1048576 bytes)
- Step 4: Files identical (cmp returns 0)
- Step 5: All LZ4 files read without errors

## Verification Method
- Verify decompression transparent to application
- Confirm data integrity after decompression
- Test LZ4 decompression performance acceptable
- Verify compressed file sizes smaller than uncompressed

## Cleanup
```
umount /mnt/test
mdconfig -d -u md0
rm /tmp/output.txt
```

## Notes
- LZ4 provides fast decompression with moderate compression ratio
- EROFS uses LZ4 for general-purpose compression
- Related tests: TC003 (LZ4 compressed read), TC085 (large files)
