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

Windows OS Detection #383

Closed
username-is-already-taken2 opened this issue Jan 21, 2016 · 5 comments
Closed

Windows OS Detection #383

username-is-already-taken2 opened this issue Jan 21, 2016 · 5 comments
Assignees
Labels
Type: Bug Feature not working as expected
Milestone

Comments

@username-is-already-taken2
Copy link
Contributor

Hi there

This might be related to issue #346 but I'm finding that the OS on my workstation is not being detected correctly

PS C:\> inspec detect
{"name":null,"family":"unix","release":null,"arch":null}

I'm using Windows 10 Version 1511 (OS Build 10586.63)

Thanks

Gary

@username-is-already-taken2
Copy link
Contributor Author

I think this issue is affecting my ability to write and test certain resources

I've written a basic check to test the state of a service.

control 'winrm-service-1.0' do
  impact 1.0
  title 'Check the state of the winrm service'
  desc 'The winrm service should exists'
  describe service('WinRM') do
    it { should be_installed }
  end
end

Yet I get this

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Service WinRM The `service` resource is not supported on your OS yet.
     # Not yet implemented
     #

Finished in 0 seconds (files took 12.08 seconds to load)
1 example, 0 failures, 1 pending

Do you know if there is anyway I can force it (maybe within the inspec shell?) to windows?

Thanks

Gary

@chris-rock
Copy link
Contributor

@username-is-already-taken2 thanks for reporting this. This has high-priority for the next release

@chris-rock chris-rock added the Type: Bug Feature not working as expected label Jan 21, 2016
@chris-rock chris-rock added this to the 0.9.10 milestone Jan 21, 2016
@chris-rock chris-rock self-assigned this Jan 22, 2016
@chris-rock
Copy link
Contributor

@username-is-already-taken2 I cannot error where InSpec is not able to detect the OS.

PS C:\Users\chris> systeminfo | findstr /C:"OS"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.10240 N/A Build 10240
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
BIOS Version:              Phoenix Technologies LTD 6.00, 5/20/2014
PS C:\Users\chris> inspec version
0.9.9
PS C:\Users\chris> inspec detect
{"name":null,"family":"windows","release":"10","arch":null}
PS C:\Users\chris>

Could you paste the inspec version you are using?

@chris-rock
Copy link
Contributor

In combination with a fix in train, this works on my machine now.

PS C:\Users\chris\inspec> cat ..\..\service_spec.rb
control 'winrm-service-1.0' do
  impact 1.0
  title 'Check the state of the winrm service'
  desc 'The winrm service should exists'
  describe service('WinRM') do
    it { should be_installed }
  end
end

PS C:\Users\chris\inspec> bundle exec ruby .\bin\inspec exec ..\..\service_spec.rb
.

Finished in 1 second (files took 1.94 seconds to load)
1 example, 0 failures

PS C:\Users\chris\inspec>

Please ensure you have inspec 0.9.9 and train 0.9.4 installed, otherwise it does not work properly if executed locally. The execution via WinRM was not affected.

@chris-rock
Copy link
Contributor

username-is-already-taken2 Please reopen if this is still an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants