summaryrefslogtreecommitdiff
path: root/spec/acceptance/beaker/git/clone/clone_file_path.rb
diff options
context:
space:
mode:
authorJohn Duarte <john.duarte@puppetlabs.com>2014-05-19 11:53:54 -0700
committerJohn Duarte <john.duarte@puppetlabs.com>2014-05-19 11:53:54 -0700
commitd6b22213f2cea9b58d5e2fa48f4fea2227c184ef (patch)
tree95bf2b79f6f3c15189726f256028d88deff04bc5 /spec/acceptance/beaker/git/clone/clone_file_path.rb
parent97e8b02b1d803d59f02a8fea1b86750694b5d538 (diff)
Move protocol tests to beaker suite
The protocol tests are more closely aligned with the rest of the beaker test suite. The beaker tests have received more vetting, so the setup and teardown process should be less prone to failure on repeated execution.
Diffstat (limited to 'spec/acceptance/beaker/git/clone/clone_file_path.rb')
-rw-r--r--spec/acceptance/beaker/git/clone/clone_file_path.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/acceptance/beaker/git/clone/clone_file_path.rb b/spec/acceptance/beaker/git/clone/clone_file_path.rb
new file mode 100644
index 0000000..b76e9b9
--- /dev/null
+++ b/spec/acceptance/beaker/git/clone/clone_file_path.rb
@@ -0,0 +1,42 @@
+test_name 'C3426 - clone (file path)'
+
+# Globals
+repo_name = 'testrepo_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 'clone with puppet' do
+ pp = <<-EOS
+ vcsrepo { "#{tmpdir}/#{repo_name}":
+ ensure => present,
+ source => "#{tmpdir}/testrepo.git",
+ provider => git,
+ }
+ EOS
+
+ apply_manifest_on(host, pp)
+ apply_manifest_on(host, pp)
+ end
+
+ step "verify checkout is on the master branch" do
+ on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
+ fail_test('checkout not found') unless res.stdout.include? "HEAD"
+ end
+
+ on(host, "cat #{tmpdir}/#{repo_name}/.git/HEAD") do |res|
+ fail_test('master not found') unless res.stdout.include? "ref: refs/heads/master"
+ end
+ end
+
+end