-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-tests.bats
More file actions
executable file
·33 lines (29 loc) · 1.3 KB
/
app-tests.bats
File metadata and controls
executable file
·33 lines (29 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bats
@test "correctly returns A for xyziemba.com" {
reference="$(dig \@8.8.8.8 +short xyziemba.com | sort)"
test="$(dig \@localhost -p $PORT +short xyziemba.com | sort)"
testTcp="$(dig \@localhost -p $PORT +short +tcp xyziemba.com | sort)"
[ "$reference" == "$test" ]
[ "$reference" == "$testTcp" ]
}
@test "correctly returns MX for xyziemba.com" {
reference="$(dig \@8.8.8.8 +short MX xyziemba.com | sort)"
test="$(dig \@localhost -p $PORT +short MX xyziemba.com | sort)"
testTcp="$(dig \@localhost -p $PORT +short +tcp MX xyziemba.com | sort)"
[ "$reference" == "$test" ]
[ "$reference" == "$testTcp" ]
}
@test "correctly doesn't return A for dnssec.fail" {
reference="$(dig \@8.8.8.8 +short dnssec.fail | sort)"
test="$(dig \@localhost -p $PORT +short dnssec.fail | sort)"
testTcp="$(dig \@localhost -p $PORT +short +tcp dnssec.fail | sort)"
[ "$reference" == "$test" ]
[ "$reference" == "$testTcp" ]
}
@test "correctly returns A for dnssec.fail with CD bit checked" {
reference="$(dig \@8.8.8.8 +short +cd dnssec.fail | sort)"
test="$(dig \@localhost -p $PORT +short +cd dnssec.fail | sort)"
testTcp="$(dig \@localhost -p $PORT +short +cd +tcp dnssec.fail | sort)"
[ "$reference" == "$test" ]
[ "$reference" == "$testTcp" ]
}