|
3 | 3 | # Cozystack end‑to‑end provisioning test (Bats) |
4 | 4 | # ----------------------------------------------------------------------------- |
5 | 5 |
|
6 | | -@test "Environment variable COZYSTACK_INSTALLER_YAML is defined" { |
7 | | - if [ -z "${COZYSTACK_INSTALLER_YAML:-}" ]; then |
8 | | - echo 'COZYSTACK_INSTALLER_YAML environment variable is not set!' >&2 |
9 | | - echo >&2 |
10 | | - echo 'Please export it with the following command:' >&2 |
11 | | - echo ' export COZYSTACK_INSTALLER_YAML=$(helm template -n cozy-system installer packages/core/installer)' >&2 |
| 6 | +@test "Required installer assets exist" { |
| 7 | + if [ ! -f _out/assets/cozystack-installer.yaml ]; then |
| 8 | + echo "Missing: _out/assets/cozystack-installer.yaml" >&2 |
| 9 | + exit 1 |
| 10 | + fi |
| 11 | + |
| 12 | + if [ ! -f _out/assets/nocloud-amd64.raw.xz ]; then |
| 13 | + echo "Missing: _out/assets/nocloud-amd64.raw.xz" >&2 |
12 | 14 | exit 1 |
13 | 15 | fi |
14 | 16 | } |
|
70 | 72 | done |
71 | 73 | } |
72 | 74 |
|
73 | | -@test "Download Talos NoCloud image" { |
74 | | - if [ ! -f nocloud-amd64.raw ]; then |
75 | | - wget https://github.com/cozystack/cozystack/releases/latest/download/nocloud-amd64.raw.xz \ |
76 | | - -O nocloud-amd64.raw.xz --show-progress --output-file /dev/stdout --progress=dot:giga 2>/dev/null |
77 | | - rm -f nocloud-amd64.raw |
78 | | - xz --decompress nocloud-amd64.raw.xz |
| 75 | +@test "Use Talos NoCloud image from assets" { |
| 76 | + if [ ! -f _out/assets/nocloud-amd64.raw.xz ]; then |
| 77 | + echo "Missing _out/assets/nocloud-amd64.raw.xz" 2>&1 |
| 78 | + exit 1 |
79 | 79 | fi |
| 80 | + |
| 81 | + rm -f nocloud-amd64.raw |
| 82 | + cp _out/assets/nocloud-amd64.raw.xz . |
| 83 | + xz --decompress nocloud-amd64.raw.xz |
80 | 84 | } |
81 | 85 |
|
82 | 86 | @test "Prepare VM disks" { |
|
243 | 247 | --from-literal=api-server-endpoint=https://192.168.123.10:6443 \ |
244 | 248 | --dry-run=client -o yaml | kubectl apply -f - |
245 | 249 |
|
246 | | - # Apply installer manifests from env variable |
247 | | - echo "$COZYSTACK_INSTALLER_YAML" | kubectl apply -f - |
| 250 | + # Apply installer manifests from file |
| 251 | + kubectl apply -f _out/assets/cozystack-installer.yaml |
248 | 252 |
|
249 | 253 | # Wait for the installer deployment to become available |
250 | 254 | kubectl wait deployment/cozystack -n cozy-system --timeout=1m --for=condition=Available |
|
0 commit comments