From fc8c177fbbe0f3cecfb1f984725bf4cbcfbeb54d Mon Sep 17 00:00:00 2001 From: John Duarte Date: Tue, 6 May 2014 08:52:20 -0700 Subject: Move git daemon setup/teardown into context block In order to ensure that the git daemon is running for the proper test, the setup and teardown calls for git daemon hav been moved into the context block for testing the git protocol. --- spec/acceptance/git_clone_protocols_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/acceptance/git_clone_protocols_spec.rb b/spec/acceptance/git_clone_protocols_spec.rb index ec99629..77a1adb 100644 --- a/spec/acceptance/git_clone_protocols_spec.rb +++ b/spec/acceptance/git_clone_protocols_spec.rb @@ -29,8 +29,6 @@ hosts.each do |host| # copy ssl keys scp_to(host, "#{my_root}/acceptance/files/server.crt", tmpdir) scp_to(host, "#{my_root}/acceptance/files/server.key", tmpdir) - - host.execute("nohup git daemon --detach --base-path=/#{tmpdir}") # }}} end @@ -96,6 +94,7 @@ hosts.each do |host| context 'using git protocol' do before(:all) do on(host,apply_manifest("file {'#{tmpdir}/testrepo': ensure => directory, purge => true, recurse => true, recurselimit => 1, force => true; }")) + host.execute("nohup git daemon --detach --base-path=/#{tmpdir}") end it 'should have HEAD pointing to master' do @@ -115,6 +114,9 @@ hosts.each do |host| it { should contain 'ref: refs/heads/master' } end + after(:all) do + host.execute('pkill -9 git') + end end end -- cgit v1.2.3