Add beaker tests for git compression checkouts
authorJohn Duarte <john.duarte@puppetlabs.com>
Sat, 10 May 2014 17:12:55 +0000 (10:12 -0700)
committerJohn Duarte <john.duarte@puppetlabs.com>
Sun, 18 May 2014 18:38:19 +0000 (11:38 -0700)
12 files changed:
spec/acceptance/beaker/compression/compression_0_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_1_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_2_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_3_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_4_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_5_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/compression_6_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/negative/compression_7_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/negative/compression_alpha_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/negative/compression_eval_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/negative/compression_exec_checkout.rb [new file with mode: 0644]
spec/acceptance/beaker/compression/negative/compression_negative_checkout.rb [new file with mode: 0644]

diff --git a/spec/acceptance/beaker/compression/compression_0_checkout.rb b/spec/acceptance/beaker/compression/compression_0_checkout.rb
new file mode 100644 (file)
index 0000000..fc62d4a
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3495 - checkout with compression 0'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 0 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 0,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_1_checkout.rb b/spec/acceptance/beaker/compression/compression_1_checkout.rb
new file mode 100644 (file)
index 0000000..c1ec2f2
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3496 - checkout with compression 1'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 1 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 1,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_2_checkout.rb b/spec/acceptance/beaker/compression/compression_2_checkout.rb
new file mode 100644 (file)
index 0000000..c92a878
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3497 - checkout with compression 2'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 2 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 2,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_3_checkout.rb b/spec/acceptance/beaker/compression/compression_3_checkout.rb
new file mode 100644 (file)
index 0000000..8cba272
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3498 - checkout with compression 3'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 3 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 3,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_4_checkout.rb b/spec/acceptance/beaker/compression/compression_4_checkout.rb
new file mode 100644 (file)
index 0000000..c5c12a6
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3499 - checkout with compression 4'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 4 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 4,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_5_checkout.rb b/spec/acceptance/beaker/compression/compression_5_checkout.rb
new file mode 100644 (file)
index 0000000..474b62f
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3500 - checkout with compression 5'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 5 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 5,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/compression_6_checkout.rb b/spec/acceptance/beaker/compression/compression_6_checkout.rb
new file mode 100644 (file)
index 0000000..b3fb71b
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3501 - checkout with compression 6'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 6 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 6,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/negative/compression_7_checkout.rb b/spec/acceptance/beaker/compression/negative/compression_7_checkout.rb
new file mode 100644 (file)
index 0000000..b7af79a
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3503 - checkout with compression 7'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 7 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 7,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/negative/compression_alpha_checkout.rb b/spec/acceptance/beaker/compression/negative/compression_alpha_checkout.rb
new file mode 100644 (file)
index 0000000..06a0a01
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3505 - checkout with compression alpha'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression alpha with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => abcde,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/negative/compression_eval_checkout.rb b/spec/acceptance/beaker/compression/negative/compression_eval_checkout.rb
new file mode 100644 (file)
index 0000000..d66996e
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3504 - checkout with compression 10-5'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression 10-5 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => 10-5,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/negative/compression_exec_checkout.rb b/spec/acceptance/beaker/compression/negative/compression_exec_checkout.rb
new file mode 100644 (file)
index 0000000..46e730d
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3506 - checkout with compression exec'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression exec with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => `exec rm -rf /tmp`,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end
diff --git a/spec/acceptance/beaker/compression/negative/compression_negative_checkout.rb b/spec/acceptance/beaker/compression/negative/compression_negative_checkout.rb
new file mode 100644 (file)
index 0000000..ee98057
--- /dev/null
@@ -0,0 +1,39 @@
+test_name 'C3502 - checkout with compression -1'
+
+# Globals
+repo_name = 'testrepo_checkout'
+
+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 'checkout with compression -1 with puppet' do
+    pp = <<-EOS
+    vcsrepo { "#{tmpdir}/#{repo_name}":
+      ensure => present,
+      source => "file://#{tmpdir}/testrepo.git",
+      provider => git,
+      compression => -1,
+    }
+    EOS
+
+    apply_manifest_on(host, pp)
+    apply_manifest_on(host, pp)
+  end
+
+  step 'verify git repo was checked out' do
+    on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+      fail_test('checkout not found') unless res.stdout.include? "HEAD"
+    end
+  end
+
+end