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

it always invokes tests as root #52

Closed
JigarJoshi opened this issue May 16, 2014 · 1 comment
Closed

it always invokes tests as root #52

JigarJoshi opened this issue May 16, 2014 · 1 comment

Comments

@JigarJoshi
Copy link
Contributor

in my .kitchen.yml file I have

username: some-user-name

and I have a test

@test "whoami" {
  whoami > /tmp/1.txt
}

after this if I do kitchen login and cat /tmp/1.txt it prints root

when I do kitchen login it logs in as some-user-name

@sethvargo
Copy link
Contributor

@JigarJoshi this is the expected behavior. Serverspec and bats should be run as root, because they often require unrestricted access to read and write from the filesystem. Without that permission level, you would be unable to test many pieces of the system.

Because of the way EC2 instances are provisioned, the "login user" may vary. On Ubuntu, it's ubuntu, but it's root on some other systems. You can read more about it here: http://alestic.com/2014/01/ec2-ssh-username

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