Skip to content

Commit

Permalink
Added Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Waad AlKhoury <walkhour@redhat.com>
  • Loading branch information
Waad AlKhoury committed May 14, 2021
1 parent 0f5c912 commit 92abaed
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Empty file.
26 changes: 26 additions & 0 deletions src/pybind/mgr/cli_api/tests/test_cliapi.py
@@ -0,0 +1,26 @@
from pytest import approx
import os

def test_benchmark():
p = os.popen("ceph mgr api benchmark get osd_map 10 10")
print(p.read())
p.close()

def test_osd_number():
number_of_total_calls = 10
p = os.popen("ceph mgr api benchmark get osd_map {} 10".format(number_of_total_calls))
if(number_of_total_calls > 0):
print(p.read())
p.close()
else:
assert 0 , "Number of total calls should be greater than 0"

def test_osd_number():
threads = 10
p = os.popen("ceph mgr api benchmark get osd_map 10 {}".format(threads))
if(threads > 0):
print(p.read())
p.close()
else:
assert 0 , "Threads should be greater than 0"

1 change: 1 addition & 0 deletions src/pybind/mgr/tox.ini
Expand Up @@ -47,6 +47,7 @@ commands =
insights/ \
pg_autoscaler/ \
progress/ \
cli_api/ \
snap_schedule}

[testenv:mypy]
Expand Down

0 comments on commit 92abaed

Please sign in to comment.