mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
47 lines
1.1 KiB
C++
47 lines
1.1 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 sandboxes
|
|
// Spec file: specs/darwin/sandboxes.table
|
|
|
|
#include <osquery/tests/integration/tables/helper.h>
|
|
|
|
#include <osquery/logger.h>
|
|
|
|
namespace osquery {
|
|
namespace table_tests {
|
|
|
|
class Sandboxes : public testing::Test {
|
|
protected:
|
|
void SetUp() override {
|
|
setUpEnvironment();
|
|
}
|
|
};
|
|
|
|
TEST_F(Sandboxes, test_sanity) {
|
|
QueryData data = execute_query("select * from sandboxes");
|
|
|
|
if (!data.empty()) {
|
|
ValidationMap row_map = {
|
|
{"label", NonEmptyString},
|
|
{"user", NonEmptyString},
|
|
{"enabled", Bool},
|
|
{"build_id", NonEmptyString},
|
|
{"bundle_path", NormalType},
|
|
{"path", DirectoryOnDisk},
|
|
};
|
|
validate_rows(data, row_map);
|
|
} else {
|
|
LOG(WARNING)
|
|
<< "sandboxes table returned no results and therefore won't be tested";
|
|
}
|
|
}
|
|
|
|
} // namespace table_tests
|
|
} // namespace osquery
|