1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00
gns3-server/tests/conftest.py
Jeremy 7fff25a9a9 UUID support for VMs.
Basic VirtualBox support (create, start and stop).
Some refactoring for BaseVM class.
Updated CURL command in tests.
2015-01-19 18:30:57 -07:00

20 lines
514 B
Python

import sys
import os
import pytest
import subprocess
import time
@pytest.fixture(scope="session", autouse=True)
def server(request):
"""
Starts GNS3 server for all the tests.
"""
cwd = os.path.dirname(os.path.abspath(__file__))
server_script = os.path.join(cwd, "../gns3server/main.py")
process = subprocess.Popen([sys.executable, server_script, "--port=8000"])
#time.sleep(1) # give some time for the process to start
request.addfinalizer(process.terminate)
return process