| .. | ||
| README.md | ||
| SETUP-SUMMARY.md | ||
| start-testing.ps1 | ||
| start-testing.sh | ||
| test-apt-layer.sh | ||
apt-layer C Implementation - Testing Environment
This directory contains scripts and documentation for testing the apt-layer C implementation.
Directory Structure
apt-layer/
├── build/ # Build artifacts (gitignored)
├── docker/ # Docker testing environment (gitignored)
├── scripts/ # Testing scripts and documentation
├── src/ # C source code
├── bin/ # Compiled binary
└── ...
Quick Start
Prerequisites
- Docker and Docker Compose installed
- apt-cache server running
- Git Bash (for Windows users)
Starting the Testing Environment
Windows (PowerShell)
.\scripts\start-testing.ps1
Linux/macOS (Bash)
./scripts/start-testing.sh
The script will:
- Check for the existing apt-cache server (apt-cacher-ng on port 3142)
- Build and start the Ubuntu 24.04 testing container
- Connect to the existing apt-cache server for faster package downloads
- Attach you to an interactive shell inside the container
Manual Container Management
# Start container
cd docker && docker-compose up -d
# Attach to container
docker-compose exec apt-layer-test /bin/bash
# View logs
docker-compose logs -f apt-layer-test
# Stop container
docker-compose down
Testing the C Implementation
Basic Tests (Outside Container)
./scripts/test-apt-layer.sh
Advanced Tests (Inside Container)
# Build the C binary
make clean && make
# Test basic functionality
./bin/apt-layer --help
./bin/apt-layer --version
# Test with actual OSTree operations
./bin/apt-layer --list
./bin/apt-layer --info particleos/base/plucky
# Test layer creation
./bin/apt-layer particleos/base/plucky particleos/test/plucky
Environment Details
Container Features
- Base Image: Ubuntu 24.04 (Plucky)
- Build Tools: gcc, make, git
- OSTree: Full OSTree installation with development headers
- Container Tools: Podman and Docker
- Package Cache: Connected to existing apt-cacher-ng server
Volume Mounts
- Workspace:
/workspace(project root) - Cache:
/cache(persistent cache directory)
Network
- apt-cache: Connected to existing
particleos-network - Proxy: Uses apt-cacher-ng for faster package downloads
Troubleshooting
Container Won't Start
- Check if Docker is running
- Ensure port 3142 is available for apt-cache
- Check Docker logs:
docker-compose logs apt-layer-test
apt-cache Connection Issues
- Verify apt-cacher-ng is running:
docker ps | grep apt-cacher-ng - Start it if needed:
docker start apt-cacher-ng - Check network connectivity:
curl http://localhost:3142/acng-report.html
Build Failures
- Ensure all dependencies are installed in container
- Check for sufficient disk space
- Verify OSTree repository permissions
Development Workflow
- Edit C code in
src/directory - Build with
make clean && make - Test with
./scripts/test-apt-layer.sh - Advanced testing in Docker container
- Iterate and repeat
Integration with particleos-builder
This testing environment is designed to work alongside your existing particleos-builder setup:
- Shared apt-cache: Uses the same apt-cacher-ng server
- Shared network: Connects to particleos-network
- Complementary: Focuses on apt-layer development while particleos-builder handles OS builds
Files
start-testing.sh- Bash startup scriptstart-testing.ps1- PowerShell startup scripttest-apt-layer.sh- Basic test suiteSETUP-SUMMARY.md- Detailed setup documentation