From 14edf5345ad95047b43faa5a3a8124f95538a60d Mon Sep 17 00:00:00 2001 From: HacKan Date: Fri, 26 Jan 2018 00:59:47 -0300 Subject: [PATCH] [RM-7505] tests: add for archlinux --- ceph_deploy/tests/test_install.py | 26 ++++++++++++++++++++++ ceph_deploy/tests/unit/hosts/test_hosts.py | 8 +++++++ 2 files changed, 34 insertions(+) diff --git a/ceph_deploy/tests/test_install.py b/ceph_deploy/tests/test_install.py index 7225f12..4a47f9d 100644 --- a/ceph_deploy/tests/test_install.py +++ b/ceph_deploy/tests/test_install.py @@ -63,6 +63,7 @@ class TestDetectComponents(object): self.args.install_all = True self.distro.is_rpm = False self.distro.is_deb = True + self.distro.is_pkgtarxz = False result = sorted(install.detect_components(self.args, self.distro)) assert result == sorted([ 'ceph-osd', 'ceph-mds', 'ceph', 'ceph-mon', 'radosgw' @@ -71,6 +72,7 @@ class TestDetectComponents(object): def test_install_all_with_other_options_returns_all_packages_deb(self): self.distro.is_rpm = False self.distro.is_deb = True + self.distro.is_pkgtarxz = False self.args.install_all = True self.args.install_mds = True self.args.install_mgr = True @@ -99,6 +101,30 @@ class TestDetectComponents(object): 'ceph-osd', 'ceph-mds', 'ceph', 'ceph-mon', 'ceph-radosgw' ]) + def test_install_all_returns_all_packages_pkgtarxz(self): + self.args.install_all = True + self.distro.is_rpm = False + self.distro.is_deb = False + self.distro.is_pkgtarxz = True + result = sorted(install.detect_components(self.args, self.distro)) + assert result == sorted([ + 'ceph', + ]) + + def test_install_all_with_other_options_returns_all_packages_pkgtarxz(self): + self.distro.is_rpm = False + self.distro.is_deb = False + self.distro.is_pkgtarxz = True + self.args.install_all = True + self.args.install_mds = True + self.args.install_mgr = True + self.args.install_mon = True + self.args.install_osd = True + result = sorted(install.detect_components(self.args, self.distro)) + assert result == sorted([ + 'ceph', + ]) + def test_install_only_one_component(self): self.args.install_osd = True result = install.detect_components(self.args, self.distro) diff --git a/ceph_deploy/tests/unit/hosts/test_hosts.py b/ceph_deploy/tests/unit/hosts/test_hosts.py index 8103673..60e98b7 100644 --- a/ceph_deploy/tests/unit/hosts/test_hosts.py +++ b/ceph_deploy/tests/unit/hosts/test_hosts.py @@ -35,6 +35,10 @@ class TestNormalized(object): result = hosts._normalized_distro_name('Virtuozzo Linux') assert result == 'virtuozzo' + def test_get_arch(self): + result = hosts._normalized_distro_name('Arch Linux') + assert result == 'arch' + class TestNormalizeRelease(object): @@ -419,3 +423,7 @@ class TestGetDistro(object): def test_get_virtuozzo(self): result = hosts._get_distro('Virtuozzo Linux') assert result.__name__.endswith('centos') + + def test_get_arch(self): + result = hosts._get_distro('Arch Linux') + assert result.__name__.endswith('arch') -- 2.47.3