Add check for git-http-backend

This allows for more graceful test failures when the libexec dir is
different from what the test class determines it should be.
This commit is contained in:
Erik Johnson 2017-05-03 15:16:16 -05:00
parent 33515f6a14
commit a94d081004
2 changed files with 17 additions and 4 deletions

View File

@ -1,6 +1,6 @@
uwsgi:
socket: 127.0.0.1:{{ pillar['git_pillar']['uwsgi_port'] }}
cgi: {{ salt['pillar.get']('git_pillar:libexec_dir', '/usr/libexec') }}/git-core/git-http-backend
cgi: {{ pillar['git_pillar']['git-http-backend'] }}
chdir: %d
daemonize: {{ pillar['git_pillar']['config_dir'] }}/uwsgi.log
pidfile: {{ pillar['git_pillar']['config_dir'] }}/uwsgi.pid

View File

@ -210,15 +210,28 @@ class WebserverMixin(ModuleCase, ProcessManager, SaltReturnAssertsMixin):
'uwsgi_port': self.uwsgi_port,
'auth_enabled': auth_enabled}}
if grains['os_family'] in ('Debian', 'Arch'):
# Different libexec dir for git backend on Debian-based systems
pillar['git_pillar']['libexec_dir'] = '/usr/lib'
# Different libexec dir for git backend on Debian-based systems
git_core = '/usr/libexec/git-core' \
if grains['os_family'] in ('RedHat') \
else '/usr/lib/git-core'
pillar['git_pillar']['git-http-backend'] = os.path.join(
git_core,
'git-http-backend')
ret = self.run_function(
'state.apply',
mods='git_pillar.http',
pillar=pillar)
if not os.path.exists(pillar['git_pillar']['git-http-backend']):
self.fail(
'{0} not found. Either git is not installed, or the test '
'class needs to be updated.'.format(
pillar['git_pillar']['git-http-backend']
)
)
try:
self.nginx_proc = self.wait_proc(name='nginx',
search=self.nginx_conf)