summaryrefslogtreecommitdiff
path: root/spec/acceptance/beaker/git/create/negative/create_bare_repo_specifying_revision.rb
blob: 5b789df1435ff64f25feea6306ee615a2f1b170e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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