bats
This commit is contained in:
parent
761e078c55
commit
a8f399ab7f
|
@ -1,15 +1,20 @@
|
||||||
#!/usr/bin/env bats
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
domain="kameronkenny.com"
|
setup() {
|
||||||
serial="24070101"
|
load 'bats-support'
|
||||||
@test "Test A Record: ${domain}" {
|
load 'bats-assert'
|
||||||
r=$(dig -t A ${domain} +noall +answer | awk '{ print $5 }')
|
|
||||||
[ "$r" == "204.8.15.81" ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Test SOA Serial: ${domain}" {
|
export domain="kameronkenny.com"
|
||||||
r=$(dig -t SOA ${domain} +noall +answer +multi | grep serial | awk '{ print $1 }')
|
export serial="24070101"
|
||||||
[ "$r" == "${serial}" ]
|
@test "Test A Record: kameronkenny.com" {
|
||||||
|
run dig -t A kameronkenny.com +noall +answer
|
||||||
|
assert_output --partial '204.8.15.81'
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Test SOA Serial: kameronkenny.com" {
|
||||||
|
run dig -t SOA kameronkenny.com +noall +answer +multi
|
||||||
|
assert_output --partial "${serial}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# in.thelinuxpro.net
|
# in.thelinuxpro.net
|
||||||
|
@ -17,12 +22,11 @@ serial="24121801"
|
||||||
## nagios.in.thelinuxpro.net
|
## nagios.in.thelinuxpro.net
|
||||||
domain="nagios.in.thelinuxpro.net"
|
domain="nagios.in.thelinuxpro.net"
|
||||||
@test "Test A Record: ${domain}" {
|
@test "Test A Record: ${domain}" {
|
||||||
r=$(dig -t A ${domain} +noall +answer | awk '{ print $5 }')
|
dig -t A ${domain} +noall +answer
|
||||||
[ "$r" == "10.99.23.36" ]
|
assert_output --partial '10.99.23.36'
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Test SOA Serial: ${domain}" {
|
@test "Test SOA Serial: nagios.in.thelinuxpro.net" {
|
||||||
skip
|
dig -t SOA nagios.in.thelinuxpro.net +noall +answer +multi
|
||||||
r=$(dig -t SOA nagios.in.thelinuxpro.net +noall +answer +multi | grep serial | awk '{ print $1 }')
|
assert_output --partial "${serial}"
|
||||||
[ "$r" == "${serial}" ]
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue