]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests/install: update tests to use new host fixture
authorAlfredo Deza <adeza@redhat.com>
Mon, 21 Aug 2017 19:41:58 +0000 (15:41 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 21 Aug 2017 20:50:01 +0000 (16:50 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
tests/functional/tests/test_install.py

index eb2eb3f0046e4e743698c6c046d90f525cd796a1..304d590a33c4d52cc5f284842b2d04b5ac443a01 100644 (file)
@@ -3,40 +3,40 @@ import pytest
 
 class TestInstall(object):
 
-    def test_ceph_dir_exists(self, File, node):
-        assert File('/etc/ceph').exists
+    def test_ceph_dir_exists(self, host, node):
+        assert host.file('/etc/ceph').exists
 
-    def test_ceph_dir_is_a_directory(self, File, node):
-        assert File('/etc/ceph').is_directory
+    def test_ceph_dir_is_a_directory(self, host, node):
+        assert host.file('/etc/ceph').is_directory
 
-    def test_ceph_conf_exists(self, File, node):
-        assert File(node["conf_path"]).exists
+    def test_ceph_conf_exists(self, host, node):
+        assert host.file(node["conf_path"]).exists
 
-    def test_ceph_conf_is_a_file(self, File, node):
-        assert File(node["conf_path"]).is_file
+    def test_ceph_conf_is_a_file(self, host, node):
+        assert host.file(node["conf_path"]).is_file
 
     @pytest.mark.no_docker
-    def test_ceph_command_exists(self, Command, node):
-        assert Command.exists("ceph")
+    def test_ceph_command_exists(self, host, node):
+        assert host.exists("ceph")
 
 
 class TestCephConf(object):
 
-    def test_ceph_config_has_inital_members_line(self, node, File):
-        assert File(node["conf_path"]).contains("^mon initial members = .*$")
+    def test_ceph_config_has_inital_members_line(self, node, host):
+        assert host.file(node["conf_path"]).contains("^mon initial members = .*$")
 
-    def test_initial_members_line_has_correct_value(self, node, File):
+    def test_initial_members_line_has_correct_value(self, node, host):
         mons = ",".join("ceph-%s" % host
                         for host in node["vars"]["groups"]["mons"])
         line = "mon initial members = {}".format(mons)
-        assert File(node["conf_path"]).contains(line)
+        assert host.file(node["conf_path"]).contains(line)
 
-    def test_ceph_config_has_mon_host_line(self, node, File):
-        assert File(node["conf_path"]).contains("^mon host = .*$")
+    def test_ceph_config_has_mon_host_line(self, node, host):
+        assert host.file(node["conf_path"]).contains("^mon host = .*$")
 
-    def test_mon_host_line_has_correct_value(self, node, File):
+    def test_mon_host_line_has_correct_value(self, node, host):
         mon_ips = []
         for x in range(0, node["num_mons"]):
             mon_ips.append("{}.1{}".format(node["subnet"], x))
         line = "mon host = {}".format(",".join(mon_ips))
-        assert File(node["conf_path"]).contains(line)
+        assert host.file(node["conf_path"]).contains(line)