Newer
Older
openstack-caracal-dc-dc / tests / reenroll-hosts / fakebin / maas
#!/usr/bin/env bash
# fake maas: serves read endpoints from fixture files. This harness only needs
# `machines read` (host_sysid()'s lookup) -- every scenario here either uses an
# empty machines list (nothing enrolled) or never reaches a MAAS call at all
# (the $DC fail-loud cases exit at the selector, before need_jq/report()).
prof="${1:-}"; obj="${2:-}"; act="${3:-}"
[ "$obj" = machines ] && [ "$act" = read ] && { cat "${FIX_MACHINES:?}"; exit 0; }
echo "fake-maas: UNMATCHED call: $*" >&2; exit 1   # fail loud: an uncovered call must never pass silently