]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix misc.sh() tests on MacOS 687/head
authorZack Cerza <zack@redhat.com>
Mon, 2 Nov 2015 17:35:25 +0000 (10:35 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 2 Nov 2015 17:35:25 +0000 (10:35 -0700)
It needs to be specifically told to use /bin/echo. Also add some
newlines to make the linter happy.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_misc.py

index af7b5960a98a104b50768538d7837b3c044cc7a1..0dbb094364e7d4ed49c0de7419dde23b42ba14a2 100644 (file)
@@ -11,24 +11,29 @@ import pytest
 class FakeRemote(object):
     pass
 
+
 def test_sh_normal(caplog):
-    assert misc.sh("echo ABC") == "ABC\n"
+    assert misc.sh("/bin/echo ABC") == "ABC\n"
     assert "truncated" not in caplog.text()
 
+
 def test_sh_truncate(caplog):
-    assert misc.sh("echo -n AB ; echo C", 2) == "ABC\n"
+    assert misc.sh("/bin/echo -n AB ; /bin/echo C", 2) == "ABC\n"
     assert "truncated" in caplog.text()
     assert "ABC" not in caplog.text()
 
+
 def test_sh_fail(caplog):
     with pytest.raises(Exception) as excinfo:
-        misc.sh("echo -n AB ; echo C ; exit 111", 2) == "ABC\n"
+        misc.sh("/bin/echo -n AB ; /bin/echo C ; exit 111", 2) == "ABC\n"
     assert excinfo.value.returncode == 111
     assert "failed with ABC" in caplog.text()
 
+
 def test_wait_until_osds_up():
     ctx = argparse.Namespace()
     remote = FakeRemote()
+
     class r():
         class o:
             def getvalue(self):
@@ -47,6 +52,7 @@ def test_wait_until_osds_up():
     ):
         misc.wait_until_osds_up(ctx, ctx.cluster, remote)
 
+
 def test_get_clients_simple():
     ctx = argparse.Namespace()
     remote = FakeRemote()