Skip to content

Commit

Permalink
Fix random error in the dynamips test suite after previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-duponchelle committed Jan 10, 2017
1 parent 6150929 commit afd46ec
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/compute/dynamips/test_dynamips_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit afd46ec

Please sign in to comment.