[Ubuntu] Migrate PowerShell and Docker tests to Pester (#2317)

* PowerShell and Docker Pester tests

* no pester module

* import pester

* invoke docker with sudo

* remove native test

* add fix for az 1.0.0 module

* revert powershellget installation

* revert flag Force

* add $ProgressPreference = "SilentlyContinue"
This commit is contained in:
Aleksandr Chebotov
2020-12-23 15:18:48 +03:00
committed by GitHub
parent ec4b0fa89c
commit ac87b63b13
12 changed files with 162 additions and 72 deletions

View File

@@ -16,6 +16,40 @@ Describe "azcopy" {
}
}
Describe "Docker" {
It "docker" {
"docker --version" | Should -ReturnZeroExitCode
}
It "docker buildx" {
"docker buildx" | Should -ReturnZeroExitCode
}
Context "docker images" {
$testCases = (Get-ToolsetContent).docker.images | ForEach-Object { @{ ImageName = $_ } }
It "<ImageName>" -TestCases $testCases {
sudo docker images "$ImageName" --format "{{.Repository}}" | Should -Not -BeNullOrEmpty
}
}
}
Describe "Docker-compose" {
It "docker-compose" {
"docker-compose --version"| Should -ReturnZeroExitCode
}
}
Describe "PowerShell Core" {
It "pwsh" {
"pwsh --version" | Should -ReturnZeroExitCode
}
It "Execute 2+2 command" {
pwsh -Command "2+2" | Should -BeExactly 4
}
}
Describe "Ansible" {
It "Ansible" {
"ansible --version" | Should -ReturnZeroExitCode
@@ -84,4 +118,4 @@ Describe "gfortran" {
"$GfortranVersion --version" | Should -ReturnZeroExitCode
}
}
}