Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Autopsy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Autopsy
Commits
771ec1a9
Commit
771ec1a9
authored
7 years ago
by
U-BASIS\zhaohui
Browse files
Options
Downloads
Patches
Plain Diff
3598: 6th test for file filter tests
parent
6d843192
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java
+29
-1
29 additions, 1 deletion
...c/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java
with
29 additions
and
1 deletion
Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java
+
29
−
1
View file @
771ec1a9
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
static
junit
.
framework
.
Assert
.
assertFalse
;
import
static
junit
.
framework
.
Assert
.
assertFalse
;
import
junit.framework.TestCase
;
import
org.netbeans.junit.NbModuleSuite
;
import
org.netbeans.junit.NbModuleSuite
;
import
org.sleuthkit.autopsy.casemodule.Case
;
import
org.sleuthkit.autopsy.casemodule.Case
;
import
org.sleuthkit.autopsy.casemodule.CaseActionException
;
import
org.sleuthkit.autopsy.casemodule.CaseActionException
;
...
@@ -309,6 +308,35 @@ public void testCarvingWithExtRuleAndUnallocSpace() {
...
@@ -309,6 +308,35 @@ public void testCarvingWithExtRuleAndUnallocSpace() {
}
}
}
}
public
void
testCarvingNoUnallocatedSpace
()
{
HashMap
<
String
,
Rule
>
rules
=
new
HashMap
<>();
rules
.
put
(
"rule1"
,
new
Rule
(
"FindJpgExtention"
,
new
ExtensionCondition
(
"jpg"
),
new
MetaTypeCondition
(
MetaTypeCondition
.
Type
.
FILES
),
null
,
null
,
null
,
null
));
rules
.
put
(
"rule2"
,
new
Rule
(
"FindGifExtention"
,
new
ExtensionCondition
(
"gif"
),
new
MetaTypeCondition
(
MetaTypeCondition
.
Type
.
FILES
),
null
,
null
,
null
,
null
));
//Build the filter to find files with .jpg and .gif extension
FilesSet
extensionFilter
=
new
FilesSet
(
"Filter"
,
"Filter to files with .jpg and .gif extension."
,
false
,
true
,
rules
);
try
{
Case
openCase
=
Case
.
getOpenCase
();
ArrayList
<
IngestModuleTemplate
>
templates
=
new
ArrayList
<>();
templates
.
add
(
getIngestModuleTemplate
(
new
FileTypeIdModuleFactory
()));
templates
.
add
(
getIngestModuleTemplate
(
new
PhotoRecCarverIngestModuleFactory
()));
IngestJobSettings
ingestJobSettings
=
new
IngestJobSettings
(
IngestFileFiltersTest
.
class
.
getCanonicalName
(),
IngestType
.
FILES_ONLY
,
templates
,
extensionFilter
);
try
{
List
<
IngestModuleError
>
errs
=
IngestJobRunner
.
runIngestJob
(
openCase
.
getDataSources
(),
ingestJobSettings
);
//Ingest fails because Carving wants unallocated space
assertEquals
(
1
,
errs
.
size
());
assertEquals
(
"PhotoRec Carver"
,
errs
.
get
(
0
).
getModuleDisplayName
());
}
catch
(
InterruptedException
ex
)
{
Exceptions
.
printStackTrace
(
ex
);
Assert
.
fail
(
ex
);
}
}
catch
(
NoCurrentCaseException
|
TskCoreException
ex
)
{
Exceptions
.
printStackTrace
(
ex
);
Assert
.
fail
(
ex
);
}
}
private
void
runIngestJob
(
List
<
Content
>
datasources
,
ArrayList
<
IngestModuleTemplate
>
templates
,
FilesSet
filter
)
{
private
void
runIngestJob
(
List
<
Content
>
datasources
,
ArrayList
<
IngestModuleTemplate
>
templates
,
FilesSet
filter
)
{
IngestJobSettings
ingestJobSettings
=
new
IngestJobSettings
(
IngestFileFiltersTest
.
class
.
getCanonicalName
(),
IngestType
.
FILES_ONLY
,
templates
,
filter
);
IngestJobSettings
ingestJobSettings
=
new
IngestJobSettings
(
IngestFileFiltersTest
.
class
.
getCanonicalName
(),
IngestType
.
FILES_ONLY
,
templates
,
filter
);
try
{
try
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment