mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Added tests for chrome_extensions table. (#6126)
This commit is contained in:
parent
532435d15e
commit
3f632aaea2
@ -22,30 +22,21 @@ class chromeExtensions : public testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(chromeExtensions, test_sanity) {
|
||||
// 1. Query data
|
||||
auto const data = execute_query("select * from chrome_extensions");
|
||||
// 2. Check size before validation
|
||||
// ASSERT_GE(data.size(), 0ul);
|
||||
// ASSERT_EQ(data.size(), 1ul);
|
||||
// ASSERT_EQ(data.size(), 0ul);
|
||||
// 3. Build validation map
|
||||
// See helper.h for avaialbe flags
|
||||
// Or use custom DataCheck object
|
||||
// ValidationMap row_map = {
|
||||
// {"uid", IntType},
|
||||
// {"name", NonEmptyString},
|
||||
// {"identifier", NonEmptyString},
|
||||
// {"version", NonEmptyString},
|
||||
// {"description", NormalType},
|
||||
// {"locale", NormalType},
|
||||
// {"update_url", NonEmptyString},
|
||||
// {"author", NormalType},
|
||||
// {"persistent", IntType},
|
||||
// {"path", NonEmptyString},
|
||||
// {"permissions", NormalType},
|
||||
// {"profile", NonEmptyString}};
|
||||
// 4. Perform validation
|
||||
// validate_rows(data, row_map);
|
||||
ASSERT_GE(data.size(), 0ul);
|
||||
ValidationMap row_map = {{"uid", IntType},
|
||||
{"name", NonEmptyString},
|
||||
{"identifier", NonEmptyString},
|
||||
{"version", NonEmptyString},
|
||||
{"description", NormalType},
|
||||
{"locale", NormalType},
|
||||
{"update_url", NonEmptyString},
|
||||
{"author", NormalType},
|
||||
{"persistent", IntType},
|
||||
{"path", NonEmptyString},
|
||||
{"permissions", NormalType},
|
||||
{"profile", NonEmptyString}};
|
||||
validate_rows(data, row_map);
|
||||
}
|
||||
|
||||
} // namespace table_tests
|
||||
|
Loading…
Reference in New Issue
Block a user