Configure WinRM backend for Windows
masterFor Windows testing using the winrm backend, the generated spec_helper.rb requires specific credentials and endpoint configuration.
Note that the setup template uses placeholders for <username> and <password> which must be updated in the resulting spec/spec_helper.rb. The endpoint is typically constructed as http://<TARGET_HOST>:5985/wsman.
# Example of the WinRM configuration logic generated in spec_helper.rb
user = <username>
pass = <password>
endpoint = "http://#{ENV['TARGET_HOST']}:5985/wsman"
opts = {
user: user,
password: pass,
endpoint: endpoint,
operation_timeout: 300,
no_ssl_peer_verification: false,
}
winrm = ::WinRM::Connection.new(opts)
Specinfra.configuration.winrm = winrm