Skip to content

Commit

Permalink
🐞 Ensure BOSH.SSH Install-SSHD func is available
Browse files Browse the repository at this point in the history
The automation helper script that we use to setup the stemcell makes a
call to a custom method we've written called Install-SSHD in the
BOSH.SSH module. This conflicts with the recently introduced
`install-sshd.ps1` script that OpenSSH 9.1 installs.

Normally, calling Install-SSHD would cause Powershell to look through
its list of modules and load the appropriate one. However, since OpenSSH
9.1 now puts its `install-sshd.ps1` script in a default path, that
  script was being executed instead of causing the module lookup.

We believe this is only a problem for our tests, because that
Install-SSHD function is the way we install OpenSSH, and thus the
conflicting script does not exist when we call the function during the
stemcell build process.

Fixes error in
https://ci.bosh-ecosystem.cf-app.com/teams/main/pipelines/windows-2019-stemcell/jobs/stembuild-windows/builds/802:
```
A parameter cannot be found that matches parameter name 'SSHZipFile'.
```

Signed-off-by: Brian Cunnie <bcunnie@vmware.com>
  • Loading branch information
ystros authored and cunnie committed Jan 31, 2023
1 parent 5d9858c commit 58d4f67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stemcell-automation/AutomationHelpers.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# We import module BOSH.SSH to ensure that we get the Install-SSHD function it defines. Starting with
# OpenSSH 9.1, there is a conflicting install-sshd.ps1 script that takes precedence instead if you do
# not load the module.
Import-Module -Name BOSH.SSH
. ./AutomationHelpers.ps1
. ./ProvisionVM.ps1

Expand Down

0 comments on commit 58d4f67

Please sign in to comment.