From d5049edc8567cebf936bb07847906c5400f9a6d9 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 29 Jun 2015 18:46:19 +0200 Subject: [PATCH] Add tests for component to SUSE package mapping Signed-off-by: David Disseldorp --- ceph_deploy/tests/unit/hosts/test_suse.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ceph_deploy/tests/unit/hosts/test_suse.py b/ceph_deploy/tests/unit/hosts/test_suse.py index bd72d22..841ec06 100644 --- a/ceph_deploy/tests/unit/hosts/test_suse.py +++ b/ceph_deploy/tests/unit/hosts/test_suse.py @@ -1,4 +1,5 @@ from ceph_deploy.hosts import suse +from ceph_deploy.hosts.suse.install import map_components class TestSuseInit(object): def setup(self): @@ -23,3 +24,16 @@ class TestSuseInit(object): self.host.release = '13.1' init_type = self.host.choose_init() assert init_type == "systemd" + +class TestSuseMapComponents(object): + def test_valid(self): + pkgs = map_components(['ceph-osd', 'ceph-common', 'ceph-radosgw']) + assert 'ceph' in pkgs + assert 'ceph-common' in pkgs + assert 'ceph-radosgw' in pkgs + assert 'ceph-osd' not in pkgs + + def test_invalid(self): + pkgs = map_components(['not-provided', 'ceph-mon']) + assert 'not-provided' not in pkgs + assert 'ceph' in pkgs -- 2.47.3