[Ubuntu] Add verbosity during software report generation (#4811)

* Add verbosity during software report generation

* Fix Get-CpanVersion

* set default ValidateExitCode value to $true

* update java test

* use lower-case for parameters
This commit is contained in:
Aleksandr Chebotov
2021-12-28 11:16:20 +03:00
committed by GitHub
parent bb56fb7ef4
commit 92eeb55189
8 changed files with 107 additions and 44 deletions

View File

@@ -29,8 +29,7 @@ Describe "Java" {
$gradleVariableValue | Should -BeLike "/usr/share/gradle-*"
$gradlePath = Join-Path $env:GRADLE_HOME "bin/gradle"
$result = Get-CommandResult "`"$GradlePath`" -version"
$result.ExitCode | Should -Be 0
"`"$GradlePath`" -version" | Should -ReturnZeroExitCode
}
It "Java <Version>" -TestCases $jdkVersions {
@@ -38,12 +37,11 @@ Describe "Java" {
$javaVariableValue | Should -Not -BeNullOrEmpty
$javaPath = Join-Path $javaVariableValue "bin/java"
$result = Get-CommandResult "`"$javaPath`" -version"
$result.ExitCode | Should -Be 0
"`"$javaPath`" -version" | Should -ReturnZeroExitCode
if ($Version -eq 8) {
$Version = "1.${Version}"
}
$result.Output | Should -Match ([regex]::Escape("openjdk version `"${Version}."))
"`"$javaPath`" -version" | Should -MatchCommandOutput ([regex]::Escape("openjdk version `"${Version}."))
}
}