-
Notifications
You must be signed in to change notification settings - Fork 8
/
synctestdata.ps1
36 lines (29 loc) · 1.32 KB
/
synctestdata.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Script that synchronizes the local test data
#
# Version: 20230709
$TestSet = "public"
$TestInputDirectory = "tests/input"
$TestFiles = "luks1.raw"
If (-Not (Test-Path ${TestInputDirectory}))
{
New-Item -Name ${TestInputDirectory} -ItemType "directory" | Out-Null
}
If (-Not (Test-Path "${TestInputDirectory}\${TestSet}"))
{
New-Item -Name "${TestInputDirectory}\${TestSet}" -ItemType "directory" | Out-Null
New-Item -Name "${TestInputDirectory}\.libluksde\${TestSet}" -ItemType "directory" | Out-Null
New-Item -Name "${TestInputDirectory}\.pyluksde\${TestSet}" -ItemType "directory" | Out-Null
New-Item -Name "${TestInputDirectory}\.luksdeinfo\${TestSet}" -ItemType "directory" | Out-Null
}
@"
# libyal test data options
password=luksde-TEST
"@ | Out-File -FilePath test_data_options
ForEach ($TestFile in ${TestFiles} -split " ")
{
$Url = "https://github.com/log2timeline/dfvfs/blob/main/test_data/${TestFile}?raw=true"
Invoke-WebRequest -Uri ${Url} -OutFile "${TestInputDirectory}\${TestSet}\${TestFile}"
Copy-Item test_data_options -Destination "${TestInputDirectory}\.libluksde\${TestSet}\${TestFile}.password"
Copy-Item test_data_options -Destination "${TestInputDirectory}\.pyluksde\${TestSet}\${TestFile}.password"
Copy-Item test_data_options -Destination "${TestInputDirectory}\.luksdeinfo\${TestSet}\${TestFile}.password"
}