mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Move old test to old_tests directory
This commit is contained in:
1 parent
efad58a2af
commit
aab944fb6c
31 files changed
+13
-10
No files matched your search
@@ -0,0 +1,33 @@
|
||||
from gns3server.modules.vpcs import VPCSDevice
|
||||
import os
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def vpcs(request):
|
||||
|
||||
if os.path.isfile("/usr/bin/vpcs"):
|
||||
vpcs_path = "/usr/bin/vpcs"
|
||||
else:
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
vpcs_path = os.path.join(cwd, "vpcs")
|
||||
vpcs_device = VPCSDevice("VPCS1", vpcs_path, "/tmp")
|
||||
vpcs_device.port_add_nio_binding(0, 'nio_tap:tap0')
|
||||
vpcs_device.start()
|
||||
request.addfinalizer(vpcs_device.delete)
|
||||
return vpcs_device
|
||||
|
||||
|
||||
def test_vpcs_is_started(vpcs):
|
||||
|
||||
print(vpcs.command())
|
||||
assert vpcs.id == 1 # we should have only one VPCS running!
|
||||
assert vpcs.is_running()
|
||||
|
||||
|
||||
def test_vpcs_restart(vpcs):
|
||||
|
||||
vpcs.stop()
|
||||
assert not vpcs.is_running()
|
||||
vpcs.start()
|
||||
assert vpcs.is_running()
|
||||
Reference in new issue
Block a user