mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
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
This commit is contained in:
1 parent
578bb5741d
commit
7cbce0f81b
9 files changed
+32
-23
No files matched your search
@@ -6,10 +6,9 @@ import os
|
||||
@pytest.fixture(scope="module")
|
||||
def hypervisor(request):
|
||||
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
dynamips_path = os.path.join(cwd, "dynamips.stable")
|
||||
dynamips_path = '/usr/bin/dynamips'
|
||||
print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
|
||||
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1", 9000)
|
||||
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1")
|
||||
hypervisor = manager.start_new_hypervisor()
|
||||
|
||||
def stop():
|
||||
|
||||
@@ -29,9 +29,9 @@ def test_router_exists(router_c7200):
|
||||
|
||||
def test_npe(router_c7200):
|
||||
|
||||
assert router_c7200.npe == "npe-400" # default value
|
||||
router_c7200.npe = "npe-200"
|
||||
assert router_c7200.npe == "npe-200"
|
||||
assert router_c7200.npe == "npe-200" # default value
|
||||
router_c7200.npe = "npe-400"
|
||||
assert router_c7200.npe == "npe-400"
|
||||
|
||||
|
||||
def test_midplane(router_c7200):
|
||||
|
||||
@@ -10,7 +10,7 @@ def test_is_started(hypervisor):
|
||||
|
||||
def test_port(hypervisor):
|
||||
|
||||
assert hypervisor.port == 9000
|
||||
assert hypervisor.port == 7200
|
||||
|
||||
|
||||
def test_host(hypervisor):
|
||||
@@ -25,8 +25,7 @@ def test_working_dir(hypervisor):
|
||||
|
||||
def test_path(hypervisor):
|
||||
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
dynamips_path = os.path.join(cwd, "dynamips.stable")
|
||||
dynamips_path = '/usr/bin/dynamips'
|
||||
assert hypervisor.path == dynamips_path
|
||||
|
||||
|
||||
|
||||
@@ -7,10 +7,9 @@ import os
|
||||
@pytest.fixture(scope="module")
|
||||
def hypervisor_manager(request):
|
||||
|
||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||
dynamips_path = os.path.join(cwd, "dynamips.stable")
|
||||
dynamips_path = '/usr/bin/dynamips'
|
||||
print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
|
||||
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1", 9000)
|
||||
manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1")
|
||||
|
||||
#manager.start_new_hypervisor()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import base64
|
||||
@pytest.fixture
|
||||
def router(request, hypervisor):
|
||||
|
||||
router = Router(hypervisor, "router", "c3725")
|
||||
router = Router(hypervisor, "router", platform="c3725")
|
||||
request.addfinalizer(router.delete)
|
||||
return router
|
||||
|
||||
@@ -127,9 +127,9 @@ def test_idlepc(router):
|
||||
|
||||
def test_idlemax(router):
|
||||
|
||||
assert router.idlemax == 1500 # default value
|
||||
router.idlemax = 500
|
||||
assert router.idlemax == 500
|
||||
assert router.idlemax == 500 # default value
|
||||
router.idlemax = 1500
|
||||
assert router.idlemax == 1500
|
||||
|
||||
|
||||
def test_idlesleep(router):
|
||||
@@ -172,7 +172,7 @@ def test_confreg(router):
|
||||
|
||||
def test_console(router):
|
||||
|
||||
assert router.console == router.hypervisor.baseconsole + router.id
|
||||
assert router.console == 2001
|
||||
new_console_port = router.console + 100
|
||||
router.console = new_console_port
|
||||
assert router.console == new_console_port
|
||||
@@ -180,7 +180,7 @@ def test_console(router):
|
||||
|
||||
def test_aux(router):
|
||||
|
||||
assert router.aux == router.hypervisor.baseaux + router.id
|
||||
assert router.aux == 2501
|
||||
new_aux_port = router.aux + 100
|
||||
router.aux = new_aux_port
|
||||
assert router.aux == new_aux_port
|
||||
|
||||
Reference in new issue
Block a user