2014-01-22 09:32:39 +00:00
|
|
|
require 'minitest/spec'
|
|
|
|
|
|
|
|
describe_recipe 'ntp::default' do
|
|
|
|
it "starts the ntp daemon" do
|
2014-01-27 17:16:56 +00:00
|
|
|
# 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
|
2014-01-22 09:32:39 +00:00
|
|
|
end
|
|
|
|
it "should sync the time" do
|
|
|
|
assert_sh("ntpq -p")
|
|
|
|
end
|
|
|
|
end
|