| 1 |
test_name 'C3472 - create bare repo that already exists' |
| 2 |
|
| 3 |
# Globals |
| 4 |
repo_name = 'testrepo_bare_repo_already_exists.git' |
| 5 |
|
| 6 |
hosts.each do |host| |
| 7 |
tmpdir = host.tmpdir('vcsrepo') |
| 8 |
step 'setup - create bare repo' do |
| 9 |
git_pkg = 'git' |
| 10 |
if host['platform'] =~ /ubuntu-10/ |
| 11 |
git_pkg = 'git-core' |
| 12 |
end |
| 13 |
install_package(host, git_pkg) |
| 14 |
on(host, "mkdir #{tmpdir}/#{repo_name}") |
| 15 |
on(host, "cd #{tmpdir}/#{repo_name} && git --bare init") |
| 16 |
end |
| 17 |
|
| 18 |
teardown do |
| 19 |
on(host, "rm -fr #{tmpdir}") |
| 20 |
end |
| 21 |
|
| 22 |
step 'create bare repo that already exists using puppet' do |
| 23 |
pp = <<-EOS |
| 24 |
vcsrepo { "#{tmpdir}/#{repo_name}": |
| 25 |
ensure => bare, |
| 26 |
provider => git, |
| 27 |
} |
| 28 |
EOS |
| 29 |
|
| 30 |
apply_manifest_on(host, pp, :catch_failures => true) |
| 31 |
apply_manifest_on(host, pp, :catch_changes => true) |
| 32 |
end |
| 33 |
|
| 34 |
step 'verify repo does not contain .git directory' do |
| 35 |
on(host, "ls -al #{tmpdir}/#{repo_name}") do |res| |
| 36 |
fail_test "found .git for #{repo_name}" if res.stdout.include? ".git" |
| 37 |
end |
| 38 |
end |
| 39 |
|
| 40 |
end |