From: Zack Cerza Date: Mon, 2 Nov 2015 17:35:25 +0000 (-0700) Subject: Fix misc.sh() tests on MacOS X-Git-Tag: 1.1.0~769^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=74fdfae71dfde482c92bc871a8ffcb41de3de993;p=teuthology.git Fix misc.sh() tests on MacOS It needs to be specifically told to use /bin/echo. Also add some newlines to make the linter happy. Signed-off-by: Zack Cerza --- diff --git a/teuthology/test/test_misc.py b/teuthology/test/test_misc.py index af7b5960..0dbb0943 100644 --- a/teuthology/test/test_misc.py +++ b/teuthology/test/test_misc.py @@ -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()