#!/bin/sh

set -e

# Test default node classification
/usr/libexec/puppet-hiera-enc foo.example.com | yq -e '.environment == "production"'

# Test non-default node classification
echo "---\nenvironment: development\n" > /etc/puppet/hiera-enc/nodes/bar.example.com.yaml
/usr/libexec/puppet-hiera-enc bar.example.com | yq -e '.environment == "development"'
