Prevent "validate" error on sudo

Validate prints "unexpected exit code" and a stacktrace on the "sudo whoami" step.
This is caused by insufficient permissions on /tmp/validation.sh - when it is written, the "execute" flag is not set.
I added a chmod after file creation to fix the permissions.
This commit is contained in:
Arne Hormann 2012-10-17 12:22:26 +03:00
Родитель 06f93ae0e2
Коммит c2f7d28c3a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -9,7 +9,7 @@ Given /^a veeweebox was build$/ do
end end
When /^I sudorun "([^\"]*)" over ssh$/ do |command| When /^I sudorun "([^\"]*)" over ssh$/ do |command|
@box.exec("echo '#{command}' > /tmp/validation.sh") @box.exec("echo '#{command}' > /tmp/validation.sh && chmod a+x /tmp/validation.sh")
@sshresult=@box.exec(@box.sudo("/tmp/validation.sh")) @sshresult=@box.exec(@box.sudo("/tmp/validation.sh"))
end end