mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 09:18:08 +00:00
Rename vlan dat file for IOU
This commit is contained in:
parent
7a6136ed14
commit
3407ba802e
@ -379,6 +379,9 @@ class IOUVM(BaseVM):
|
|||||||
destination = os.path.join(self.working_dir, "nvram_{:05d}".format(self.application_id))
|
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_*")):
|
for file_path in glob.glob(os.path.join(self.working_dir, "nvram_*")):
|
||||||
shutil.move(file_path, destination)
|
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
|
@asyncio.coroutine
|
||||||
def _start_iouyap(self):
|
def _start_iouyap(self):
|
||||||
|
@ -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:
|
with open(os.path.join(vm.working_dir, "nvram_0000{}".format(vm.application_id + 1)), 'w+') as f:
|
||||||
f.write("1")
|
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()
|
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, "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):
|
def test_stop(loop, vm):
|
||||||
|
Loading…
Reference in New Issue
Block a user