#!/bin/bash
## kola:
##   exclusive: false
##   platforms: "aws azure gce"
# Test the coreos-platform-chrony generator.

set -xeuo pipefail

. $KOLA_EXT_DATA/commonlib.sh

platform=$(cmdline_arg ignition.platform.id)
case "${platform}" in
    aws) chronyc sources |grep '169.254.169.123'; echo "ok chrony aws" ;;
    azure) chronyc sources |grep 'PHC'; echo "ok chrony azure" ;;
    gcp) chronyc sources | grep '169.254.169.254'; echo "ok chrony gcp" ;;
    *) echo "unhandled platform ${platform} ?"; exit 1 ;;
esac
