Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette committed Apr 4, 2022
1 parent 06e5fd0 commit cb613d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions artifacts/testdata/server/testcases/mft.in.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ Parameters:
Queries:
- LET _ <= remap(config=format(format=RemappingTemplate,
args=[
srcDir+'/artifacts/testdata/files/test.ntfs.dd'
srcDir+'/artifacts/testdata/files/test.ntfs.dd',
srcDir+'/artifacts/testdata/files/test.ntfs.dd',
]), clear=TRUE)

# Test MFT output
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='just_a_file\.txt')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='just_a_file\\.txt')

# Test time contraints
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateBefore='2018-12-31')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateAfter='2021-07-01')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateAfter='2021-07-01',DateBefore='2022-02-01')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateBefore='2018-12-31')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateAfter='2021-07-01')
- SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateAfter='2021-07-01',DateBefore='2022-02-01')
8 changes: 4 additions & 4 deletions artifacts/testdata/server/testcases/mft.out.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LET _ <= remap(config=format(format=RemappingTemplate, args=[ srcDir+'/artifacts/testdata/files/test.ntfs.dd' ]), clear=TRUE)[]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='just_a_file\.txt')[
LET _ <= remap(config=format(format=RemappingTemplate, args=[ srcDir+'/artifacts/testdata/files/test.ntfs.dd', srcDir+'/artifacts/testdata/files/test.ntfs.dd', ]), clear=TRUE)[]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='just_a_file\\.txt')[
{
"EntryNumber": 49,
"InUse": true,
Expand All @@ -25,7 +25,7 @@ LET _ <= remap(config=format(format=RemappingTemplate, args=[ srcDir+'/artifacts
"FileNameTypes": "POSIX",
"_Source": "Windows.NTFS.MFT"
}
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateBefore='2018-12-31')[
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateBefore='2018-12-31')[
{
"EntryNumber": 46,
"InUse": true,
Expand Down Expand Up @@ -78,7 +78,7 @@ LET _ <= remap(config=format(format=RemappingTemplate, args=[ srcDir+'/artifacts
"FileNameTypes": "POSIX",
"_Source": "Windows.NTFS.MFT"
}
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateAfter='2021-07-01')[
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateAfter='2021-07-01')[
{
"EntryNumber": 37,
"InUse": true,
Expand Down Expand Up @@ -131,7 +131,7 @@ LET _ <= remap(config=format(format=RemappingTemplate, args=[ srcDir+'/artifacts
"FileNameTypes": "POSIX",
"_Source": "Windows.NTFS.MFT"
}
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\.txt',DateAfter='2021-07-01',DateBefore='2022-02-01')[
]SELECT * FROM Artifact.Windows.NTFS.MFT(FileRegex='\\.txt',DateAfter='2021-07-01',DateBefore='2022-02-01')[
{
"EntryNumber": 49,
"InUse": true,
Expand Down
2 changes: 1 addition & 1 deletion reporting/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (self *Container) Upload(
reader io.Reader) (*uploads.UploadResponse, error) {

if store_as_name == "" {
store_as_name = accessor + "/" + strings.TrimPrefix(filename.String(), "/")
store_as_name = accessors.MustNewGenericOSPath(accessor).Append(filename.Components...).String()
}

sanitized_name := sanitize_upload_name(store_as_name)
Expand Down

0 comments on commit cb613d6

Please sign in to comment.