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 --- .../beaker/git/branch_checkout/branch_checkout_file.rb | 4 ++-- .../beaker/git/branch_checkout/branch_checkout_file_path.rb | 4 ++-- .../beaker/git/branch_checkout/branch_checkout_git.rb | 6 +++--- .../beaker/git/branch_checkout/branch_checkout_http.rb | 6 +++--- .../beaker/git/branch_checkout/branch_checkout_https.rb | 6 +++--- .../beaker/git/branch_checkout/branch_checkout_scp.rb | 11 ++++++----- .../beaker/git/branch_checkout/branch_checkout_ssh.rb | 11 ++++++----- .../branch_checkout/negative/branch_checkout_not_exists.rb | 3 +-- 8 files changed, 26 insertions(+), 25 deletions(-) (limited to 'spec/acceptance/beaker/git/branch_checkout') diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file.rb index 6ed945b..1fbdd1a 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file.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 "verify checkout is on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file_path.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file_path.rb index 441a2bc..efbedc7 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_file_path.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_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 "verify checkout is on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_git.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_git.rb index baeb5ec..8afa813 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_git.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_git.rb @@ -19,7 +19,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 'checkout a branch 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 checkout is on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_http.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_http.rb index 6da34e8..a8d622d 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_http.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_http.rb @@ -27,7 +27,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 'checkout a branch with puppet' do @@ -40,8 +40,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 on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_https.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_https.rb index 6ebd9fd..f6baf19 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_https.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_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 'checkout a branch 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 on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_scp.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_scp.rb index 0a4e07a..e55f805 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_scp.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_scp.rb @@ -14,17 +14,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 'checkout a branch with puppet' do @@ -37,8 +38,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 on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_ssh.rb b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_ssh.rb index ea9fb4a..6063bb9 100644 --- a/spec/acceptance/beaker/git/branch_checkout/branch_checkout_ssh.rb +++ b/spec/acceptance/beaker/git/branch_checkout/branch_checkout_ssh.rb @@ -14,17 +14,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 'checkout a branch with puppet' do @@ -37,8 +38,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 on the #{branch} branch" do diff --git a/spec/acceptance/beaker/git/branch_checkout/negative/branch_checkout_not_exists.rb b/spec/acceptance/beaker/git/branch_checkout/negative/branch_checkout_not_exists.rb index f8c85d0..e44ea7e 100644 --- a/spec/acceptance/beaker/git/branch_checkout/negative/branch_checkout_not_exists.rb +++ b/spec/acceptance/beaker/git/branch_checkout/negative/branch_checkout_not_exists.rb @@ -26,8 +26,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 that master branch is checked out' do -- cgit v1.2.3