2021-10-07 09:40:17 +03:00
|
|
|
|
# Copyright (c) Microsoft Corporation
|
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
param ([parameter(Mandatory=$false)][string] $Target = "TEST_VM",
|
|
|
|
|
[parameter(Mandatory=$false)][string] $LogFileName = "TestLog.log",
|
|
|
|
|
[parameter(Mandatory=$false)][string] $WorkingDirectory = $pwd.ToString(),
|
2022-02-26 04:53:12 +03:00
|
|
|
|
[parameter(Mandatory=$false)][string] $TestExecutionJsonFileName = "test_execution.json")
|
2021-10-07 09:40:17 +03:00
|
|
|
|
|
|
|
|
|
Push-Location $WorkingDirectory
|
|
|
|
|
|
|
|
|
|
$TestVMCredential = Get-StoredCredential -Target $Target -ErrorAction Stop
|
|
|
|
|
|
|
|
|
|
# Load other utility modules.
|
|
|
|
|
Import-Module .\common.psm1 -Force -ArgumentList ($LogFileName) -WarningAction SilentlyContinue
|
|
|
|
|
Import-Module .\vm_run_tests.psm1 -Force -ArgumentList ($TestVMCredential.UserName, $TestVMCredential.Password, $WorkingDirectory, $LogFileName) -WarningAction SilentlyContinue
|
|
|
|
|
|
2022-03-15 01:16:11 +03:00
|
|
|
|
# Read the test execution json.
|
2022-02-26 04:53:12 +03:00
|
|
|
|
$Config = Get-Content ("{0}\{1}" -f $PSScriptRoot, $TestExecutionJsonFileName) | ConvertFrom-Json
|
|
|
|
|
$BasicTest = $Config.BasicTest
|
2021-10-07 09:40:17 +03:00
|
|
|
|
|
2022-02-26 04:53:12 +03:00
|
|
|
|
# Run tests on test VMs.
|
|
|
|
|
foreach ($VM in $BasicTest) {
|
2021-10-07 09:40:17 +03:00
|
|
|
|
Invoke-CICDTestsOnVM -VMName $VM.Name
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-15 01:16:11 +03:00
|
|
|
|
Invoke-XDPTestsOnVM $Config.MultiVMTest
|
2022-02-26 04:53:12 +03:00
|
|
|
|
|
|
|
|
|
# Stop eBPF components on test VMs.
|
|
|
|
|
foreach ($VM in $Config.MultiVMTest) {
|
|
|
|
|
Stop-eBPFComponentsOnVM -VMName $VM.Name
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-07 09:40:17 +03:00
|
|
|
|
Pop-Location
|