1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00
gns3-server/tests/dynamips/conftest.py
Daniel Lintott 7cbce0f81b Fix test suite
+ Install VPCS and dynamips from GNS3 PPA
 + Drop netifaces-py3 from requirements.txt
 + Fix/update tests to use installed VPCS and dynamips
2014-08-08 14:32:32 +01:00

30 lines
766 B
Python

from gns3server.modules.dynamips import HypervisorManager
import pytest
import os
@pytest.fixture(scope="module")
def hypervisor(request):
dynamips_path = '/usr/bin/dynamips'
print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1")
hypervisor = manager.start_new_hypervisor()
def stop():
print("\nStopping Dynamips Hypervisor")
manager.stop_all_hypervisors()
request.addfinalizer(stop)
return hypervisor
@pytest.fixture(scope="session")
def image(request):
cwd = os.path.dirname(os.path.abspath(__file__))
image_path = os.path.join(cwd, "c3725.image")
if not os.path.isfile(image_path):
return None
return image_path