From 74fdfae71dfde482c92bc871a8ffcb41de3de993 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 2 Nov 2015 10:35:25 -0700 Subject: [PATCH] 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 --- teuthology/test/test_misc.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/teuthology/test/test_misc.py b/teuthology/test/test_misc.py index af7b5960a..0dbb09436 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() -- 2.47.3