|
| 1 | +# XCP-ng Server Compatibility Test Kit v1 |
| 2 | + |
| 3 | +## Preamble |
| 4 | + |
| 5 | +This is version 1 of a server compatibility test kit for XCP-ng. |
| 6 | + |
| 7 | +It is a work in progress, based on existing test suites in the XCP-ng project, and will evolve over |
| 8 | +time towards a comprehensive automated test kit. |
| 9 | + |
| 10 | +Version 1 introduces **Docker containerization** of the test runner, automating much of the manual |
| 11 | +setup previously required. The entire workflow—from SSH key generation and VM image download to |
| 12 | +multi-phase test execution and cleanup—is now orchestrated within a container. |
| 13 | + |
| 14 | +## Requirements |
| 15 | + |
| 16 | +- **Docker** installed on your machine (or Docker Desktop for macOS/Windows) |
| 17 | +- **Hosts to test:** |
| 18 | + - At least one x86_64 server with XCP-ng installed (the release you want to test), |
| 19 | + [updated with the latest updates](https://xcp-ng.org/docs/updates.html) |
| 20 | + - A disk for the system, and a separate, empty disk for testing |
| 21 | + - Ideally, a second identical host joined to the first as a pool of two hosts (for storage |
| 22 | + migration and live migration tests) |
| 23 | + - Network connectivity for management interface |
| 24 | + - SSH access available (root user; password-based authentication will be used to install a |
| 25 | + temporary testing key) |
| 26 | + |
| 27 | +## Security Notes |
| 28 | + |
| 29 | +- The container runs as a **non-root user** (nobody) for security |
| 30 | +- SSH keys are generated in a temporary directory inside the container and are automatically |
| 31 | + cleaned up on exit |
| 32 | +- The SSH root password is never stored; it's only used to install the temporary public key |
| 33 | +- Temporary SSH keys are removed from remote hosts on exit (unless `--skip-cleanup` is used) |
| 34 | + |
| 35 | +## Quick Start |
| 36 | + |
| 37 | +Interactive mode (recommended): |
| 38 | + |
| 39 | +```bash |
| 40 | +docker run -it --rm -v ${PWD}:/app/logs ghcr.io/xcp-ng/xcp-ng-tests/compat-kit |
| 41 | +``` |
| 42 | + |
| 43 | +You will be prompted for: |
| 44 | + |
| 45 | +- IP/hostname of the pool master |
| 46 | +- IP/hostname of a second host (optional; press Enter to skip) |
| 47 | +- SSH root password (used only for initial key installation, never stored) |
| 48 | + |
| 49 | +Alternatively, provide arguments on the command line: |
| 50 | + |
| 51 | +```bash |
| 52 | +docker run -it --rm \ |
| 53 | + -v ${PWD}:/app/logs \ |
| 54 | + ghcr.io/xcp-ng/xcp-ng-tests/compat-kit \ |
| 55 | + --master-host 192.168.1.10 \ |
| 56 | + --second-host 192.168.1.11 |
| 57 | +``` |
| 58 | + |
| 59 | +After the container completes (or exits), test log files will be in the current directory: |
| 60 | + |
| 61 | +- `test_kit_1.log` — Single-host tests |
| 62 | +- `test_kit_2.log` — Two-host pool tests — only if a second host was provided |
| 63 | +- `test_kit_3.log` — Xen-level tests |
| 64 | + |
| 65 | +Open these files locally with your text editor or log viewer. |
| 66 | + |
| 67 | +## Command-line options |
| 68 | + |
| 69 | +```text |
| 70 | +--master-host MASTER_HOST |
| 71 | + IP or hostname of the pool master |
| 72 | +--second-host SECOND_HOST |
| 73 | + IP or hostname of the second host (optional, for pool tests) |
| 74 | +--password PASSWORD SSH root password (if not provided, will be prompted) |
| 75 | +--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} |
| 76 | + Logging level (default: INFO) |
| 77 | +--vm-image-url VM_IMAGE_URL |
| 78 | + URL to the VM image to download (default: TODO) |
| 79 | +--skip-cleanup Don't remove SSH keys from hosts on exit |
| 80 | +--dry-run Print what would be done without making any changes |
| 81 | +--non-interactive Don't prompt for missing parameters; fail if required arguments are missing |
| 82 | +--mgmt-network MGMT_NETWORK |
| 83 | + MGMT network description (will be set in data.py NETWORKS) |
| 84 | +``` |
| 85 | + |
| 86 | +## Development |
| 87 | + |
| 88 | +### Building the Docker image |
| 89 | + |
| 90 | +From the xcp-ng-tests repository root: |
| 91 | + |
| 92 | +```bash |
| 93 | +docker build -t ghcr.io/xcp-ng/xcp-ng-tests/compat-kit -f compat_kit/Dockerfile . |
| 94 | +``` |
| 95 | + |
| 96 | +This creates an image with all dependencies pre-installed, including the xcp-ng-tests suite and |
| 97 | +test runner tools. |
0 commit comments