mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 01:55:20 +00:00
c7355b19aa
Summary: Pull Request resolved: https://github.com/facebook/osquery/pull/5452 As suggested in another diff, this diff updates the language we use to describe the osquery licensing terms. We are changing all instances of //This source code is licensed as defined on the LICENSE file found in the root directory of this source tree.// to //This source code is licensed in accordance with the terms specified in the LICENSE file found in the root directory of this source tree.// We accomplish this with a codemod: $ codemod -md xplat/osquery/oss --extensions cpp,h,in,py,sh,mm,ps1 "(.\s+)This source code is licensed as defined on the LICENSE file found in the(.*)root directory of this source tree\." "\1This source code is licensed in accordance with the terms specified in\2the LICENSE file found in the root directory of this source tree." Reviewed By: fmanco Differential Revision: D14131290 fbshipit-source-id: 52c90da342263e2a80f5a678ecd760c19cf7513e
62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
|
|
/**
|
|
* 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 apps
|
|
// Spec file: specs/darwin/apps.table
|
|
|
|
#include <osquery/tests/integration/tables/helper.h>
|
|
|
|
namespace osquery {
|
|
namespace table_tests {
|
|
|
|
class apps : public testing::Test {
|
|
protected:
|
|
void SetUp() override {
|
|
setUpEnvironment();
|
|
}
|
|
};
|
|
|
|
TEST_F(apps, test_sanity) {
|
|
// 1. Query data
|
|
auto const data = execute_query("select * from apps");
|
|
// 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
|
|
// ValidatatioMap row_map = {
|
|
// {"name", NormalType}
|
|
// {"path", NormalType}
|
|
// {"bundle_executable", NormalType}
|
|
// {"bundle_identifier", NormalType}
|
|
// {"bundle_name", NormalType}
|
|
// {"bundle_short_version", NormalType}
|
|
// {"bundle_version", NormalType}
|
|
// {"bundle_package_type", NormalType}
|
|
// {"environment", NormalType}
|
|
// {"element", NormalType}
|
|
// {"compiler", NormalType}
|
|
// {"development_region", NormalType}
|
|
// {"display_name", NormalType}
|
|
// {"info_string", NormalType}
|
|
// {"minimum_system_version", NormalType}
|
|
// {"category", NormalType}
|
|
// {"applescript_enabled", NormalType}
|
|
// {"copyright", NormalType}
|
|
// {"last_opened_time", NormalType}
|
|
//}
|
|
// 4. Perform validation
|
|
// validate_rows(data, row_map);
|
|
}
|
|
|
|
} // namespace table_tests
|
|
} // namespace osquery
|