Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
Test_PanoptesYara.cpp
Go to the documentation of this file.
1#include "gtest/gtest.h"
2#include "PanoptesYara.h"
3
4#define YARA_RULES "rules.pkg"
5#define EICAR_PATH "eicarcom2.zip"
6
7namespace Yara {
8 class YaraScanTest : public ::testing::Test {
9 protected:
11
12 void SetUp() override {
14 }
15
16 void TearDown() override {
17 delete yaraScan;
18 yaraScan = nullptr;
19 }
20 };
21
22 TEST_F(YaraScanTest, ScanNotePad) {
23 std::vector<string> result = yaraScan->YaraScanFile("C:\\Windows\\System32\\notepad.exe");
24 EXPECT_EQ(result.size(), 0);
25 }
26
27 TEST_F(YaraScanTest, ScanEicar) {
28 std::vector<string> result = yaraScan->YaraScanFile(EICAR_PATH);
29 EXPECT_GT(result.size(), 0);
30 }
31}
#define EICAR_PATH
#define YARA_RULES
The YaraScanner class that is used to scan a file using YARA rules.
std::vector< std::string > YaraScanFile(std::string PathToFile)
Scan a file using YARA rules.
Definition yara-scan.cpp:81
void TearDown() override
ULONG result
Definition events.cpp:22
TEST_F(YaraScanTest, ScanNotePad)