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

Busser Fixes for Greybeard UNIX #265

Merged
merged 8 commits into from
Nov 29, 2013
Merged

Busser Fixes for Greybeard UNIX #265

merged 8 commits into from
Nov 29, 2013

Conversation

schisamo
Copy link
Contributor

A number of fixes for Kitchen::Busser I wound while testing 1.0.0.rc.1 against a network switch which runs a stripped down version of FreeBSD.

Fixes include:

  • Busser config key name is sudo not use_sudo
  • Ensure busser/ruby_bindir config value is respected
  • Ensure busser/busser_bin config value is respected
  • Remove all newline characters from remote Busser commands (see commit message for in depth explanation).

Here is the .kitchen.yml I used in my testing:
https://gist.github.com/schisamo/0b1eb8da5034f85199f0

Some shells (*cough* C shell *cough*) do not appreciate commands 
littered with newline characters. This commit just ensures all remote 
Busser commands are one liners. Even though the remote Busser commands 
are executed under Bourne (via `sh -c`) we cannot guarantee the $SHELL 
of the user we are SSH-ing in as will be Bourne.

More info regarding C shell (csh) + newlines here:
http://www.grymoire.com/Unix/CshTop10.txt
@fnichol
Copy link
Contributor

fnichol commented Nov 28, 2013

So sorry, my tied brain missing this last night. Will review test, and be ready for a quick and simple rc.2 tonight.

@schisamo
Copy link
Contributor Author

@fnichol No worries man! You actually didn't miss it last night, I just hacked on these fixes this AM! 😄

@fnichol
Copy link
Contributor

fnichol commented Nov 28, 2013

Did Busser not properly generate its binstub script in /var/tmp/kitchen-busser/bin/busser to find the path to Ruby (requiring https://gist.github.com/schisamo/0b1eb8da5034f85199f0#file-kitchen-yml-L22)?

If not I can work to make sure that Busser works in this case. However, I'm really glad to see that setting busser_bin is another way around the problem. More options!

@schisamo
Copy link
Contributor Author

No, that is my workaround to the fact that the switch only allows bin files from signed packages to be executed. In the case of /opt/sdk/opscode/bin/ruby /var/tmp/kitchen-busser/gems/bin/busser the ruby is signed.

@fnichol
Copy link
Contributor

fnichol commented Nov 28, 2013

OMGROFLBBQ, right. This is an extreme example, which is great!

zqiiqdw

This should allow for more consistent configuration output and pave the
way for user, default, inherited, and computed configuration support.
@fnichol
Copy link
Contributor

fnichol commented Nov 29, 2013

@schisamo How does this look now? Small enough refactors, but should help kitchen list --debug output.

I think we can get away with Busser[:sudo] = false by default, what do you think? I'm hoping that most testing code would not need to operate as root since it's most likely a passive activity. Thoughts?

@schisamo
Copy link
Contributor Author

Agreed on sudo = false by default. Otherwise LGTM!

👍 :shipit:

@fnichol
Copy link
Contributor

fnichol commented Nov 29, 2013

Choo choo!

fnichol added a commit that referenced this pull request Nov 29, 2013
Busser Fixes for Greybeard UNIX
@fnichol fnichol merged commit f271297 into master Nov 29, 2013
@fnichol fnichol deleted the busser-fixes branch November 29, 2013 01:07
fnichol added a commit that referenced this pull request Dec 4, 2013
It appears that some platforms (CentOS being one of them) may want to
call certain progrmas as root. Either because of the path to
/sbin/service or other reasons.

Setting Busser configuration option of `sudo` to `true` should enable
a better out-of-the-box experience in the default case and still
allows for this setting to be overriden in a busser config block in the
root of the .kitchen.yml document:

    ---
    driver: vagrant
    provisioner: chef_solo

    busser:
      sudo: false

    platforms:
      - name: centos-6.4

    suites:
      - name: server

Or in a platform:

    ---
    driver: vagrant
    provisioner: chef_solo

    platforms:
      - name: centos-6.4
        busser:
          sudo: false

    suites:
      - name: server

Or in a suite:

    ---
    driver: vagrant
    provisioner: chef_solo

    platforms:
      - name: centos-6.4

    suites:
      - name: server
        busser:
          sudo: false

This reverts commit f002ae7.

Closes #269
References #273
References #270
References #265
BrentOnRails pushed a commit to BrentOnRails/test-kitchen that referenced this pull request Jul 17, 2017
@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants