summaryrefslogtreecommitdiff
path: root/spec/acceptance/beaker/git/user_checkout
diff options
context:
space:
mode:
Diffstat (limited to 'spec/acceptance/beaker/git/user_checkout')
-rw-r--r--spec/acceptance/beaker/git/user_checkout/negative/user_checkout_file_non_existent_user.rb5
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_file.rb8
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_file_path.rb8
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_git.rb10
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_http.rb10
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_https.rb10
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_scp.rb15
-rw-r--r--spec/acceptance/beaker/git/user_checkout/user_checkout_ssh.rb15
8 files changed, 41 insertions, 40 deletions
diff --git a/spec/acceptance/beaker/git/user_checkout/negative/user_checkout_file_non_existent_user.rb b/spec/acceptance/beaker/git/user_checkout/negative/user_checkout_file_non_existent_user.rb
index 98099ee..19af709 100644
--- a/spec/acceptance/beaker/git/user_checkout/negative/user_checkout_file_non_existent_user.rb
+++ b/spec/acceptance/beaker/git/user_checkout/negative/user_checkout_file_non_existent_user.rb
@@ -14,7 +14,7 @@ hosts.each do |host|
end
step 'setup - delete user' do
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
teardown do
@@ -31,8 +31,7 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :expect_failures => true)
end
step "verify git checkout is NOT owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_file.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_file.rb
index 9920b0b..9133661 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_file.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_file.rb
@@ -14,12 +14,12 @@ hosts.each do |host|
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout as a user with puppet' do
@@ -32,8 +32,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_file_path.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_file_path.rb
index 1817229..1104fdd 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_file_path.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_file_path.rb
@@ -14,12 +14,12 @@ hosts.each do |host|
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout a user with puppet' do
@@ -32,8 +32,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_git.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_git.rb
index d7504b0..1fb61b6 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_git.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_git.rb
@@ -18,13 +18,13 @@ hosts.each do |host|
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- on(host, 'pkill -9 git-daemon')
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ on(host, 'pkill -9 git-daemon ; sleep 1')
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout a user with puppet' do
@@ -37,8 +37,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_http.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_http.rb
index 07f5c1c..03ea27b 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_http.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_http.rb
@@ -26,13 +26,13 @@ hosts.each do |host|
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- on(host, "ps ax | grep '#{ruby} /tmp/http_daemon.rb' | grep -v grep | awk '{print \"kill -9 \" $1}' | sh")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ on(host, "ps ax | grep '#{ruby} /tmp/http_daemon.rb' | grep -v grep | awk '{print \"kill -9 \" $1}' | sh ; sleep 1")
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout a user with puppet' do
@@ -45,8 +45,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_https.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_https.rb
index 7187586..7348755 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_https.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_https.rb
@@ -33,13 +33,13 @@ hosts.each do |host|
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- on(host, "ps ax | grep '#{ruby} /tmp/https_daemon.rb' | grep -v grep | awk '{print \"kill -9 \" $1}' | sh")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ on(host, "ps ax | grep '#{ruby} /tmp/https_daemon.rb' | grep -v grep | awk '{print \"kill -9 \" $1}' | sh ; sleep 1")
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout as a user with puppet' do
@@ -52,8 +52,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_scp.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_scp.rb
index a4f7261..dccf9f8 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_scp.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_scp.rb
@@ -14,22 +14,23 @@ hosts.each do |host|
end
step 'setup - establish ssh keys' do
# create ssh keys
- on(host, 'ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""')
+ on(host, 'yes | ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""')
# copy public key to authorized_keys
+ on(host, 'cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys')
on(host, 'echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config')
on(host, 'chown -R root:root /root/.ssh')
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- apply_manifest_on(host, "file{'/root/.ssh/id_rsa': ensure => absent, force => true }")
- apply_manifest_on(host, "file{'/root/.ssh/id_rsa.pub': ensure => absent, force => true }")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ apply_manifest_on(host, "file{'/root/.ssh/id_rsa': ensure => absent, force => true }", :catch_failures => true)
+ apply_manifest_on(host, "file{'/root/.ssh/id_rsa.pub': ensure => absent, force => true }", :catch_failures => true)
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout as a user with puppet (scp syntax)' do
@@ -42,8 +43,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do
diff --git a/spec/acceptance/beaker/git/user_checkout/user_checkout_ssh.rb b/spec/acceptance/beaker/git/user_checkout/user_checkout_ssh.rb
index 50c73f4..5ee01b1 100644
--- a/spec/acceptance/beaker/git/user_checkout/user_checkout_ssh.rb
+++ b/spec/acceptance/beaker/git/user_checkout/user_checkout_ssh.rb
@@ -14,22 +14,23 @@ hosts.each do |host|
end
step 'setup - establish ssh keys' do
# create ssh keys
- on(host, 'ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""')
+ on(host, 'yes | ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""')
# copy public key to authorized_keys
+ on(host, 'cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys')
on(host, 'echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config')
on(host, 'chown -R root:root /root/.ssh')
end
step 'setup - create user' do
- apply_manifest_on(host, "user { '#{user}': ensure => present, }")
+ apply_manifest_on(host, "user { '#{user}': ensure => present, }", :catch_failures => true)
end
teardown do
on(host, "rm -fr #{tmpdir}")
- apply_manifest_on(host, "file{'/root/.ssh/id_rsa': ensure => absent, force => true }")
- apply_manifest_on(host, "file{'/root/.ssh/id_rsa.pub': ensure => absent, force => true }")
- apply_manifest_on(host, "user { '#{user}': ensure => absent, }")
+ apply_manifest_on(host, "file{'/root/.ssh/id_rsa': ensure => absent, force => true }", :catch_failures => true)
+ apply_manifest_on(host, "file{'/root/.ssh/id_rsa.pub': ensure => absent, force => true }", :catch_failures => true)
+ apply_manifest_on(host, "user { '#{user}': ensure => absent, }", :catch_failures => true)
end
step 'checkout as a user with puppet' do
@@ -42,8 +43,8 @@ hosts.each do |host|
}
EOS
- apply_manifest_on(host, pp)
- apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp, :catch_failures => true)
+ apply_manifest_on(host, pp, :catch_changes => true)
end
step "verify git checkout is owned by user #{user}" do