1 test_name 'C3445 - checkout a tag (file protocol)'
4 repo_name = 'testrepo_tag_checkout'
8 tmpdir = host.tmpdir('vcsrepo')
9 step 'setup - create repo' do
10 install_package(host, 'git')
11 my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
12 scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir)
13 on(host, "cd #{tmpdir} && ./create_git_repo.sh")
17 on(host, "rm -fr #{tmpdir}")
20 step 'checkout a tag with puppet' do
22 vcsrepo { "#{tmpdir}/#{repo_name}":
24 source => "file://#{tmpdir}/testrepo.git",
30 apply_manifest_on(host, pp, :catch_failures => true)
31 apply_manifest_on(host, pp, :catch_changes => true)
34 step "verify checkout out tag is #{tag}" do
35 on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
36 fail_test('checkout not found') unless res.stdout.include? "HEAD"
39 on(host,"git --git-dir=#{tmpdir}/#{repo_name}/.git name-rev HEAD") do |res|
40 fail_test('tag not found') unless res.stdout.include? "#{tag}"