Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions .github/workflows/freebsd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
release: '14.3'
usesh: true
prepare: |
pkg install -y llvm
pkg install -y llvm kyua

run: |
# Print FreeBSD version
Expand Down Expand Up @@ -56,4 +56,49 @@ jobs:
# Check module information
file bfcfs.ko

echo "All checks passed!"
echo "Build successful! Now running tests..."

# Verify test fixture exists
if [ ! -f tests/fixtures/test.bfc ]; then
echo "Warning: Test fixture tests/fixtures/test.bfc not found, skipping tests"
echo "All checks passed (build only)!"
exit 0
fi

echo "Test container found, proceeding with tests..."

# Load the kernel module
echo "Loading BFCFS kernel module..."
kldload ./bfcfs.ko || {
echo "ERROR: Failed to load kernel module"
kldstat
dmesg | tail -20
exit 1
}

# Verify module is loaded
kldstat | grep bfcfs || {
echo "ERROR: Module not loaded"
exit 1
}

# Run the tests
echo "Running BFCFS tests..."
cd tests
kyua test || {
echo "Tests failed, showing report:"
kyua report --verbose
cd ..
kldunload bfcfs || true
exit 1
}

# Show test report
echo "Test results:"
kyua report

# Unload module
cd ..
kldunload bfcfs

echo "All checks and tests passed!"
86 changes: 66 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Low-level I/O routines (pread, object reading, CRC verification)
bfcfs-freebsd/
├── .github/
│ └── workflows/
│ └── freebsd-build.yml # GitHub Actions CI
│ └── freebsd-build.yml # GitHub Actions CI with tests
├── .gitignore # Git ignore rules
├── LICENSE # BSD 3-Clause License
├── Makefile # Build configuration
Expand All @@ -139,7 +139,16 @@ bfcfs-freebsd/
├── bfcfs_vfs.c # VFS operations
├── bfcfs_vnops.c # Vnode operations
├── bfc_format.c # BFC format parsing
└── bfc_io.c # I/O routines
├── bfc_io.c # I/O routines
└── tests/ # ATF test suite
├── Kyuafile # Test configuration
├── h_funcs.subr # Test helper functions
├── mount_test # Mount/unmount tests
├── read_test # Read operation tests
├── readdir_test # Directory listing tests
├── symlink_test # Symlink tests
└── fixtures/ # Test BFC containers
└── README.md # Fixture documentation
```

## Debugging
Expand Down Expand Up @@ -218,14 +227,36 @@ doas kldload ./bfcfs.ko

### Testing:

The module includes an ATF-based test suite using Kyua:

```sh
# Install test dependencies
doas pkg install kyua

# Load the module
doas kldload ./bfcfs.ko

# Run the test suite
cd tests
doas kyua test

# View test results
kyua report

# Detailed report
kyua report --verbose
```

#### Manual Testing:

```sh
# Create a test mount point
doas mkdir -p /mnt/bfc

# Mount test container
doas mount -t bfcfs -o ro /path/to/test.bfc /mnt/bfc

# Run tests
# Run manual tests
ls -la /mnt/bfc
cat /mnt/bfc/somefile.txt
find /mnt/bfc -type f
Expand All @@ -234,6 +265,21 @@ find /mnt/bfc -type f
doas umount /mnt/bfc
```

### Test Suite Structure:

```
tests/
├── Kyuafile # Test configuration
├── h_funcs.subr # Helper functions
├── mount_test # Mount/unmount tests
├── read_test # Read operations tests
├── readdir_test # Directory listing tests
├── symlink_test # Symlink support tests
└── fixtures/
├── README.md # Fixture documentation
└── test.bfc # Test BFC container
```

## License

BSD 3-Clause License - See [LICENSE](LICENSE) file for details
Expand Down Expand Up @@ -315,12 +361,12 @@ doas mount -t bfcfs -o ro /var/containers/website.bfc /var/www/html

| Feature | BFCFS | SquashFS | ISO9660 | FUSE |
| -------------- | ----- | -------- | ------- | ------ |
| Read-only | | ✅ | ✅ | ❌ |
| Kernel module | | ✅ | ✅ | ❌ |
| Compression | 🚧 | | ❌ | Varies |
| Encryption | 🚧 | | ❌ | Varies |
| CRC integrity | | ✅ | ❌ | Varies |
| Cross-platform | | ✅ | ✅ | ✅ |
| Read-only | [x] | [x] | [x] | [-] |
| Kernel module | [x] | [x] | [x] | [-] |
| Compression | [ ] | [x] | [-] | Varies |
| Encryption | [ ] | [-] | [-] | Varies |
| CRC integrity | [x] | [x] | [-] | Varies |
| Cross-platform | [x] | [x] | [x] | [x] |
| Performance | High | High | High | Medium |

## Project Status
Expand All @@ -329,20 +375,20 @@ doas mount -t bfcfs -o ro /var/containers/website.bfc /var/www/html

### Implemented Features

- Mount/unmount operations
- Directory listing and navigation
- File reading (uncompressed)
- Symlink support
- CRC32C verification
- Hardware-accelerated checksums
- [x] Mount/unmount operations
- [x] Directory listing and navigation
- [x] File reading (uncompressed)
- [x] Symlink support
- [x] CRC32C verification
- [x] Hardware-accelerated checksums

### Planned Features (Roadmap)

- 🚧 ZSTD decompression support
- 🚧 ChaCha20-Poly1305 decryption support
- 🚧 Extended attributes
- 🚧 Advanced mount options
- 🚧 Performance optimizations
- [ ] ZSTD decompression support
- [ ] ChaCha20-Poly1305 decryption support
- [ ] Extended attributes
- [ ] Advanced mount options
- [ ] Performance optimizations

## Contributing

Expand Down
Loading