You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.
I am currently using bats (via way of busser-bats via test-kitchen + kitchen-vagrant) ... I am not sure this is even the correct layer to ask this question but here goes...
I wish to run the bats test suite as the "vagrant" user (or in a general sense, the original user used to shell into my test-kitchen host)
At the moment it appears that my bats test suites run as the "root" user (likely via some sudoing done in the test-kitchen/busser/bats integration) and I have to work around this inorder to test certain things (like rvm installations for my user)
Below is an example of how I get around the issue to test that I have the right version of ruby
This works ok, but it sorta clutters up the test suite code (I am currently working on making it a re-usable function) but I was wondering if there was anything I could just configure to make it use the "logged in user" by default?
Side note, the user switching also causes issues with SSH agent forwarding ENVs and to make things as simple as possible I would like to execute my test suite as the logged in user, and then sudo -uroot where necessary (to prevent double user switching hops and having to carry the ENV through each one)
The text was updated successfully, but these errors were encountered:
I am currently using bats (via way of busser-bats via test-kitchen + kitchen-vagrant) ... I am not sure this is even the correct layer to ask this question but here goes...
I wish to run the bats test suite as the "vagrant" user (or in a general sense, the original user used to shell into my test-kitchen host)
At the moment it appears that my bats test suites run as the "root" user (likely via some sudoing done in the test-kitchen/busser/bats integration) and I have to work around this inorder to test certain things (like rvm installations for my user)
Below is an example of how I get around the issue to test that I have the right version of ruby
This works ok, but it sorta clutters up the test suite code (I am currently working on making it a re-usable function) but I was wondering if there was anything I could just configure to make it use the "logged in user" by default?
Side note, the user switching also causes issues with SSH agent forwarding ENVs and to make things as simple as possible I would like to execute my test suite as the logged in user, and then
sudo -uroot
where necessary (to prevent double user switching hops and having to carry the ENV through each one)The text was updated successfully, but these errors were encountered: