Fix chromeExtensions.test_sanity failure (#6324)

Removed the columns "script" and "match" from the test
since they do not belong to the chrome_extensions table,
they belong to chrome_extension_content_scripts.

Added the missing integration test for the table
chrome_extension_content_scripts.
This commit is contained in:
Stefano Bonicatti 2020-03-27 01:23:12 +01:00 committed by GitHub
parent 29697f6ba8
commit 8b8462d021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 7 deletions

View File

@ -0,0 +1,36 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed in accordance with the terms specified in
* the LICENSE file found in the root directory of this source tree.
*/
// Sanity check integration test for chrome_extension_content_scripts
// Spec file: specs/chrome_extension_content_scripts.table
#include <osquery/tests/integration/tables/helper.h>
namespace osquery {
namespace table_tests {
class chromeExtensions : public testing::Test {
protected:
void SetUp() override {
setUpEnvironment();
}
};
TEST_F(chromeExtensions, test_sanity) {
auto const data =
execute_query("select * from chrome_extension_content_scripts");
ASSERT_GE(data.size(), 0ul);
ValidationMap row_map = {{"uid", IntType},
{"identifier", NonEmptyString},
{"version", NonEmptyString},
{"script", NormalType},
{"match", NormalType}};
validate_rows(data, row_map);
}
} // namespace table_tests
} // namespace osquery

View File

@ -15,10 +15,10 @@ namespace osquery {
namespace table_tests {
class chromeExtensions : public testing::Test {
protected:
void SetUp() override {
setUpEnvironment();
}
protected:
void SetUp() override {
setUpEnvironment();
}
};
TEST_F(chromeExtensions, test_sanity) {
@ -36,9 +36,7 @@ TEST_F(chromeExtensions, test_sanity) {
{"persistent", IntType},
{"path", NonEmptyString},
{"permissions", NormalType},
{"profile", NormalType},
{"script", NormalType},
{"match", NormalType}};
{"profile", NormalType}};
validate_rows(data, row_map);
}