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
85 changes: 85 additions & 0 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Test Tools Image

on:
push:
branches: [main]
paths:
- 'test-tools/**'
tags:
- 'test-tools-v*'

jobs:
build-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
security-events: write
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tags
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/disentangle-network/test-tools
tags: |
type=match,pattern=test-tools-v(.*),group=1
type=raw,value=latest

- name: Build and push multi-arch image
id: build
uses: docker/build-push-action@v6
with:
context: ./test-tools
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: ghcr.io/disentangle-network/test-tools:latest
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH

- name: Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: trivy-results.sarif

- name: Install cosign
uses: sigstore/cosign-installer@v3

- name: Sign image by digest
env:
COSIGN_EXPERIMENTAL: "true"
run: |
cosign sign --yes ghcr.io/disentangle-network/test-tools@${{ steps.build.outputs.digest }}

- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
image: ghcr.io/disentangle-network/test-tools:latest
format: spdx-json
output-file: sbom.spdx.json

- name: Attach SBOM to image
run: |
cosign attach sbom --sbom sbom.spdx.json ghcr.io/disentangle-network/test-tools@${{ steps.build.outputs.digest }}
5 changes: 3 additions & 2 deletions helm/disentangle/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ spec:
restartPolicy: Never
containers:
- name: test-connection
image: alpine/curl:8.12.1
image: "{{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}"
imagePullPolicy: {{ .Values.testImage.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand Down
6 changes: 3 additions & 3 deletions helm/disentangle/templates/tests/test-genesis-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ spec:
restartPolicy: Never
containers:
- name: test-genesis
image: alpine/curl:8.12.1
image: "{{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}"
imagePullPolicy: {{ .Values.testImage.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -32,7 +33,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle Genesis Sync Test ==="

Expand Down
6 changes: 3 additions & 3 deletions helm/disentangle/templates/tests/test-rpc-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ spec:
restartPolicy: Never
containers:
- name: test-rpc
image: alpine/curl:8.12.1
image: "{{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}"
imagePullPolicy: {{ .Values.testImage.pullPolicy }}
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -32,7 +33,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle RPC API Test ==="

Expand Down
6 changes: 6 additions & 0 deletions helm/disentangle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ image:
tag: "" # defaults to appVersion from Chart.yaml
pullPolicy: IfNotPresent

# Test image (includes curl + jq; no runtime apk needed)
testImage:
repository: ghcr.io/disentangle-network/test-tools
tag: "latest"
pullPolicy: IfNotPresent

# Network configuration
nodes:
count: 5 # Number of nodes in the network
Expand Down
4 changes: 4 additions & 0 deletions test-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM cgr.dev/chainguard/wolfi-base:latest
RUN apk update && apk add --no-cache curl jq && rm -rf /var/cache/apk/*
USER 65532
ENTRYPOINT ["/bin/sh"]
17 changes: 9 additions & 8 deletions tests/golden/custom-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ spec:
restartPolicy: Never
containers:
- name: test-connection
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand Down Expand Up @@ -309,10 +310,11 @@ spec:
restartPolicy: Never
containers:
- name: test-genesis
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -329,7 +331,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle Genesis Sync Test ==="

Expand Down Expand Up @@ -397,10 +398,11 @@ spec:
restartPolicy: Never
containers:
- name: test-rpc
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -417,7 +419,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle RPC API Test ==="

Expand Down
17 changes: 9 additions & 8 deletions tests/golden/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ spec:
restartPolicy: Never
containers:
- name: test-connection
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand Down Expand Up @@ -309,10 +310,11 @@ spec:
restartPolicy: Never
containers:
- name: test-genesis
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -329,7 +331,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle Genesis Sync Test ==="

Expand Down Expand Up @@ -397,10 +398,11 @@ spec:
restartPolicy: Never
containers:
- name: test-rpc
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -417,7 +419,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle RPC API Test ==="

Expand Down
17 changes: 9 additions & 8 deletions tests/golden/full-features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,11 @@ spec:
restartPolicy: Never
containers:
- name: test-connection
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand Down Expand Up @@ -417,10 +418,11 @@ spec:
restartPolicy: Never
containers:
- name: test-genesis
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -437,7 +439,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle Genesis Sync Test ==="

Expand Down Expand Up @@ -505,10 +506,11 @@ spec:
restartPolicy: Never
containers:
- name: test-rpc
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -525,7 +527,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle RPC API Test ==="

Expand Down
17 changes: 9 additions & 8 deletions tests/golden/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ spec:
restartPolicy: Never
containers:
- name: test-connection
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand Down Expand Up @@ -303,10 +304,11 @@ spec:
restartPolicy: Never
containers:
- name: test-genesis
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -323,7 +325,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle Genesis Sync Test ==="

Expand Down Expand Up @@ -391,10 +392,11 @@ spec:
restartPolicy: Never
containers:
- name: test-rpc
image: alpine/curl:8.12.1
image: "ghcr.io/disentangle-network/test-tools:latest"
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 65534
runAsUser: 65532
allowPrivilegeEscalation: false

capabilities:
Expand All @@ -411,7 +413,6 @@ spec:
- -c
- |
set -e
apk add --no-cache jq > /dev/null 2>&1

echo "=== Disentangle RPC API Test ==="

Expand Down
Loading