Skip to content
Closed
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
2 changes: 1 addition & 1 deletion compose/bmc-sim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ x-redfish-bmc: &redfish-bmc
mkdir -p /tmp/tls
openssl req -x509 -newkey rsa:2048 -nodes \
-keyout /tmp/tls/key.pem -out /tmp/tls/cert.pem \
-days 365 -subj "/CN=${HOSTNAME}" 2>/dev/null
-days 365 -subj "/CN=$${HOSTNAME}" 2>/dev/null
exec sushy-emulator --fake -i :: -p 443 \
--ssl-certificate /tmp/tls/cert.pem \
--ssl-key /tmp/tls/key.pem
Expand Down
3 changes: 2 additions & 1 deletion compose/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ services:
command:
- "serve"
- "--port=27793"
- "--database-url=file:/data/fru.db?cache=shared&_fk=1"
- "--database-url=file:/data/fru.db?cache=shared&_fk=1&_busy_timeout=5000&_journal_mode=WAL"
tmpfs:
- /data:mode=1777
ports:
Expand All @@ -127,6 +127,7 @@ services:

power-control:
image: ${SBX_POWER_IMAGE:-ghcr.io/openchami/pcs:pr-68}
platform: linux/amd64
container_name: sandbox-power
# power-control's Vault credstore (HMS hms-securestorage) only authenticates
# to Vault via the K8s service-account JWT flow — VAULT_TOKEN is ignored.
Expand Down
8 changes: 8 additions & 0 deletions fixtures/vault-seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ set -euo pipefail
VAULT_ADDR="${VAULT_ADDR:-http://127.0.0.1:8200}"
VAULT_TOKEN="${VAULT_TOKEN:-dev-root-token}"
CLUSTER="${CLUSTER:-sandbox}"
CONTAINER="${VAULT_CONTAINER:-sandbox-vault}"

export VAULT_ADDR VAULT_TOKEN

XNAMES=(x0c0s0b0 x0c0s1b0 x0c0s2b0 x0c0s3b0 x0c0s4b0 x0c0s5b0 x0c0s6b0 x0c0s7b0)

vault() {
docker exec -i \
-e VAULT_ADDR="$VAULT_ADDR" \
-e VAULT_TOKEN="$VAULT_TOKEN" \
"$CONTAINER" vault "$@"
}

# --- KV-v2 namespace for cluster-wide secrets (mirrors openchami-operator) ---
vault secrets enable -path=openchami kv-v2 2>/dev/null || true

Expand Down
13 changes: 10 additions & 3 deletions scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,18 @@ fi
WAIT_PER_TIMEOUT_S=60 bash scripts/wait-for-stack.sh infra

# Gate the ipmi_sim service (compose/bmc-sim.yaml::ipmi-bmc-0 has
# `profiles: ["ipmi"]`) on SKIP_SIM. With SKIP_SIM=true the build is
# skipped and the image won't pull; the profile keeps compose from trying.
# `profiles: ["ipmi"]`) on SKIP_SIM and image availability. If the image
# is missing and cannot be pulled, skip ipmi instead of hard-failing `up`.
if [[ -z "${COMPOSE_PROFILES:-}" ]]; then
if [[ "${SKIP_SIM:-false}" != "true" ]]; then
export COMPOSE_PROFILES="ipmi"
if docker image inspect "$SBX_IPMI_SIM_IMAGE" >/dev/null 2>&1; then
export COMPOSE_PROFILES="ipmi"
elif timeout 30 docker pull --quiet "$SBX_IPMI_SIM_IMAGE" >/dev/null 2>&1; then
export COMPOSE_PROFILES="ipmi"
else
bash scripts/heartbeat.sh up-warning "ipmi image unavailable; continuing with SKIP_SIM=true"
echo "up: WARN: IPMI image unavailable ($SBX_IPMI_SIM_IMAGE); continuing without ipmi profile" >&2
fi
fi
fi

Expand Down
8 changes: 8 additions & 0 deletions tests/bats/cli-smoke.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ setup() {
: "${SBX_VAULT_URL:=http://127.0.0.1:8200}"
: "${SBX_SMD_URL:=http://127.0.0.1:27779}"
: "${SBX_LOCALSTACK_URL:=http://127.0.0.1:4566}"
: "${VAULT_CONTAINER:=sandbox-vault}"
export VAULT_ADDR="$SBX_VAULT_URL"
export VAULT_TOKEN="${VAULT_TOKEN:-dev-root-token}"
export AWS_ACCESS_KEY_ID=test
Expand All @@ -15,6 +16,13 @@ setup() {
export AWS_ENDPOINT_URL="$SBX_LOCALSTACK_URL"
}

vault() {
docker exec -i \
-e VAULT_ADDR="$VAULT_ADDR" \
-e VAULT_TOKEN="$VAULT_TOKEN" \
"$VAULT_CONTAINER" vault "$@"
}

@test "vault status reports unsealed" {
run vault status -format=json
[ "$status" -eq 0 ]
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/uc4_tokensmith_smd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ func TestUC4_Tokensmith_SMD(t *testing.T) {
"RS256", "RS384", "RS512",
"PS256", "PS384", "PS512",
"ES256", "ES384", "ES512",
}))
}),
jwt.WithLeeway(30*time.Second),
)
if err != nil {
t.Fatalf("verify JWT against JWKS: %v", err)
}
Expand Down
Loading