mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 17:45:22 +00:00
tests: Increase reliability of interfaces test (#5879)
On macOS it is possible to have interfaces that have no netmask set, for example: | utun1 | 100.xx.xx.xx | | | 100.xx.xx.xx | unknown | This causes the interfaces test to fail. This change allows the mask field to be blank and the test to pass on systems with this type of interface configured. The sockaddr for this interface has an ifa_netmask with sa_family set to zero (AF_UNSPEC) which causes getnameinfo(3) to fail. ifconfig does return a netmask for this interface but it's not clear if the value is at all meaningful.
This commit is contained in:
parent
bf25d02c86
commit
a1e4191109
@ -29,7 +29,7 @@ TEST_F(InterfaceAddressesTest, test_sanity) {
|
||||
auto const row_map = ValidationMap{
|
||||
{"interface", NonEmptyString},
|
||||
{"address", verifyIpAddress},
|
||||
{"mask", verifyIpAddress},
|
||||
{"mask", verifyEmptyStringOrIpAddress},
|
||||
{"broadcast", verifyEmptyStringOrIpAddress},
|
||||
{"point_to_point", verifyEmptyStringOrIpAddress},
|
||||
{"type",
|
||||
|
Loading…
Reference in New Issue
Block a user