Newer
Older
openstack-caracal-ipv4 / tests / carve-host-interfaces / fakebin / maas
@JANeumatrix JANeumatrix 11 hours ago 595 bytes Test patches
#!/usr/bin/env bash
# fake maas: serves read endpoints from fixture files; dry-run never calls mutations.
prof="${1:-}"; obj="${2:-}"; act="${3:-}"
[ "$obj" = machines ]   && [ "$act" = read ] && { cat "${FIX_MACHINES:?}"; exit 0; }
[ "$obj" = machine ]    && [ "$act" = read ] && { cat "${FIX_MACHINE:?}";  exit 0; }
[ "$obj" = subnets ]    && [ "$act" = read ] && { cat "${FIX_SUBNETS:?}";  exit 0; }
[ "$obj" = interfaces ] && [ "$act" = read ] && { cat "${FIX_IFACES:?}";   exit 0; }
echo "fake-maas: UNMATCHED call: $*" >&2; exit 1   # fail loud: an uncovered call must never pass silently