Skip to content

Commit

Permalink
ceph-detect-init: Add tests for Virtuozzo Linux support
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Parfenov <[email protected]>
  • Loading branch information
Andrey Parfenov committed Apr 3, 2017
1 parent 1997ce4 commit cbde5f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ceph-detect-init/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def test_get_distro(self):
self.assertEqual(suse, g('suse'))
self.assertEqual(rhel, g('redhat', use_rhceph=True))
self.assertEqual(gentoo, g('gentoo'))
self.assertEqual(centos, g('virtuozzo'))

def test_normalized_distro_name(self):
n = ceph_detect_init._normalized_distro_name
Expand Down Expand Up @@ -246,6 +247,7 @@ def test_normalized_distro_name(self):
self.assertEqual('gentoo', n('funtoo'))
self.assertEqual('gentoo', n('Exherbo'))
self.assertEqual('gentoo', n('exherbo'))
self.assertEqual('virtuozzo', n('Virtuozzo Linux'))

@mock.patch('platform.system', lambda: 'Linux')
def test_platform_information_linux(self):
Expand Down Expand Up @@ -284,6 +286,11 @@ def test_platform_information_linux(self):
self.assertEqual(('Oracle VM server', '3.4.2', 'OVS3.4.2'),
ceph_detect_init.platform_information())

with mock.patch('platform.linux_distribution',
lambda **kwargs: (('Virtuozzo Linux', '7.3', ''))):
self.assertEqual(('Virtuozzo Linux', '7.3', 'virtuozzo'),
ceph_detect_init.platform_information())

@mock.patch('platform.linux_distribution')
def test_platform_information_container(self, mock_linux_dist):
import sys
Expand Down

0 comments on commit cbde5f9

Please sign in to comment.