Skip to content

Commit

Permalink
uncomment build test
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Aug 9, 2023
1 parent c903f66 commit 8eb4621
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/sshAgent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ TUwLP4n7pK4J2sCIs6fRD5kEYms4BnddXeRuI2fGZHGH70Ci/Q==
Cleanup($global:CONTAINERNAME)

# TODO: uncomment (fixed)
# Describe "[$global:AGENT_IMAGE] image is present" {
# It 'builds image' {
# $exitCode, $stdout, $stderr = Run-Program 'docker' "build --tag=${global:AGENT_IMAGE} --file ./windows/${global:WINDOWSFLAVOR}/Dockerfile ${global:BUILD_CONTEXT}"
# $exitCode | Should -Be 0
# }
# }
Describe "[$global:AGENT_IMAGE] image is present" {
It 'builds image' {
$exitCode, $stdout, $stderr = Run-Program 'docker' "build --tag=${global:AGENT_IMAGE} --file ./windows/${global:WINDOWSFLAVOR}/Dockerfile ${global:BUILD_CONTEXT}"
$exitCode | Should -Be 0
}
}

# TODO: uncomment (fixed)
# Describe "[$global:AGENT_IMAGE] image has setup-sshd.ps1 in the correct location" {
Expand Down Expand Up @@ -94,27 +94,27 @@ Cleanup($global:CONTAINERNAME)
# }

# TODO: uncomment (fixed)
Describe "[$global:AGENT_IMAGE] image has correct version of java installed and in the PATH" {
BeforeAll {
docker run --detach --tty --name="$global:CONTAINERNAME" --publish-all "$global:AGENT_IMAGE" $global:CONTAINERSHELL
Is-ContainerRunning $global:CONTAINERNAME
}
# Describe "[$global:AGENT_IMAGE] image has correct version of java installed and in the PATH" {
# BeforeAll {
# docker run --detach --tty --name="$global:CONTAINERNAME" --publish-all "$global:AGENT_IMAGE" $global:CONTAINERSHELL
# Is-ContainerRunning $global:CONTAINERNAME
# }

It 'has java installed and in the path' {
$exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"if(`$null -eq (Get-Command java.exe -ErrorAction SilentlyContinue)) { exit -1 } else { exit 0 }`"" $global:TESTS_DEBUG
$exitCode | Should -Be 0
# It 'has java installed and in the path' {
# $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"if(`$null -eq (Get-Command java.exe -ErrorAction SilentlyContinue)) { exit -1 } else { exit 0 }`"" $global:TESTS_DEBUG
# $exitCode | Should -Be 0

$exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`$version = java -version 2>&1 ; Write-Host `$version`"" $global:TESTS_DEBUG
$r = [regex] "^openjdk version `"(?<major>\d+)"
$m = $r.Match($stdout)
$m | Should -Not -Be $null
$m.Groups['major'].ToString() | Should -Be "$global:JDKMAJORVERSION"
}
# $exitCode, $stdout, $stderr = Run-Program 'docker' "exec $global:CONTAINERNAME $global:CONTAINERSHELL -C `"`$version = java -version 2>&1 ; Write-Host `$version`"" $global:TESTS_DEBUG
# $r = [regex] "^openjdk version `"(?<major>\d+)"
# $m = $r.Match($stdout)
# $m | Should -Not -Be $null
# $m.Groups['major'].ToString() | Should -Be "$global:JDKMAJORVERSION"
# }

AfterAll {
Cleanup($global:CONTAINERNAME)
}
}
# AfterAll {
# Cleanup($global:CONTAINERNAME)
# }
# }

# TODO: fix
# Describe "[$global:AGENT_IMAGE] create agent container with pubkey as argument" {
Expand Down

0 comments on commit 8eb4621

Please sign in to comment.