iptables integration test

Summary: iptables table integration test

Reviewed By: fmanco

Differential Revision: D13746974

fbshipit-source-id: 79762510e8d955d179b98e96a7553403cfd219e0
This commit is contained in:
George Guliashvili 2019-01-22 09:55:11 -08:00 committed by Facebook Github Bot
parent 08c032bbf5
commit 2976db5eca

View File

@ -23,37 +23,29 @@ class iptables : public testing::Test {
}; };
TEST_F(iptables, test_sanity) { TEST_F(iptables, test_sanity) {
// 1. Query data
auto const data = execute_query("select * from iptables"); auto const data = execute_query("select * from iptables");
// 2. Check size before validation
// ASSERT_GE(data.size(), 0ul); ASSERT_GE(data.size(), 0ul);
// ASSERT_EQ(data.size(), 1ul);
// ASSERT_EQ(data.size(), 0ul); ValidatatioMap row_map = {{"filter_name", NonEmptyString},
// 3. Build validation map {"chain", NormalType},
// See helper.h for avaialbe flags {"policy", NormalType},
// Or use custom DataCheck object {"target", NormalType},
// ValidatatioMap row_map = { {"protocol", IntType},
// {"filter_name", NormalType} {"src_port", IntMinMaxCheck(0, 65535)},
// {"chain", NormalType} {"dst_port", IntMinMaxCheck(0, 65535)},
// {"policy", NormalType} {"src_ip", verifyEmptyStringOrIpAddress},
// {"target", NormalType} {"src_mask", verifyEmptyStringOrIpAddress},
// {"protocol", IntType} {"iniface", NormalType},
// {"src_port", NormalType} {"iniface_mask", verifyEmptyStringOrIpAddress},
// {"dst_port", NormalType} {"dst_ip", verifyEmptyStringOrIpAddress},
// {"src_ip", NormalType} {"dst_mask", verifyEmptyStringOrIpAddress},
// {"src_mask", NormalType} {"outiface", NormalType},
// {"iniface", NormalType} {"outiface_mask", verifyEmptyStringOrIpAddress},
// {"iniface_mask", NormalType} {"match", SpecificValuesCheck{"yes", "no"}},
// {"dst_ip", NormalType} {"packets", NonNegativeInt},
// {"dst_mask", NormalType} {"bytes", NonNegativeInt}};
// {"outiface", NormalType} validate_rows(data, row_map);
// {"outiface_mask", NormalType}
// {"match", NormalType}
// {"packets", IntType}
// {"bytes", IntType}
//}
// 4. Perform validation
// validate_rows(data, row_map);
} }
} // namespace table_tests } // namespace table_tests