Skip to content

Commit

Permalink
Merge pull request #8074 from tchaikov/wip-ceph-detect-init-test
Browse files Browse the repository at this point in the history
ceph-detect-init: add debian/jessie test

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Mar 13, 2016
2 parents 1d685bb + 7c62ddf commit e530ade
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/ceph-detect-init/ceph_detect_init/debian/__init__.py
Expand Up @@ -14,9 +14,8 @@ def choose_init():
return 'systemd'
else:
return 'upstart'
if distro.lower() in ('debian'):
if distro.lower() == 'debian':
if codename in ('squeeze', 'wheezy'):
return 'sysvinit'
else:
return 'systemd'
return 'sysvinit'
8 changes: 8 additions & 0 deletions src/ceph-detect-init/tests/test_all.py
Expand Up @@ -48,6 +48,10 @@ def test_debian(self):
distro='debian',
codename='wheezy'):
self.assertEqual('sysvinit', debian.choose_init())
with mock.patch.multiple('ceph_detect_init.debian',
distro='debian',
codename='jessie'):
self.assertEqual('systemd', debian.choose_init())
with mock.patch.multiple('ceph_detect_init.debian',
distro='ubuntu',
codename='trusty'):
Expand All @@ -56,6 +60,10 @@ def test_debian(self):
distro='ubuntu',
codename='vivid'):
self.assertEqual('systemd', debian.choose_init())
with mock.patch.multiple('ceph_detect_init.debian',
distro='not-debian',
codename='andy'):
self.assertIs(None, debian.choose_init())

def test_fedora(self):
with mock.patch('ceph_detect_init.fedora.release',
Expand Down

0 comments on commit e530ade

Please sign in to comment.