Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added LCOW functional tests and benchmarks
Split out test utilities from `test/functional` to an internal package. Updated code to use containerd instead of docker. Added tests and benchmarks for LCOW uVM containers. Updated other LCOW tests. Updated cri-containerd and runhcs tests to use moved code in `test\internal` Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
- Loading branch information
Showing
124 changed files
with
21,528 additions
and
7,066 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# ex: .\scripts\Test-Functional.ps1 -Count 2 -BenchTime "2x" | ||
|
||
[CmdletBinding()] | ||
param ( | ||
[ValidateSet('Test', 'Bench', 'List')] | ||
[alias('a')] | ||
[string] | ||
$Action = 'Bench', | ||
|
||
[string] | ||
$Note = '', | ||
|
||
[string] | ||
$OutDirectory = '.\test\results', | ||
|
||
# test parameters | ||
[int] | ||
$Count = 1, | ||
|
||
[string] | ||
$BenchTime = '5s', | ||
|
||
[string] | ||
$Timeout = '10m', | ||
|
||
[alias('tv')] | ||
[switch] | ||
$TestVerbose, | ||
|
||
[string] | ||
$Run = '', | ||
|
||
[string] | ||
$Feature = '' | ||
) | ||
|
||
Import-Module ( Join-Path $PSScriptRoot Testing.psm1 ) -Force | ||
|
||
$date = Get-Date | ||
$testcmd, $out = New-TestCommand ` | ||
-Action $Action ` | ||
-Path .\bin\test\functional.exe ` | ||
-Name functional ` | ||
-OutDirectory $OutDirectory ` | ||
-Date $date ` | ||
-Note $Note ` | ||
-TestVerbose:$TestVerbose ` | ||
-Count $Count ` | ||
-BenchTime $BenchTime ` | ||
-Timeout $Timeout ` | ||
-Run $Run ` | ||
-Feature $Feature ` | ||
-Verbose:$Verbose | ||
|
||
Invoke-TestCommand ` | ||
-TestCmd $testcmd ` | ||
-OutputFile $out ` | ||
-OutputCmd (&{ if ( $Action -eq 'Bench' ) { 'benchstat' } }) ` | ||
-Preamble ` | ||
-Date $Date ` | ||
-Note $Note ` | ||
-Verbose:$Verbose |
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,143 @@ | ||
#ex: .\scripts\Test-LCOW-UVM.ps1 -vb -Action Bench -BootFilesPath C:\ContainerPlat\LinuxBootFiles\ -MountGCSTest -Count 2 -Benchtime '3s' | ||
# benchstat via `go install golang.org/x/perf/cmd/benchstat@latest` | ||
|
||
[CmdletBinding()] | ||
param ( | ||
[ValidateSet('Test', 'Bench', 'List', 'Shell')] | ||
[alias('a')] | ||
[string] | ||
$Action = 'Bench', | ||
|
||
[string] | ||
$Note = '', | ||
|
||
# test parameters | ||
[int] | ||
$Count = 1, | ||
|
||
[string] | ||
$BenchTime = '5s', | ||
|
||
[string] | ||
$Timeout = '10m', | ||
|
||
[alias('tv')] | ||
[switch] | ||
$TestVerbose, | ||
|
||
[string] | ||
$Run = '', | ||
|
||
[string] | ||
$CodePath = '.', | ||
|
||
[string] | ||
$OutDirectory = '.\test\results', | ||
|
||
# uvm parameters | ||
[string] | ||
$BootFilesPath = 'C:\ContainerPlat\LinuxBootFiles', | ||
|
||
[switch] | ||
$DisableTimeSync, | ||
|
||
[string] | ||
$RootfsMount = '/run/rootfs', | ||
|
||
[string] | ||
$RootfsPath = (Join-Path $BootFilesPath 'rootfs.vhd'), | ||
# $RootfsPath = "C:\ContainerPlatData\root\io.containerd.snapshotter.v1.windows-lcow\snapshots\2\layer.vhd", | ||
|
||
[string] | ||
$GCSTestMount = '/run/bin', | ||
|
||
[string] | ||
$GCSTestPath = '.\bin\test\gcstest', | ||
|
||
[switch] | ||
$MountGCSTest, | ||
|
||
[string] | ||
$Feature = '' | ||
) | ||
|
||
Import-Module ( Join-Path $PSScriptRoot Testing.psm1 ) -Force | ||
|
||
$CodePath = Resolve-Path $CodePath | ||
$OutDirectory = Resolve-Path $OutDirectory | ||
$BootFilesPath = Resolve-Path $BootFilesPath | ||
$RootfsPath = Resolve-Path $RootfsPath | ||
$GCSTestPath = Resolve-Path $GCSTestPath | ||
|
||
$shell = ( $Action -eq 'Shell' ) | ||
|
||
if ( $shell ) { | ||
$cmd = 'ash' | ||
} else { | ||
$date = Get-Date | ||
$waitfiles = "$RootfsMount" | ||
$gcspath = 'gcstest' | ||
if ( $MountGCSTest ) { | ||
$waitfiles += ",$GCSTestMount" | ||
$gcspath = "$GCSTestMount/gcstest" | ||
} | ||
|
||
$pre = "wait-paths -p $waitfiles -t 5 ; " + ` | ||
'echo nproc: `$(nproc) ; ' + ` | ||
'echo kernel: `$(uname -a) ; ' + ` | ||
'echo gcs.commit: `$(cat /info/gcs.commit 2>/dev/null) ; ' + ` | ||
'echo gcs.branch: `$(cat /info/gcs.branch 2>/dev/null) ; ' + ` | ||
'echo tar.date: `$(cat /info/tar.date 2>/dev/null) ; ' + ` | ||
'echo image.name: `$(cat /info/image.name 2>/dev/null) ; ' + ` | ||
'echo build.date: `$(cat /info/build.date 2>/dev/null) ; ' | ||
|
||
$testcmd, $out = New-TestCommand ` | ||
-Action $Action ` | ||
-Path $gcspath ` | ||
-Name gcstest ` | ||
-OutDirectory $OutDirectory ` | ||
-Date $date ` | ||
-Note $Note ` | ||
-TestVerbose:$TestVerbose ` | ||
-Count $Count ` | ||
-BenchTime $BenchTime ` | ||
-Timeout $Timeout ` | ||
-Run $Run ` | ||
-Feature $Feature ` | ||
-Verbose:$Verbose | ||
|
||
$testcmd += " `'-rootfs-path=$RootfsMount`' " | ||
$cmd = $pre + $testcmd | ||
} | ||
|
||
$boot = '.\bin\tools\uvmboot.exe -gcs lcow ' + ` | ||
'-fwd-stdout -fwd-stderr -output-handling stdout ' + ` | ||
"-boot-files-path $BootFilesPath " + ` | ||
'-root-fs-type vhd ' + ` | ||
'-kernel-file vmlinux ' + ` | ||
"-security-policy=`"`" " + ` | ||
"-mount `"$RootfsPath,$RootfsMount`" " | ||
|
||
if ( $MountGCSTest ) { | ||
$boot += "-share `"$GCSTestPath,$GCSTestMount`" " | ||
} | ||
|
||
if ( $DisableTimeSync ) { | ||
$boot += ' -disable-time-sync ' | ||
} | ||
|
||
if ( $shell ) { | ||
$boot += ' -t ' | ||
} | ||
|
||
$boot += " -exec `"$cmd`" " | ||
|
||
Invoke-TestCommand ` | ||
-TestCmd $boot ` | ||
-TestCmdPreamble $testcmd ` | ||
-OutputFile (&{ if ( $Action -ne 'Shell' ) { $out } }) ` | ||
-OutputCmd (&{ if ( $Action -eq 'Bench' ) { 'benchstat' } }) ` | ||
-Preamble ` | ||
-Date $Date ` | ||
-Note $Note ` | ||
-Verbose:$Verbose |
Oops, something went wrong.