From 0d9e938e92a25673c3712866e2d2108a255b67d5 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 20 May 2014 18:15:03 -0700 Subject: Update specs and fix FM-1361 - Add install.rb for pre-suite - Add catches for failures/changes to manifest application - Correct root ssh key copying - Add sleeps for killing processes releasing ports - Fix FM-1361 --- .../git/shallow_clone/negative/shallow_clone_exec_depth.rb | 4 ++-- .../git/shallow_clone/negative/shallow_clone_file_path.rb | 4 ++-- .../beaker/git/shallow_clone/negative/shallow_clone_http.rb | 5 ++--- .../shallow_clone/negative/shallow_clone_negative_depth.rb | 4 ++-- .../shallow_clone/negative/shallow_clone_overflow_depth.rb | 4 ++-- .../acceptance/beaker/git/shallow_clone/shallow_clone_file.rb | 4 ++-- spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb | 6 +++--- .../beaker/git/shallow_clone/shallow_clone_https.rb | 6 +++--- spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb | 11 ++++++----- spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb | 11 ++++++----- .../beaker/git/shallow_clone/shallow_clone_zero_depth.rb | 4 ++-- 11 files changed, 32 insertions(+), 31 deletions(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb index caef5a6..d82e3c6 100644 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb @@ -26,8 +26,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 checkout is NOT shallow' do diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb index c336842..961d0fe 100644 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb @@ -27,8 +27,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 'git does not support shallow clone via file path: verify checkout is NOT created' do diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb index ecd51ad..956d7de 100644 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb @@ -26,7 +26,7 @@ hosts.each do |host| 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') + on(host, 'ps ax | grep "#{ruby} /tmp/http_daemon.rb" | grep -v grep | awk \'{print "kill -9 " $1}\' | sh ; sleep 1') end step 'shallow clone repo with puppet' do @@ -39,8 +39,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 'git does not support shallow clone via HTTP: verify checkout is NOT created' do diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb index 2ba1f0f..c80faa0 100644 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb @@ -26,8 +26,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 checkout is NOT shallow' do diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb index 55ff878..fdf4977 100644 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb @@ -26,8 +26,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 checkout is NOT shallow' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb index 52eb3d2..f54f1ab 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb @@ -26,8 +26,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 checkout is shallow and of the correct depth' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb index d7c81fb..ab3bd07 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -18,7 +18,7 @@ hosts.each do |host| teardown do on(host, "rm -fr #{tmpdir}") - on(host, 'pkill -9 git-daemon') + on(host, 'pkill -9 git-daemon ; sleep 1') end step 'shallow clone repo with puppet' do @@ -31,8 +31,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 checkout is shallow and of the correct depth' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb index 9220e27..93a328c 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -34,7 +34,7 @@ hosts.each do |host| 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') + on(host, 'ps ax | grep "#{ruby} /tmp/https_daemon.rb" | grep -v grep | awk \'{print "kill -9 " $1}\' | sh ; sleep 1') end step 'shallow clone repo with puppet' do @@ -47,8 +47,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 checkout is shallow and of the correct depth' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb index 6837802..ddef4e7 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb @@ -13,17 +13,18 @@ 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 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, "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) end step 'shallow clone repo with puppet (scp syntax)' do @@ -36,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 checkout is shallow and of the correct depth' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb index fda9bf4..da5528c 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb @@ -13,17 +13,18 @@ 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 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, "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) end step 'shallow clone repo with puppet' do @@ -36,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 checkout is shallow and of the correct depth' do diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb index 6cec2a1..eb8b121 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb @@ -26,8 +26,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 checkout is NOT shallow' do -- cgit v1.2.3