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

Option 'sudo: true' doesn't work on CentOS 7, 8 and ubuntu devel 20.04 #246

Closed
diodonfrost opened this issue Dec 16, 2019 · 2 comments
Closed

Comments

@diodonfrost
Copy link

Versions:

  • kitchen-docker 2.9.0
  • kitchen-inspec 1.3.1
  • test-kitchen 2.3.4

Environments:

CentOS 7, CentOS 8 and Ubuntu devel 20.04

Scenario:

Kitchen-inspec crash on Centos 7, Centos 8 and Ubuntu devel 20.04 when sudo option is set on true

Steps to Reproduce:

Content of Inspec test file test_spec.rb:

control 'test-01' do
  impact 1.0
  title 'Sample test'
  desc 'Sample test file'
  describe file('/tmp') do
    it { should be_directory }
  end
end

Content of Kitchen-ci file .kitchen.yml:

---
driver:
  name: docker

platforms:
  - name: centos-8
    driver:
      image: centos:8
      platform: centos

verifier:
  name: inspec
  sudo: true
  inspec_tests:
    - path: test_spec.rb

suites:
  - name: default

Expected Result:

  ✔  test-01: Sample test
     ✔  File /tmp should be directory

Actual Result:

-----> Verifying <default-centos-8>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #verify action: [Sudo failed: usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-T timeout] [-u user] file ...
 ] on default-centos-8
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

This error does not occur when sudo option is set to false

@Afterglow
Copy link

This seems to be caused by an issue in train not in kitchen-inspec directly see inspec/train#548

@diodonfrost
Copy link
Author

Indeed you're right,

I fixed this problem by using gem train 3.1.8

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants