1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-13 20:08:55 +00:00

Fix random error in the dynamips test suite after previous commit

This commit is contained in:
Julien Duponchelle 2017-01-10 12:41:14 +01:00
parent 6150929a5b
commit afd46ec010
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import uuid
import pytest
import asyncio
import configparser
@ -46,18 +47,19 @@ def test_router(project, manager):
def test_convert_project_before_2_0_0_b3(project, manager):
node_id = str(uuid.uuid4())
wdir = project.module_working_directory(manager.module_name.lower())
os.makedirs(os.path.join(wdir, "00010203-0405-0607-0809-0a0b0c0d0e0f"))
os.makedirs(os.path.join(wdir, node_id))
os.makedirs(os.path.join(wdir, "configs"))
open(os.path.join(wdir, "configs", "i1_startup-config.cfg"), "w+").close()
open(os.path.join(wdir, "configs", "i2_startup-config.cfg"), "w+").close()
open(os.path.join(wdir, "c7200_i1_nvram"), "w+").close()
open(os.path.join(wdir, "c7200_i2_nvram"), "w+").close()
router = Router("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager, dynamips_id=1)
assert os.path.exists(os.path.join(wdir, "00010203-0405-0607-0809-0a0b0c0d0e0f", "configs", "i1_startup-config.cfg"))
assert not os.path.exists(os.path.join(wdir, "00010203-0405-0607-0809-0a0b0c0d0e0f", "configs", "i2_startup-config.cfg"))
assert os.path.exists(os.path.join(wdir, "00010203-0405-0607-0809-0a0b0c0d0e0f", "c7200_i1_nvram"))
assert not os.path.exists(os.path.join(wdir, "00010203-0405-0607-0809-0a0b0c0d0e0f", "c7200_i2_nvram"))
router = Router("test", node_id, project, manager, dynamips_id=1)
assert os.path.exists(os.path.join(wdir, node_id, "configs", "i1_startup-config.cfg"))
assert not os.path.exists(os.path.join(wdir, node_id, "configs", "i2_startup-config.cfg"))
assert os.path.exists(os.path.join(wdir, node_id, "c7200_i1_nvram"))
assert not os.path.exists(os.path.join(wdir, node_id, "c7200_i2_nvram"))
def test_router_invalid_dynamips_path(project, manager, loop):