fix macos test

Summary: mac address can be incomplete, lets add it in the verifier.

Reviewed By: fmanco

Differential Revision: D13377450

fbshipit-source-id: 057549d058f292fac7969adb242da2e313922c53
This commit is contained in:
George Guliashvili 2018-12-10 07:08:02 -08:00 committed by fmanco
parent 3775b82cdb
commit c58f69bba2

View File

@ -111,10 +111,14 @@ bool verifyEmptyStringOrIpAddress(std::string const& value) {
}
bool verifyMacAddress(std::string const& value) {
boost::smatch match;
// IEEE 802: six groups of two hexadecimal digits, separated by '-' or ':'
boost::regex rxMacAddress("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$");
return boost::regex_match(value, match, rxMacAddress);
if (value == "incomplete") {
return true;
} else {
boost::smatch match;
// IEEE 802: six groups of two hexadecimal digits, separated by '-' or ':'
boost::regex rxMacAddress("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$");
return boost::regex_match(value, match, rxMacAddress);
}
}
bool verifyUidGid(std::string const& value) {