2016-01-25 05:05:07 +00:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
|
2016-01-25 06:57:56 +00:00
|
|
|
@test "\`hosts\` with no arguments exits with status 0." {
|
2016-02-24 02:14:21 +00:00
|
|
|
run "${_HOSTS}"
|
|
|
|
[ "${status}" -eq 0 ]
|
2016-01-25 05:05:07 +00:00
|
|
|
}
|
|
|
|
|
2016-01-25 06:57:56 +00:00
|
|
|
@test "\`hosts\` with no arguments prints enabled rules." {
|
2016-02-24 02:14:21 +00:00
|
|
|
run "${_HOSTS}"
|
2016-01-27 01:49:05 +00:00
|
|
|
[[ "${#lines[@]}" -eq 4 ]]
|
2016-01-25 05:05:07 +00:00
|
|
|
[[ "${lines[0]}" == "127.0.0.1 localhost" ]]
|
|
|
|
[[ "${lines[1]}" == "255.255.255.255 broadcasthost" ]]
|
|
|
|
[[ "${lines[2]}" == "::1 localhost" ]]
|
|
|
|
[[ "${lines[3]}" == "fe80::1%lo0 localhost" ]]
|
|
|
|
[[ "${lines[4]}" == "" ]]
|
|
|
|
}
|