mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 10:23:54 +00:00
afd17f8134
2. Introduce a SQLite-based database plugin 3. Refactor database usage to include local 'fast-calls' 4. Introduce an 'ephemeral' database plugin for testing (like a mock)
35 lines
1023 B
C++
35 lines
1023 B
C++
/*
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
|
|
#include <osquery/sql.h>
|
|
|
|
#include "osquery/database/tests/plugin_tests.h"
|
|
|
|
namespace osquery {
|
|
|
|
class RocksDBDatabasePluginTests : public DatabasePluginTests {
|
|
protected:
|
|
std::string name() override { return "rocksdb"; }
|
|
};
|
|
|
|
// Define the default set of database plugin operation tests.
|
|
CREATE_DATABASE_TESTS(RocksDBDatabasePluginTests);
|
|
|
|
TEST_F(RocksDBDatabasePluginTests, test_rocksdb_loglevel) {
|
|
// Make sure a log file was created.
|
|
EXPECT_FALSE(pathExists(path_ + "/LOG"));
|
|
|
|
// Make sure no log file is created.
|
|
// RocksDB logs are intercepted and forwarded to the GLog sink.
|
|
auto details = SQL::selectAllFrom("file", "path", EQUALS, path_ + "/LOG");
|
|
ASSERT_EQ(details.size(), 0U);
|
|
}
|
|
}
|