From 3407ba802e295d4c65321b9b70ca3ea656db00a5 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 5 Mar 2015 17:00:25 +0100 Subject: [PATCH] Rename vlan dat file for IOU --- gns3server/modules/iou/iou_vm.py | 3 +++ tests/modules/iou/test_iou_vm.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index 42a7cedc..e80c99a3 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -379,6 +379,9 @@ class IOUVM(BaseVM): destination = os.path.join(self.working_dir, "nvram_{:05d}".format(self.application_id)) for file_path in glob.glob(os.path.join(self.working_dir, "nvram_*")): shutil.move(file_path, destination) + destination = os.path.join(self.working_dir, "vlan.dat-{:05d}".format(self.application_id)) + for file_path in glob.glob(os.path.join(self.working_dir, "vlan.dat-*")): + shutil.move(file_path, destination) @asyncio.coroutine def _start_iouyap(self): diff --git a/tests/modules/iou/test_iou_vm.py b/tests/modules/iou/test_iou_vm.py index 79b2d5c5..045b9814 100644 --- a/tests/modules/iou/test_iou_vm.py +++ b/tests/modules/iou/test_iou_vm.py @@ -116,8 +116,12 @@ def test_rename_nvram_file(loop, vm, monkeypatch): with open(os.path.join(vm.working_dir, "nvram_0000{}".format(vm.application_id + 1)), 'w+') as f: f.write("1") + with open(os.path.join(vm.working_dir, "vlan.dat-0000{}".format(vm.application_id + 1)), 'w+') as f: + f.write("1") + vm._rename_nvram_file() assert os.path.exists(os.path.join(vm.working_dir, "nvram_0000{}".format(vm.application_id))) + assert os.path.exists(os.path.join(vm.working_dir, "vlan.dat-0000{}".format(vm.application_id))) def test_stop(loop, vm):