Imported puppetlabs-vcsrepo
This commit is contained in:
parent
0938a13fe6
commit
18d9aa4a23
152 changed files with 9191 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
test_name 'C3472 - create bare repo that already exists'
|
||||
|
||||
# Globals
|
||||
repo_name = 'testrepo_bare_repo_already_exists.git'
|
||||
|
||||
hosts.each do |host|
|
||||
tmpdir = host.tmpdir('vcsrepo')
|
||||
step 'setup - create bare repo' do
|
||||
git_pkg = 'git'
|
||||
if host['platform'] =~ /ubuntu-10/
|
||||
git_pkg = 'git-core'
|
||||
end
|
||||
install_package(host, git_pkg)
|
||||
on(host, "mkdir #{tmpdir}/#{repo_name}")
|
||||
on(host, "cd #{tmpdir}/#{repo_name} && git --bare init")
|
||||
end
|
||||
|
||||
teardown do
|
||||
on(host, "rm -fr #{tmpdir}")
|
||||
end
|
||||
|
||||
step 'create bare repo that already exists using puppet' do
|
||||
pp = <<-EOS
|
||||
vcsrepo { "#{tmpdir}/#{repo_name}":
|
||||
ensure => bare,
|
||||
provider => git,
|
||||
}
|
||||
EOS
|
||||
|
||||
apply_manifest_on(host, pp, :catch_failures => true)
|
||||
apply_manifest_on(host, pp, :catch_changes => true)
|
||||
end
|
||||
|
||||
step 'verify repo does not contain .git directory' do
|
||||
on(host, "ls -al #{tmpdir}/#{repo_name}") do |res|
|
||||
fail_test "found .git for #{repo_name}" if res.stdout.include? ".git"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,42 @@
|
|||
test_name 'C3470 - create repo that already exists'
|
||||
|
||||
# Globals
|
||||
repo_name = 'testrepo_already_exists'
|
||||
|
||||
hosts.each do |host|
|
||||
tmpdir = host.tmpdir('vcsrepo')
|
||||
step 'setup - create repo' do
|
||||
git_pkg = 'git'
|
||||
if host['platform'] =~ /ubuntu-10/
|
||||
git_pkg = 'git-core'
|
||||
end
|
||||
install_package(host, git_pkg)
|
||||
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")
|
||||
on(host, "cd #{tmpdir} && git clone file://#{tmpdir}/testrepo.git #{repo_name}")
|
||||
end
|
||||
|
||||
teardown do
|
||||
on(host, "rm -fr #{tmpdir}")
|
||||
end
|
||||
|
||||
step 'create repo that already exists using puppet' do
|
||||
pp = <<-EOS
|
||||
vcsrepo { "#{tmpdir}/#{repo_name}":
|
||||
ensure => present,
|
||||
provider => git,
|
||||
}
|
||||
EOS
|
||||
|
||||
apply_manifest_on(host, pp, :catch_failures => true)
|
||||
apply_manifest_on(host, pp, :catch_changes => true)
|
||||
end
|
||||
|
||||
step 'verify repo is on master branch' do
|
||||
on(host, "cat #{tmpdir}/#{repo_name}/.git/HEAD") do |res|
|
||||
assert_match(/ref: refs\/heads\/master/, stdout, "Git checkout not on master on #{host}")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,38 @@
|
|||
test_name 'C3473 - create bare repo specifying revision'
|
||||
|
||||
# Globals
|
||||
repo_name = 'testrepo_bare.git'
|
||||
|
||||
hosts.each do |host|
|
||||
tmpdir = host.tmpdir('vcsrepo')
|
||||
step 'setup' do
|
||||
git_pkg = 'git'
|
||||
if host['platform'] =~ /ubuntu-10/
|
||||
git_pkg = 'git-core'
|
||||
end
|
||||
install_package(host, git_pkg)
|
||||
end
|
||||
|
||||
teardown do
|
||||
on(host, "rm -fr #{tmpdir}")
|
||||
end
|
||||
|
||||
step 'create bare repo specifying revision using puppet' do
|
||||
pp = <<-EOS
|
||||
vcsrepo { "#{tmpdir}/#{repo_name}":
|
||||
ensure => bare,
|
||||
revision => master,
|
||||
provider => git,
|
||||
}
|
||||
EOS
|
||||
|
||||
apply_manifest_on(host, pp, :expect_failures => true)
|
||||
end
|
||||
|
||||
step 'verify repo does not contain .git directory' do
|
||||
on(host, "ls -al #{tmpdir}") do |res|
|
||||
fail_test "found repo for #{repo_name}" if res.stdout.include? repo_name
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue