| 1 |
#!/usr/bin/env bats |
| 2 |
|
| 3 |
source ./apt-dater-host source-only |
| 4 |
|
| 5 |
check_tag() |
| 6 |
{ |
| 7 |
TAG=$1 |
| 8 |
STR=$2 |
| 9 |
[ $(echo $STR | grep -E -v -c "^$TAG:") -eq 0 ] |
| 10 |
} |
| 11 |
|
| 12 |
@test "say_hi()" { |
| 13 |
result="$(say_hi)" |
| 14 |
check_tag ADPROTO $result |
| 15 |
[ "$result" = "ADPROTO: 0.6" ] |
| 16 |
} |
| 17 |
|
| 18 |
@test "get_lsbrel()" { |
| 19 |
result="$(get_lsbrel)" |
| 20 |
check_tag LSBREL $result |
| 21 |
} |
| 22 |
|
| 23 |
@test "get_pkg_stat()" { |
| 24 |
result="$(get_pkg_stat)" |
| 25 |
check_tag STATUS $result |
| 26 |
} |
| 27 |
|
| 28 |
@test "get_virt()" { |
| 29 |
result="$(get_virt)" |
| 30 |
check_tag VIRT $result |
| 31 |
} |
| 32 |
|
| 33 |
@test "get_kern()" { |
| 34 |
result="$(get_kern)" |
| 35 |
check_tag KERNELINFO $result |
| 36 |
} |