Skip to content

Instantly share code, notes, and snippets.

@jfach
Created August 22, 2017 20:52
Show Gist options
  • Save jfach/8e768aef118ba13160017be2d175a760 to your computer and use it in GitHub Desktop.
Save jfach/8e768aef118ba13160017be2d175a760 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bats
@test "RTC present" {
run timedatectl status
[ "$status" -ne 127]
}
@test "NTP enabled" {
result="$(timedatectl status | grep "Network time on:")"
[ "$result" == "Network time on: yes" ]
}
@test "NTP synchronized" {
result="$(timedatectl status | grep "NTP synchronized:")"
[ "$result" == "NTP synchronized: yes" ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment