Newer
Older
openstack-caracal-dc-dc / tests / phase-04-create / fakebin / maas
#!/usr/bin/env bash
# fake maas: '<profile> subnets read' -> provider subnet with gateway $GW (default 10.12.4.1).
# Responds ONLY when the invoked profile == EXPECT_PROFILE (default admin), so a test can prove
# the SUT passes MAAS_PROFILE through rather than hardcoding 'admin' (DOCFIX-213).
EXPECT_PROFILE="${EXPECT_PROFILE:-admin}"
if [ "${1:-}" = "$EXPECT_PROFILE" ] && [ "${2:-}" = subnets ] && [ "${3:-}" = read ]; then
  printf '[{"id":1,"cidr":"10.12.4.0/22","gateway_ip":"%s"}]\n' "${GW:-10.12.4.1}"
fi