1 test_name 'C3425 - clone (git protocol)'
4 repo_name = 'testrepo_clone'
7 tmpdir = host.tmpdir('vcsrepo')
8 step 'setup - create repo' do
9 install_package(host, 'git')
10 my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
11 scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir)
12 on(host, "cd #{tmpdir} && ./create_git_repo.sh")
14 step 'setup - start git daemon' do
15 install_package(host, 'git-daemon')
16 on(host, "git daemon --base-path=#{tmpdir} --export-all --reuseaddr --verbose --detach")
20 on(host, "rm -fr #{tmpdir}")
21 on(host, 'pkill -9 git-daemon')
24 step 'clone with puppet' do
26 vcsrepo { "#{tmpdir}/#{repo_name}":
28 source => "git://#{host}/testrepo.git",
33 apply_manifest_on(host, pp)
34 apply_manifest_on(host, pp)
37 step "verify checkout is on the master branch" do
38 on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
39 fail_test('checkout not found') unless res.stdout.include? "HEAD"
42 on(host, "cat #{tmpdir}/#{repo_name}/.git/HEAD") do |res|
43 fail_test('master not found') unless res.stdout.include? "ref: refs/heads/master"