Sha256: 18956a9dff3e137b33e9608291d36680a127d81f2993509a1f7422cafd709cc1

Contents?: true

Size: 806 Bytes

Versions: 17

Compression:

Stored size: 806 Bytes

Contents

require File.expand_path("../../../base", __FILE__)

require "vagrant/util/platform"
require "vagrant/util/ssh"

describe Vagrant::Util::SSH do
  include_context "unit"

  describe "checking key permissions" do
    let(:key_path) { temporary_file }

    it "should do nothing on Windows" do
      allow(Vagrant::Util::Platform).to receive(:windows?).and_return(true)

      key_path.chmod(0700)

      # Get the mode now and verify that it is untouched afterwards
      mode = key_path.stat.mode
      described_class.check_key_permissions(key_path)
      expect(key_path.stat.mode).to eq(mode)
    end

    it "should fix the permissions", :skip_windows do
      key_path.chmod(0644)

      described_class.check_key_permissions(key_path)
      expect(key_path.stat.mode).to eq(0100600)
    end
  end
end

Version data entries

17 entries across 14 versions & 4 rubygems

Version Path
vagrant-unbundled-1.9.5.1 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.9.1.1 test/unit/vagrant/util/ssh_test.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/vagrant/util/ssh_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/vagrant/util/ssh_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/vagrant/util/ssh_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.5.2 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.5.1 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.4.2 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.4.1 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.1.2 test/unit/vagrant/util/ssh_test.rb
vagrant-unbundled-1.8.1.1 test/unit/vagrant/util/ssh_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/test/unit/vagrant/util/ssh_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/test/unit/vagrant/util/ssh_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/test/unit/vagrant/util/ssh_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/test/unit/vagrant/util/ssh_test.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/test/unit/vagrant/util/ssh_test.rb