Skip to content

Commit afa9d48

Browse files
authored
Merge pull request #538 from jenkinsci/revert-531-revert-496-revert-495-helpesk4557-disable-failing-test-for-now
tests(windows) re-enable failing test(s) on AWS
2 parents c2d87b8 + cf1bf3b commit afa9d48

File tree

4 files changed

+57
-64
lines changed

4 files changed

+57
-64
lines changed

tests/libcrypto.dll

-1.58 MB
Binary file not shown.

tests/ssh.exe

-925 KB
Binary file not shown.

tests/sshAgent.Tests.ps1

Lines changed: 56 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -148,69 +148,62 @@ Describe "[$global:IMAGE_NAME] image has correct version of java and git-lfs ins
148148
}
149149
}
150150

151-
# TODO: restore when https://github.com/jenkins-infra/helpdesk/issues/4557 infra issue is resolved
152-
# Describe "[$global:IMAGE_NAME] create agent container with pubkey as argument" {
153-
# BeforeAll {
154-
# $exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all `"$global:IMAGE_NAME`" `"$global:PUBLIC_SSH_KEY`""
155-
# $exitCode | Should -Be 0
156-
# Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
157-
# Start-Sleep -Seconds 10
158-
# }
159-
160-
# It 'runs commands via ssh' {
161-
# $exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
162-
# $exitCode | Should -Be 0
163-
# $stdout | Should -Match 'f00'
164-
# }
165-
166-
# AfterAll {
167-
# Cleanup($global:CONTAINERNAME)
168-
# }
169-
# }
170-
171-
# TODO: restore when https://github.com/jenkins-infra/helpdesk/issues/4557 infra issue is resolved
172-
# Describe "[$global:IMAGE_NAME] create agent container with pubkey as envvar" {
173-
# BeforeAll {
174-
# $exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all `"$global:IMAGE_NAME`" `"$global:PUBLIC_SSH_KEY`""
175-
# $exitCode | Should -Be 0
176-
# Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
177-
# Start-Sleep -Seconds 10
178-
# }
179-
180-
# It 'runs commands via ssh' {
181-
# $exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
182-
# $exitCode | Should -Be 0
183-
# $stdout | Should -Match 'f00'
184-
# Start-Sleep -Seconds 10
185-
# }
186-
187-
# AfterAll {
188-
# Cleanup($global:CONTAINERNAME)
189-
# }
190-
# }
191-
192-
193-
# TODO: restore when https://github.com/jenkins-infra/helpdesk/issues/4557 infra issue is resolved
194-
# $global:DOCKER_PLUGIN_DEFAULT_ARG="/usr/sbin/sshd -D -p 22"
195-
# Describe "[$global:IMAGE_NAME] create agent container like docker-plugin with '$global:DOCKER_PLUGIN_DEFAULT_ARG' as argument" {
196-
# BeforeAll {
197-
# [string]::IsNullOrWhiteSpace($global:DOCKER_PLUGIN_DEFAULT_ARG) | Should -BeFalse
198-
# $exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all --env=`"JENKINS_AGENT_SSH_PUBKEY=$global:PUBLIC_SSH_KEY`" `"$global:IMAGE_NAME`" `"$global:DOCKER_PLUGIN_DEFAULT_ARG`""
199-
# $exitCode | Should -Be 0
200-
# Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
201-
# Start-Sleep -Seconds 10
202-
# }
203-
204-
# It 'runs commands via ssh' {
205-
# $exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
206-
# $exitCode | Should -Be 0
207-
# $stdout | Should -Match 'f00'
208-
# }
209-
210-
# AfterAll {
211-
# Cleanup($global:CONTAINERNAME)
212-
# }
213-
# }
151+
Describe "[$global:IMAGE_NAME] create agent container with pubkey as argument" {
152+
BeforeAll {
153+
$exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all `"$global:IMAGE_NAME`" `"$global:PUBLIC_SSH_KEY`""
154+
$exitCode | Should -Be 0
155+
Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
156+
}
157+
158+
It 'runs commands via ssh' {
159+
$exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
160+
$exitCode | Should -Be 0
161+
$stdout | Should -Match 'f00'
162+
}
163+
164+
AfterAll {
165+
Cleanup($global:CONTAINERNAME)
166+
}
167+
}
168+
169+
Describe "[$global:IMAGE_NAME] create agent container with pubkey as envvar" {
170+
BeforeAll {
171+
$exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all `"$global:IMAGE_NAME`" `"$global:PUBLIC_SSH_KEY`""
172+
$exitCode | Should -Be 0
173+
Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
174+
}
175+
176+
It 'runs commands via ssh' {
177+
$exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
178+
$exitCode | Should -Be 0
179+
$stdout | Should -Match 'f00'
180+
}
181+
182+
AfterAll {
183+
Cleanup($global:CONTAINERNAME)
184+
}
185+
}
186+
187+
188+
$global:DOCKER_PLUGIN_DEFAULT_ARG="/usr/sbin/sshd -D -p 22"
189+
Describe "[$global:IMAGE_NAME] create agent container like docker-plugin with '$global:DOCKER_PLUGIN_DEFAULT_ARG' as argument" {
190+
BeforeAll {
191+
[string]::IsNullOrWhiteSpace($global:DOCKER_PLUGIN_DEFAULT_ARG) | Should -BeFalse
192+
$exitCode, $stdout, $stderr = Run-Program 'docker' "run --detach --tty --name=`"$global:CONTAINERNAME`" --publish-all --env=`"JENKINS_AGENT_SSH_PUBKEY=$global:PUBLIC_SSH_KEY`" `"$global:IMAGE_NAME`" `"$global:DOCKER_PLUGIN_DEFAULT_ARG`""
193+
$exitCode | Should -Be 0
194+
Is-ContainerRunning $global:CONTAINERNAME | Should -BeTrue
195+
}
196+
197+
It 'runs commands via ssh' {
198+
$exitCode, $stdout, $stderr = Run-ThruSSH $global:CONTAINERNAME "$global:PRIVATE_SSH_KEY" "$global:CONTAINERSHELL -NoLogo -C `"Write-Host 'f00'`""
199+
$exitCode | Should -Be 0
200+
$stdout | Should -Match 'f00'
201+
}
202+
203+
AfterAll {
204+
Cleanup($global:CONTAINERNAME)
205+
}
206+
}
214207

215208
Describe "[$global:IMAGE_NAME] build args" {
216209
BeforeAll {

tests/test_helpers.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function Run-ThruSSH($container, $privateKeyVal, $cmd) {
138138
$TMP_PRIV_KEY_FILE = New-TemporaryFile
139139
Set-Content -Path $TMP_PRIV_KEY_FILE -Value "$privateKeyVal"
140140

141-
$exitCode, $stdout, $stderr = Run-Program (Join-Path $PSScriptRoot 'ssh.exe') "-v -i `"${TMP_PRIV_KEY_FILE}`" -o LogLevel=quiet -o UserKnownHostsFile=NUL -o StrictHostKeyChecking=no -l jenkins localhost -p $SSH_PORT $cmd"
141+
$exitCode, $stdout, $stderr = Run-Program 'ssh.exe' "-v -i `"${TMP_PRIV_KEY_FILE}`" -o LogLevel=quiet -o UserKnownHostsFile=NUL -o StrictHostKeyChecking=no -l jenkins localhost -p $SSH_PORT $cmd"
142142
Remove-Item -Force $TMP_PRIV_KEY_FILE
143143

144144
return $exitCode, $stdout, $stderr

0 commit comments

Comments
 (0)