@celilo/e2e 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bin/cele2e +14 -0
- package/bin/e2e-cache-images +57 -0
- package/bin/e2e-shell +36 -13
- package/bin/e2e-status +8 -2
- package/bin/e2e-up +5 -5
- package/completions/install-zsh-completion.sh +78 -0
- package/config/dns/celilo.computer.zone +16 -0
- package/config/dns/iamtheinternet.org.zone +7 -6
- package/config/dns/knot-namecheap.conf +8 -0
- package/config/dns/knot-tld.conf +4 -0
- package/config/dns/lunacycle.net.zone +16 -0
- package/config/dns/net.zone +11 -0
- package/config/dns/org.zone +5 -0
- package/config/dns/root.zone +2 -0
- package/config/dns/templates/iamtheinternet.org.zone +16 -0
- package/config/dns/templates/lunacycle.net.zone +16 -0
- package/config/resolver/unbound.conf +10 -0
- package/config/routing/docker-image-preload.service +14 -0
- package/config/routing/docker-image-preload.sh +24 -0
- package/config/routing/management-routes.sh +24 -2
- package/config/routing/resolver-internal-routes.sh +59 -0
- package/docker/Dockerfile.internal-resolver +16 -0
- package/docker/Dockerfile.isitup +37 -0
- package/docker/Dockerfile.management +2 -0
- package/docker/Dockerfile.registry +34 -0
- package/docker/Dockerfile.target-machine +20 -0
- package/docker/Dockerfile.target-machine-docker +11 -19
- package/docker/Dockerfile.target-technitium +97 -0
- package/netapps/authentik.netapp +0 -0
- package/netapps/caddy.netapp +0 -0
- package/netapps/greenwave.netapp +0 -0
- package/netapps/homebridge.netapp +0 -0
- package/netapps/iptables.netapp +0 -0
- package/netapps/knot-unbound-internal.netapp +0 -0
- package/netapps/namecheap.netapp +0 -0
- package/netapps/technitium.netapp +0 -0
- package/netapps/test-ansible-output.netapp +0 -0
- package/package.json +8 -1
- package/simulators/greenwave/state.ts +7 -12
- package/simulators/isitup/Caddyfile +11 -0
- package/simulators/isitup/entrypoint.sh +47 -0
- package/simulators/isitup/server.ts +112 -0
- package/simulators/namecheap-ddns/server.ts +31 -2
- package/src/cli/build.ts +214 -0
- package/src/cli/command-registry.ts +100 -0
- package/src/cli/command-tree-parser.ts +52 -0
- package/src/cli/completion.ts +195 -0
- package/src/cli/index.ts +273 -0
- package/src/cli/module-discovery.ts +120 -0
- package/src/cli/scaffold.ts +108 -0
- package/src/container-manager.ts +373 -76
- package/src/docker-compose-generator.ts +127 -23
- package/src/network-builder.ts +21 -0
- package/src/parse-line.ts +147 -0
- package/src/runner.ts +197 -247
- package/src/simulator-ips.ts +42 -0
- package/src/types.ts +28 -0
- package/bin/cache-docker-images +0 -46
package/src/types.ts
CHANGED
|
@@ -4,6 +4,10 @@ export interface MachineSpec {
|
|
|
4
4
|
name: string;
|
|
5
5
|
ip: string;
|
|
6
6
|
zone: Zone;
|
|
7
|
+
/** Use the Docker-capable image (normally only app zone; set for internal machines that need Docker) */
|
|
8
|
+
docker?: boolean;
|
|
9
|
+
/** Override the Dockerfile used for this machine (relative to the e2e package) */
|
|
10
|
+
dockerfile?: string;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
export type TopologyPreset = 'default' | 'direct-internet';
|
|
@@ -27,6 +31,12 @@ export interface NetworkConfig {
|
|
|
27
31
|
* If not set, auto-detected by walking up from the package directory.
|
|
28
32
|
*/
|
|
29
33
|
celiloRoot?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Skip DNS zone scrubbing before the test starts. Useful for --keep
|
|
36
|
+
* debugging where you want to inspect the exact DNS state left by a
|
|
37
|
+
* previous test. Default: false (scrub runs).
|
|
38
|
+
*/
|
|
39
|
+
skipDnsScrub?: boolean;
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
export interface ExecResult {
|
|
@@ -77,6 +87,24 @@ export interface NetworkHandle {
|
|
|
77
87
|
label: string,
|
|
78
88
|
): Promise<void>;
|
|
79
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Set the Caddy ACME CA to the Pebble endpoint so TLS certificates are
|
|
92
|
+
* issued by the simulated Let's Encrypt rather than the real one.
|
|
93
|
+
*
|
|
94
|
+
* Call this after importing the caddy module and before deploying it.
|
|
95
|
+
* Every e2e test that involves TLS must call this — it is not automatic
|
|
96
|
+
* so the call site is self-documenting.
|
|
97
|
+
*/
|
|
98
|
+
configureAcme(): Promise<void>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Package a local module and upload it to the e2e registry so it can be
|
|
102
|
+
* imported via `celilo module import public-registry <name>`.
|
|
103
|
+
*
|
|
104
|
+
* @param localPath - Absolute or relative path to the module source directory
|
|
105
|
+
*/
|
|
106
|
+
publishModule(localPath: string): Promise<void>;
|
|
107
|
+
|
|
80
108
|
/** Tear down the entire network */
|
|
81
109
|
stop(): Promise<void>;
|
|
82
110
|
|
package/bin/cache-docker-images
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Pre-pull and save Docker images needed by e2e test modules.
|
|
4
|
-
# Saves them as tarballs that get mounted into app-zone containers
|
|
5
|
-
# for fast loading at boot time.
|
|
6
|
-
#
|
|
7
|
-
# Run this once (or after updating image versions) to populate the cache.
|
|
8
|
-
# Images are stored in e2e/docker-image-cache/
|
|
9
|
-
|
|
10
|
-
set -e
|
|
11
|
-
|
|
12
|
-
CACHE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/docker-image-cache"
|
|
13
|
-
mkdir -p "$CACHE_DIR"
|
|
14
|
-
|
|
15
|
-
IMAGES=(
|
|
16
|
-
"docker.io/library/postgres:15-alpine"
|
|
17
|
-
"docker.io/library/redis:alpine"
|
|
18
|
-
"ghcr.io/goauthentik/server:2024.2.2"
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
echo "Caching Docker images for e2e tests..."
|
|
22
|
-
echo "Cache directory: $CACHE_DIR"
|
|
23
|
-
echo ""
|
|
24
|
-
|
|
25
|
-
for image in "${IMAGES[@]}"; do
|
|
26
|
-
# Create a safe filename from the image name
|
|
27
|
-
filename=$(echo "$image" | sed 's|[/:]|_|g').tar
|
|
28
|
-
|
|
29
|
-
if [[ -f "$CACHE_DIR/$filename" ]]; then
|
|
30
|
-
echo "✓ $image (already cached)"
|
|
31
|
-
continue
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
echo "▸ Pulling $image..."
|
|
35
|
-
docker pull "$image"
|
|
36
|
-
|
|
37
|
-
echo " Saving to $filename..."
|
|
38
|
-
docker save "$image" > "$CACHE_DIR/$filename"
|
|
39
|
-
|
|
40
|
-
size=$(du -h "$CACHE_DIR/$filename" | cut -f1)
|
|
41
|
-
echo "✓ $image ($size)"
|
|
42
|
-
done
|
|
43
|
-
|
|
44
|
-
echo ""
|
|
45
|
-
echo "Cache complete. $(ls "$CACHE_DIR"/*.tar 2>/dev/null | wc -l | tr -d ' ') images cached."
|
|
46
|
-
echo "Total size: $(du -sh "$CACHE_DIR" | cut -f1)"
|