From cbde5f936c772e46d68810a07507f479bb5095ab Mon Sep 17 00:00:00 2001 From: Andrey Parfenov Date: Mon, 3 Apr 2017 16:38:37 +0300 Subject: [PATCH] ceph-detect-init: Add tests for Virtuozzo Linux support Signed-off-by: Andrey Parfenov --- src/ceph-detect-init/tests/test_all.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-detect-init/tests/test_all.py b/src/ceph-detect-init/tests/test_all.py index eb48bb42698a..263cd9a289b1 100644 --- a/src/ceph-detect-init/tests/test_all.py +++ b/src/ceph-detect-init/tests/test_all.py @@ -217,6 +217,7 @@ class TestCephDetectInit(testtools.TestCase): 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 @@ -246,6 +247,7 @@ class TestCephDetectInit(testtools.TestCase): 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): @@ -284,6 +286,11 @@ class TestCephDetectInit(testtools.TestCase): 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 -- 2.47.3