chef-lctp/site-cookbooks/ntp/files/default/test/default_test.rb

23 lines
393 B
Ruby

require 'minitest/spec'
describe_recipe 'ntp::default' do
it "starts the ntp daemon" do
# linear back off to work around race condition
assert_sh <<EOF
bash -c'
NEXT_WAIT_TIME=0
until [ $NEXT_WAIT_TIME -eq 4 ]; do
if service ntp status; then
exit 0
fi
sleep $(( NEXT_WAIT_TIME++ ))
done
exit 1
'
EOF
end
it "should sync the time" do
assert_sh("ntpq -p")
end
end