Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First whack at windows (target) support for taste-tester #144

Merged
merged 1 commit into from
Aug 24, 2020

Commits on Aug 24, 2020

  1. First whack at windows (target) support for taste-tester

    I can't imagine we have any desire to have TT itself run on Windows,
    however, one has to manage their windows system sometime, and that means
    being able to test on those systems.
    
    This adds support for the remote system by generating the right
    powershell to send over ssh.
    
    That means there are two requirements to using this:
    
    1. You have ssh enabled on your Windows PC
    2. You set the default shell to powershell instead of cmd
    
    Both are easily accomplished with this tiny bit of Chef:
    
    ```ruby
    powershell_package 'ComputerManagementDsc' do
      action :install
    end
    
    dsc_resource 'install ssh-client' do
      resource :windowscapability
      module_name 'ComputerManagementDsc'
      property :name, 'OpenSSH.Client~~~~0.0.1.0'
      property :ensure, 'Present'
    end
    
    dsc_resource 'install ssh-server' do
      resource :windowscapability
      module_name 'ComputerManagementDsc'
      property :name, 'OpenSSH.Server~~~~0.0.1.0'
      property :ensure, 'Present'
    end
    
    dsc_resource 'start sshd' do
      resource :service
      property :name, 'sshd'
      property :startuptype, 'Automatic'
      property :state, 'Running'
      property :ensure, 'Present'
    end
    ```
    
    This also requires you to be on a version modern enough that symlinks
    actually work - sorry, we're not re-inventing how taste-tester works
    for old broken OSes. Getting Windws support here is ugly enough as it
    is.
    
    You may be wondering "but Windows has bash support now!"... and you'd be
    sorta-right. You can enable WSL and Bash in modern Windows, but you end
    up in a embedded linux environment. You can access the Windows
    filesystem, but it's not a thing most people are going to want to do on
    their windows systems. So, powershell it is.
    
    This fully supports tunnels and non-tunnels. As far as I can tell,
    everything works except "bundle mode" and "local transport", but I don't
    think those are necessary here.
    
    In order to not repeat the *crazy* trans-shell logic, I factored out
    some code that was repeated (but badly, with bugs - now we *always*
    specify `-o StrictHostKeyChecking=no` and friends, not just sometimes)
    between ssh.rb and tunnel.rb into ssh_util.rb. I took this approach
    because it was the least change, and since that's not directly related
    to this PR, I wanted to minimize that. However, the long-term solution
    here is to just roll tunnel.rb into ssh.rb. It already has a `tunnel`
    option it ignores in the initializer.
    
    Signed-off-by: Phil Dibowitz <[email protected]>
    jaymzh committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    722c7e0 View commit details
    Browse the repository at this point in the history