-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4003c90
commit 3674dd0
Showing
14 changed files
with
267 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
"runtime" | ||
"testing" | ||
"time" | ||
|
||
"github.com/rivo/tview" | ||
) | ||
|
||
func TestConfigWindow(t *testing.T) { | ||
InitUI() | ||
go OpenFileDialog() | ||
time.Sleep(500 * time.Millisecond) | ||
|
||
if currentConfigWindowSelector == 0 { | ||
t.Fatal("OpenFileDialog failed to open") | ||
} | ||
} | ||
|
||
func TestMainWindow(t *testing.T) { | ||
InitUI() | ||
go MainWindow() | ||
time.Sleep(500 * time.Millisecond) | ||
|
||
if currentMainWindowSelector == 0 { | ||
t.Fatal("MainWindow failed to open") | ||
} | ||
} | ||
|
||
func TestConfigurationFileLoading(t *testing.T) { | ||
var config Configuration | ||
config.getConfiguration("tests/config_test_standard.yml") | ||
|
||
if len(config.Input.Content.Grep) == 0 || config.Input.Content.Grep[0] != "package main" { | ||
t.Fatal("config.getConfiguration fails to load and parse configuration file correctly") | ||
} | ||
} | ||
|
||
func TestRC4CipheredConfigurationFileLoading(t *testing.T) { | ||
var config Configuration | ||
config.getConfiguration("tests/config_test_ciphered.yml") | ||
|
||
if len(config.Input.Content.Grep) == 0 || config.Input.Content.Grep[0] != "package main" { | ||
t.Fatal("config.getConfiguration fails to load and parse configuration file correctly") | ||
} | ||
} | ||
|
||
func TestCleanUI(t *testing.T) { | ||
UIapp = tview.NewApplication() | ||
UIapp.ForceDraw() | ||
UIactive = false | ||
AppStarted = false | ||
UIapp.Stop() | ||
if UIactive || AppStarted { | ||
t.Fatal("Can't reset GUI app for further testing") | ||
} | ||
|
||
if runtime.GOOS == "linux" { | ||
cmd := exec.Command("clear") | ||
cmd.Stdout = os.Stdout | ||
cmd.Run() | ||
} else { | ||
cmd := exec.Command("cmd", "/c", "cls") | ||
cmd.Stdout = os.Stdout | ||
cmd.Run() | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
input: | ||
path: [] | ||
content: | ||
grep: | ||
- 'package main' | ||
yara: [] | ||
checksum: [] | ||
options: | ||
contentMatchDependsOnPathMatch: false | ||
findInHardDrives: true | ||
findInRemovableDrives: false | ||
findInNetworkDrives: false | ||
findInCDRomDrives: false | ||
output: | ||
copyMatchingFiles: false | ||
base64Files: false | ||
filesCopyPath: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
씏�⑵ꬔ弼錭龮휐䁻⮉쌟纘፴뽬笠薡�脑洪䱍ꖣ⼹鞓뙂튨韉我≖洽솎랑芅ꊾ㌎ﯕ穚遌Ꝉ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
rule testing{ | ||
strings: | ||
$ = "TestFindInFilesContent" | ||
condition: | ||
all of them | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.