Skip to content

Commit

Permalink
[tests] test whether auth lease makes its way to the database
Browse files Browse the repository at this point in the history
Refs #116
  • Loading branch information
lukasjuhrich committed Sep 10, 2022
1 parent 9ca470e commit b8411e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test-auth-dhcp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,11 @@ teardown() {
[[ "${env[new_routers]}" = "$(netaddr.ip "$gateway_ip_address")" ]]
[[ "${env[new_subnet_cidr]}" = "$(netaddr.prefixlen "$gateway_ip_address")" ]]
[[ "${env[new_subnet_mask]}" = "$(netaddr.netmask "$gateway_ip_address")" ]]

[[ "$(psql_query_csv hades -c 'SELECT count(*) FROM auth_dhcp_lease')" = "1" ]]
local -a _got=()
local -a _expected=("$client_mac_address" "$(netaddr.ip "$client_ip_address")" "")
psql_mapfile _got hades -c 'SELECT "MAC", "IPAddress", "Hostname" from auth_dhcp_lease'

assert_array_equals _got _expected
}

0 comments on commit b8411e7

Please sign in to comment.