"Fossies" - the Fresh Open Source Software Archive

Member "osquery-4.0.2/tests/integration/tables/account_policy_data.cpp" (12 Sep 2019, 1292 Bytes) of package /linux/misc/osquery-4.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "account_policy_data.cpp": 4.0.2_vs_4.1.0.

    1 
    2 /**
    3  *  Copyright (c) 2014-present, Facebook, Inc.
    4  *  All rights reserved.
    5  *
    6  *  This source code is licensed in accordance with the terms specified in
    7  *  the LICENSE file found in the root directory of this source tree.
    8  */
    9 
   10 // Sanity check integration test for account_policy_data
   11 // Spec file: specs/darwin/account_policy_data.table
   12 
   13 #include <osquery/tests/integration/tables/helper.h>
   14 
   15 namespace osquery {
   16 namespace table_tests {
   17 
   18 class accountPolicyData : public testing::Test {
   19  protected:
   20   void SetUp() override {
   21     setUpEnvironment();
   22   }
   23 };
   24 
   25 TEST_F(accountPolicyData, test_sanity) {
   26   // 1. Query data
   27   auto const data = execute_query("select * from account_policy_data");
   28   // 2. Check size before validation
   29   // ASSERT_GE(data.size(), 0ul);
   30   // ASSERT_EQ(data.size(), 1ul);
   31   // ASSERT_EQ(data.size(), 0ul);
   32   // 3. Build validation map
   33   // See helper.h for avaialbe flags
   34   // Or use custom DataCheck object
   35   // ValidatatioMap row_map = {
   36   //      {"uid", IntType}
   37   //      {"creation_time", NormalType}
   38   //      {"failed_login_count", IntType}
   39   //      {"failed_login_timestamp", NormalType}
   40   //      {"password_last_set_time", NormalType}
   41   //}
   42   // 4. Perform validation
   43   // validate_rows(data, row_map);
   44 }
   45 
   46 } // namespace table_tests
   47 } // namespace osquery