From 591725e0f2a0dd0dd31b0086dbd4068bd302b0e1 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Sat, 10 May 2014 21:13:03 -0700 Subject: Move git tests into sub-directory --- .../negative/shallow_clone_hostile_depth.rb | 39 ++++++++++++++ .../negative/shallow_clone_negative_depth.rb | 39 ++++++++++++++ .../negative/shallow_clone_overflow_depth.rb | 39 ++++++++++++++ .../beaker/git/shallow_clone/shallow_clone_file.rb | 43 +++++++++++++++ .../git/shallow_clone/shallow_clone_file_path.rb | 43 +++++++++++++++ .../beaker/git/shallow_clone/shallow_clone_git.rb | 48 +++++++++++++++++ .../beaker/git/shallow_clone/shallow_clone_http.rb | 55 +++++++++++++++++++ .../git/shallow_clone/shallow_clone_https.rb | 62 ++++++++++++++++++++++ .../beaker/git/shallow_clone/shallow_clone_ssh.rb | 53 ++++++++++++++++++ .../git/shallow_clone/shallow_clone_zero_depth.rb | 39 ++++++++++++++ 10 files changed, 460 insertions(+) create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb (limited to 'spec/acceptance/beaker/git/shallow_clone') diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb new file mode 100644 index 0000000..0a4b467 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb @@ -0,0 +1,39 @@ +test_name 'C3608 - shallow clone repo depth hostile input' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => 'rm -rf /tmp', + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is NOT shallow' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') if res.stdout.include? "shallow" + end + end + +end 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 new file mode 100644 index 0000000..2ba1f0f --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_negative_depth.rb @@ -0,0 +1,39 @@ +test_name 'C3607 - shallow clone repo depth = -1' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => -1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is NOT shallow' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') if res.stdout.include? "shallow" + end + end + +end 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 new file mode 100644 index 0000000..55ff878 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb @@ -0,0 +1,39 @@ +test_name 'C3606 - shallow clone repo depth overflow 64bit integer' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => 18446744073709551616, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is NOT shallow' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') if res.stdout.include? "shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb new file mode 100644 index 0000000..52eb3d2 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb @@ -0,0 +1,43 @@ +test_name 'C3476 - shallow clone repo minimal depth = 1 (file protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb new file mode 100644 index 0000000..d9d18ce --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb @@ -0,0 +1,43 @@ +test_name 'C3475 - shallow clone repo minimal depth = 1 (file path protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "#{tmpdir}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb new file mode 100644 index 0000000..8b3a16a --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -0,0 +1,48 @@ +test_name 'C3474 - shallow clone repo minimal depth = 1 (git protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + step 'setup - start git daemon' do + install_package(host, 'git-daemon') + on(host, "nohup git daemon --detach --base-path=/#{tmpdir}") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + on(host, 'pkill -9 git-daemon') + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "git://#{host}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb new file mode 100644 index 0000000..ad7e30e --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb @@ -0,0 +1,55 @@ +test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + step 'setup - start http server' do + http_daemon =<<-EOF + require 'webrick' + server = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => "#{tmpdir}") + WEBrick::Daemon.start + server.start + EOF + create_remote_file(host, '/tmp/http_daemon.rb', http_daemon) + on(host, "ruby /tmp/http_daemon.rb") + 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') + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "http://#{host}:8000/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb new file mode 100644 index 0000000..e016e55 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -0,0 +1,62 @@ +test_name 'C3480 - shallow clone repo minimal depth = 1 (https protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + step 'setup - start https server' do + https_daemon =<<-EOF + require 'webrick' + require 'webrick/https' + server = WEBrick::HTTPServer.new( + :Port => 8443, + :DocumentRoot => "#{tmpdir}", + :SSLEnable => true, + :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE, + :SSLCertificate => OpenSSL::X509::Certificate.new( File.open("#{tmpdir}/server.crt").read), + :SSLPrivateKey => OpenSSL::PKey::RSA.new( File.open("#{tmpdir}/server.key").read), + :SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ]) + WEBrick::Daemon.start + server.start + EOF + create_remote_file(host, '/tmp/https_daemon.rb', https_daemon) + #on(host, "ruby /tmp/https_daemon.rb") + 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') + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "https://github.com/johnduarte/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb new file mode 100644 index 0000000..fda9bf4 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb @@ -0,0 +1,53 @@ +test_name 'C3477 - shallow clone repo minimal depth = 1 (ssh protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + step 'setup - establish ssh keys' do + # create ssh keys + on(host, 'ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""') + + # copy public key to 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 }") + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "ssh://root@#{host}#{tmpdir}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end 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 new file mode 100644 index 0000000..6cec2a1 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb @@ -0,0 +1,39 @@ +test_name 'C3404 - shallow clone repo depth = 0 non shallow' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet (zero depth means not shallow)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => 0, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is NOT shallow' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow found') if res.stdout.include? "shallow" + end + end + +end -- cgit v1.2.3 From 4040e4a1cccc72692c00d5efc06f8e8d5e1174f1 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Sun, 11 May 2014 12:00:21 -0700 Subject: Update expectations for shallow clone --- .../negative/shallow_clone_file_path.rb | 39 +++++++++++++++ .../shallow_clone/negative/shallow_clone_http.rb | 51 ++++++++++++++++++++ .../git/shallow_clone/shallow_clone_file_path.rb | 43 ----------------- .../beaker/git/shallow_clone/shallow_clone_http.rb | 55 ---------------------- 4 files changed, 90 insertions(+), 98 deletions(-) create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb delete mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb delete mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 new file mode 100644 index 0000000..9cebe45 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_file_path.rb @@ -0,0 +1,39 @@ +test_name 'C3475 - shallow clone repo minimal depth = 1 (file path protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "#{tmpdir}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'git does not support shallow clone via file path: verify checkout is NOT created' do + on(host, "ls #{tmpdir}") do |res| + fail_test('checkout found') if res.stdout.include? "#{repo_name}" + end + end + +end 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 new file mode 100644 index 0000000..f80239b --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb @@ -0,0 +1,51 @@ +test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + step 'setup - start http server' do + http_daemon =<<-EOF + require 'webrick' + server = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => "#{tmpdir}") + WEBrick::Daemon.start + server.start + EOF + create_remote_file(host, '/tmp/http_daemon.rb', http_daemon) + on(host, "ruby /tmp/http_daemon.rb") + 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') + end + + step 'shallow clone repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "http://#{host}:8000/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'git does not support shallow clone via HTTP: verify checkout is NOT created' do + on(host, "ls #{tmpdir}") do |res| + fail_test('checkout found') if res.stdout.include? "#{repo_name}" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb deleted file mode 100644 index d9d18ce..0000000 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file_path.rb +++ /dev/null @@ -1,43 +0,0 @@ -test_name 'C3475 - shallow clone repo minimal depth = 1 (file path protocol)' - -# Globals -repo_name = 'testrepo_shallow_clone' - -hosts.each do |host| - tmpdir = host.tmpdir('vcsrepo') - step 'setup - create repo' do - install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) - scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) - on(host, "cd #{tmpdir} && ./create_git_repo.sh") - end - - teardown do - on(host, "rm -fr #{tmpdir}") - end - - step 'shallow clone repo with puppet' do - pp = <<-EOS - vcsrepo { "#{tmpdir}/#{repo_name}": - ensure => present, - source => "#{tmpdir}/testrepo.git", - provider => git, - depth => 1, - } - EOS - - apply_manifest_on(host, pp) - apply_manifest_on(host, pp) - end - - step 'verify checkout is shallow and of the correct depth' do - on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| - fail_test('shallow not found') unless res.stdout.include? "shallow" - end - - on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" - end - end - -end diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb deleted file mode 100644 index ad7e30e..0000000 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_http.rb +++ /dev/null @@ -1,55 +0,0 @@ -test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)' - -# Globals -repo_name = 'testrepo_shallow_clone' - -hosts.each do |host| - tmpdir = host.tmpdir('vcsrepo') - step 'setup - create repo' do - install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) - scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) - on(host, "cd #{tmpdir} && ./create_git_repo.sh") - end - - step 'setup - start http server' do - http_daemon =<<-EOF - require 'webrick' - server = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => "#{tmpdir}") - WEBrick::Daemon.start - server.start - EOF - create_remote_file(host, '/tmp/http_daemon.rb', http_daemon) - on(host, "ruby /tmp/http_daemon.rb") - 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') - end - - step 'shallow clone repo with puppet' do - pp = <<-EOS - vcsrepo { "#{tmpdir}/#{repo_name}": - ensure => present, - source => "http://#{host}:8000/testrepo.git", - provider => git, - depth => 1, - } - EOS - - apply_manifest_on(host, pp) - apply_manifest_on(host, pp) - end - - step 'verify checkout is shallow and of the correct depth' do - on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| - fail_test('shallow not found') unless res.stdout.include? "shallow" - end - - on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" - end - end - -end -- cgit v1.2.3 From 93a410c9ad3d8b3cb8da1ce79040cd00475fceaf Mon Sep 17 00:00:00 2001 From: John Duarte Date: Mon, 12 May 2014 10:39:37 -0700 Subject: Add tests git using ssh scp syntax --- .../beaker/git/shallow_clone/shallow_clone_scp.rb | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb (limited to 'spec/acceptance/beaker/git/shallow_clone') diff --git a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb new file mode 100644 index 0000000..6837802 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb @@ -0,0 +1,53 @@ +test_name 'C3478 - shallow clone repo minimal depth = 1 (ssh protocol, scp syntax)' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + step 'setup - establish ssh keys' do + # create ssh keys + on(host, 'ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""') + + # copy public key to 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 }") + end + + step 'shallow clone repo with puppet (scp syntax)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "root@#{host}:#{tmpdir}/testrepo.git", + provider => git, + depth => 1, + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is shallow and of the correct depth' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') unless res.stdout.include? "shallow" + end + + on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| + fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + end + end + +end -- cgit v1.2.3 From 8d0d19cc6d7d684b526ddc00172ca1db65207073 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Mon, 12 May 2014 11:02:15 -0700 Subject: Fix root path depth for negative shallow tests --- .../beaker/git/shallow_clone/negative/shallow_clone_file_path.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 9cebe45..a2565db 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 @@ -7,7 +7,7 @@ hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") end 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 f80239b..a67ec00 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 @@ -7,7 +7,7 @@ hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") end -- cgit v1.2.3 From b362b35825638c27a7a19da97bd14bc9d7e133b4 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Mon, 12 May 2014 11:24:16 -0700 Subject: Fix exec test for shallow clone --- .../negative/shallow_clone_exec_depth.rb | 39 ++++++++++++++++++++++ .../negative/shallow_clone_hostile_depth.rb | 39 ---------------------- 2 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb delete mode 100644 spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb (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 new file mode 100644 index 0000000..caef5a6 --- /dev/null +++ b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb @@ -0,0 +1,39 @@ +test_name 'C3608 - shallow clone repo depth hostile input' + +# Globals +repo_name = 'testrepo_shallow_clone' + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + depth => "exec 'rm -rf /tmp'", + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify checkout is NOT shallow' do + on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| + fail_test('shallow not found') if res.stdout.include? "shallow" + end + end + +end diff --git a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb b/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb deleted file mode 100644 index 0a4b467..0000000 --- a/spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_hostile_depth.rb +++ /dev/null @@ -1,39 +0,0 @@ -test_name 'C3608 - shallow clone repo depth hostile input' - -# Globals -repo_name = 'testrepo_shallow_clone' - -hosts.each do |host| - tmpdir = host.tmpdir('vcsrepo') - step 'setup - create repo' do - install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) - scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) - on(host, "cd #{tmpdir} && ./create_git_repo.sh") - end - - teardown do - on(host, "rm -fr #{tmpdir}") - end - - step 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do - pp = <<-EOS - vcsrepo { "#{tmpdir}/#{repo_name}": - ensure => present, - source => "file://#{tmpdir}/testrepo.git", - provider => git, - depth => 'rm -rf /tmp', - } - EOS - - apply_manifest_on(host, pp) - apply_manifest_on(host, pp) - end - - step 'verify checkout is NOT shallow' do - on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res| - fail_test('shallow not found') if res.stdout.include? "shallow" - end - end - -end -- cgit v1.2.3 From 97e64b52f63f3dd673dfa2fe92c71d4d9ddbcbc7 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Thu, 15 May 2014 11:43:29 -0700 Subject: Add conditional ruby path based on pe --- .../beaker/git/shallow_clone/negative/shallow_clone_http.rb | 5 +++-- spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 a67ec00..4c43be1 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 @@ -4,6 +4,7 @@ test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)' repo_name = 'testrepo_shallow_clone' hosts.each do |host| + ruby = '/opt/puppet/bin/ruby' if host.is_pe? || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') @@ -20,12 +21,12 @@ hosts.each do |host| server.start EOF create_remote_file(host, '/tmp/http_daemon.rb', http_daemon) - on(host, "ruby /tmp/http_daemon.rb") + on(host, "#{ruby} /tmp/http_daemon.rb") 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') + on(host, 'ps ax | grep "#{ruby} /tmp/http_daemon.rb" | grep -v grep | awk \'{print "kill -9 " $1}\' | sh') end step 'shallow clone repo with puppet' 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 e016e55..1a34521 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -4,6 +4,7 @@ test_name 'C3480 - shallow clone repo minimal depth = 1 (https protocol)' repo_name = 'testrepo_shallow_clone' hosts.each do |host| + ruby = '/opt/puppet/bin/ruby' if host.is_pe? || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') @@ -27,12 +28,12 @@ hosts.each do |host| server.start EOF create_remote_file(host, '/tmp/https_daemon.rb', https_daemon) - #on(host, "ruby /tmp/https_daemon.rb") + #on(host, "#{ruby} /tmp/https_daemon.rb") 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') + on(host, 'ps ax | grep "#{ruby} /tmp/https_daemon.rb" | grep -v grep | awk \'{print "kill -9 " $1}\' | sh') end step 'shallow clone repo with puppet' do -- cgit v1.2.3 From 0406d627bcd7e24d181944b4d2c70a7b6e50ccf5 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Fri, 16 May 2014 14:58:17 -0700 Subject: Fix calls to ruby --- spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_http.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 4c43be1..ecd51ad 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 @@ -4,7 +4,7 @@ test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)' repo_name = 'testrepo_shallow_clone' hosts.each do |host| - ruby = '/opt/puppet/bin/ruby' if host.is_pe? || 'ruby' + ruby = (host.is_pe? && '/opt/puppet/bin/ruby') || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') 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 1a34521..6254865 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -4,7 +4,7 @@ test_name 'C3480 - shallow clone repo minimal depth = 1 (https protocol)' repo_name = 'testrepo_shallow_clone' hosts.each do |host| - ruby = '/opt/puppet/bin/ruby' if host.is_pe? || 'ruby' + ruby = (host.is_pe? && '/opt/puppet/bin/ruby') || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do install_package(host, 'git') -- cgit v1.2.3 From a50c949a695e04a0b5927d816c3e25ba46745c19 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Fri, 16 May 2014 14:59:19 -0700 Subject: Skip tests for unsupported features --- .../beaker/git/shallow_clone/negative/shallow_clone_file_path.rb | 1 + spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 a2565db..c336842 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 @@ -1,4 +1,5 @@ test_name 'C3475 - shallow clone repo minimal depth = 1 (file path protocol)' +skip_test 'Not currently supported. See FM-1285' # Globals repo_name = 'testrepo_shallow_clone' 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 6254865..9220e27 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -1,4 +1,5 @@ test_name 'C3480 - shallow clone repo minimal depth = 1 (https protocol)' +skip_test 'Not currently supported. See FM-1286' # Globals repo_name = 'testrepo_shallow_clone' -- cgit v1.2.3 From e42f4047c086a79fa0286dc9e46cdfe187a18320 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Sun, 18 May 2014 17:26:20 -0700 Subject: Fix git daemon call --- spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 8b3a16a..d7c81fb 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -13,7 +13,7 @@ hosts.each do |host| end step 'setup - start git daemon' do install_package(host, 'git-daemon') - on(host, "nohup git daemon --detach --base-path=/#{tmpdir}") + on(host, "git daemon --base-path=#{tmpdir} --export-all --reuseaddr --verbose --detach") end teardown do -- cgit v1.2.3 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 From bef473f1424a4d798bae5cf7b2afbb694aa793c5 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Mon, 16 Jun 2014 11:31:13 -0700 Subject: Correct shallow clone count The manifest is set to clone at a depth of 1, but checks for a shallow depth of 2. It should either checkout a depth of 2, or only check for a depth of 1. This commit makes it check for a depth of 1 --- spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb | 2 +- spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 f54f1ab..e68bbd4 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb @@ -36,7 +36,7 @@ hosts.each do |host| end on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + fail_test('shallow not found') unless res.stdout.include? "1 #{tmpdir}/#{repo_name}/.git/shallow" end end 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 ab3bd07..b83f4ea 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -41,7 +41,7 @@ hosts.each do |host| end on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + fail_test('shallow not found') unless res.stdout.include? "1 #{tmpdir}/#{repo_name}/.git/shallow" end end 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 93a328c..c045018 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -57,7 +57,7 @@ hosts.each do |host| end on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + fail_test('shallow not found') unless res.stdout.include? "1 #{tmpdir}/#{repo_name}/.git/shallow" end end 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 ddef4e7..1201710 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb @@ -47,7 +47,7 @@ hosts.each do |host| end on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + fail_test('shallow not found') unless res.stdout.include? "1 #{tmpdir}/#{repo_name}/.git/shallow" end end 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 da5528c..76f2a46 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb @@ -47,7 +47,7 @@ hosts.each do |host| end on(host, "wc -l #{tmpdir}/#{repo_name}/.git/shallow") do |res| - fail_test('shallow not found') unless res.stdout.include? "2 #{tmpdir}/#{repo_name}/.git/shallow" + fail_test('shallow not found') unless res.stdout.include? "1 #{tmpdir}/#{repo_name}/.git/shallow" end end -- cgit v1.2.3 From 47b32a8d380beb48e0ea85be904c48da0405e982 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Sat, 14 Jun 2014 08:02:45 -0700 Subject: Change tests to not install git-daemon on debian The git-daemon is not a valid package on debian based systems. Update tests to not try installing git-daemon on debian systems. --- spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 b83f4ea..3ceb58e 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -12,7 +12,7 @@ hosts.each do |host| on(host, "cd #{tmpdir} && ./create_git_repo.sh") end step 'setup - start git daemon' do - install_package(host, 'git-daemon') + install_package(host, 'git-daemon') unless host['platform'] =~ /debian|ubuntu/ on(host, "git daemon --base-path=#{tmpdir} --export-all --reuseaddr --verbose --detach") end -- cgit v1.2.3 From e6a561125b6477051c339d5dfce909e4318f504c Mon Sep 17 00:00:00 2001 From: John Duarte Date: Sat, 14 Jun 2014 11:57:07 -0700 Subject: Accomodate ubuntu-10 package for git in beaker tests Add conditional to install `git-core` if the platform under test is ubuntu-10. The `git` package is not available for this platform. --- .../beaker/git/shallow_clone/negative/shallow_clone_exec_depth.rb | 6 +++++- .../beaker/git/shallow_clone/negative/shallow_clone_file_path.rb | 6 +++++- .../beaker/git/shallow_clone/negative/shallow_clone_http.rb | 6 +++++- .../git/shallow_clone/negative/shallow_clone_negative_depth.rb | 6 +++++- .../git/shallow_clone/negative/shallow_clone_overflow_depth.rb | 6 +++++- spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb | 6 +++++- spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb | 6 +++++- spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb | 6 +++++- spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb | 6 +++++- spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb | 6 +++++- .../acceptance/beaker/git/shallow_clone/shallow_clone_zero_depth.rb | 6 +++++- 11 files changed, 55 insertions(+), 11 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 d82e3c6..f01a488 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 @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 961d0fe..47fb338 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 @@ -7,7 +7,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 956d7de..723a0b6 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 @@ -7,7 +7,11 @@ hosts.each do |host| ruby = (host.is_pe? && '/opt/puppet/bin/ruby') || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 c80faa0..869620d 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 @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 fdf4977..a40a204 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 @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 e68bbd4..9e2abe2 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_file.rb @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 3ceb58e..49683d2 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_git.rb @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 c045018..2392728 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_https.rb @@ -8,7 +8,11 @@ hosts.each do |host| ruby = (host.is_pe? && '/opt/puppet/bin/ruby') || 'ruby' tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 1201710..1d5b35a 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_scp.rb @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 76f2a46..0f00b30 100644 --- a/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb +++ b/spec/acceptance/beaker/git/shallow_clone/shallow_clone_ssh.rb @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") 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 eb8b121..34c624f 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 @@ -6,7 +6,11 @@ repo_name = 'testrepo_shallow_clone' hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do - install_package(host, 'git') + git_pkg = 'git' + if host['platform'] =~ /ubuntu-10/ + git_pkg = 'git-core' + end + install_package(host, git_pkg) my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) on(host, "cd #{tmpdir} && ./create_git_repo.sh") -- cgit v1.2.3 From 7867045623b1308aa6c64812976beac2558f14b8 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Wed, 18 Jun 2014 09:43:59 -0700 Subject: Pending overflow depth test This test is pending as git cannot handle the overflow correctly, though vcsrepo handles it fine. --- .../beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec/acceptance/beaker/git/shallow_clone') 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 a40a204..5da9fd7 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 @@ -3,6 +3,8 @@ test_name 'C3606 - shallow clone repo depth overflow 64bit integer' # Globals repo_name = 'testrepo_shallow_clone' +pending_test("The overflow can't be handled on some git versions") + hosts.each do |host| tmpdir = host.tmpdir('vcsrepo') step 'setup - create repo' do -- cgit v1.2.3