diff --git a/tests/dynamips/test_hypervisor.py b/tests/dynamips/test_hypervisor.py index 0ee5a422..36a2dafa 100644 --- a/tests/dynamips/test_hypervisor.py +++ b/tests/dynamips/test_hypervisor.py @@ -1,6 +1,7 @@ from gns3server.modules.dynamips import Hypervisor import time import os +import pytest def test_is_started(hypervisor): @@ -37,6 +38,6 @@ def test_stdout(): hypervisor = Hypervisor(dynamips_path, "/tmp", "127.0.0.1", 7200) hypervisor.start() # give some time for Dynamips to start - time.sleep(0.01) + time.sleep(0.1) output = hypervisor.read_stdout() assert output diff --git a/tests/iou/test_iou_device.py b/tests/iou/test_iou_device.py index c40a7cf9..58581de9 100644 --- a/tests/iou/test_iou_device.py +++ b/tests/iou/test_iou_device.py @@ -3,6 +3,16 @@ import os import pytest +def no_iou(): + cwd = os.path.dirname(os.path.abspath(__file__)) + iou_path = os.path.join(cwd, "i86bi_linux-ipbase-ms-12.4.bin") + + if os.path.isfile(iou_path): + return False + else: + return True + + @pytest.fixture(scope="session") def iou(request): @@ -14,8 +24,7 @@ def iou(request): return iou_device -@pytest.mark.skipif(os.environ["TRAVIS"] == 'true', - reason="IOU Image not available on Travis") +@pytest.mark.skipif(no_iou(), reason="IOU Image not available") def test_iou_is_started(iou): print(iou.command()) @@ -23,8 +32,7 @@ def test_iou_is_started(iou): assert iou.is_running() -@pytest.mark.skipif(os.environ["TRAVIS"] == 'true', - reason="IOU Image not available on Travis") +@pytest.mark.skipif(no_iou(), reason="IOU Image not available") def test_iou_restart(iou): iou.stop()