]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
call main directly, all tests for test_cli_new passing
authorAlfredo Deza <alfredo@deza.pe>
Wed, 17 Jul 2013 19:49:48 +0000 (15:49 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 17 Jul 2013 19:49:48 +0000 (15:49 -0400)
ceph_deploy/test/test_cli_new.py

index 35608d136ff57321545c7406f8d7b8708bb4dd39..182729ee3b47b62d79ea2ad21d24ca6f1ecb1c34 100644 (file)
@@ -35,18 +35,17 @@ def pytest_funcarg__newcfg(request):
     cli = request.getfuncargvalue('cli')
 
     def new(*args):
-        with cli(
-            args=['ceph-deploy', 'new'] + list(args),
-            ):
-            pass
-        with tmpdir.join('ceph.conf').open() as f:
-            cfg = conf.parse(f)
-        return cfg
+        with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo):
+            with directory(str(tmpdir)):
+                main( args=['new'] + list(args))
+                with tmpdir.join('ceph.conf').open() as f:
+                    cfg = conf.parse(f)
+                return cfg
     return new
 
 
 def test_uuid(newcfg):
-    cfg = newcfg()
+    cfg = newcfg('host1')
     fsid = cfg.get('global', 'fsid')
     # make sure it's a valid uuid
     uuid.UUID(hex=fsid)
@@ -70,7 +69,7 @@ def test_mons(newcfg):
 
 
 def test_defaults(newcfg):
-    cfg = newcfg()
+    cfg = newcfg('host1')
     assert cfg.get('global', 'auth_supported') == 'cephx'
     assert cfg.get('global', 'osd_journal_size') == '1024'
     assert cfg.get('global', 'filestore_xattr_use_omap') == 'true'