Rename vlan dat file for IOU

This commit is contained in:
Julien Duponchelle committed 2015-03-05 17:00:25 +01:00
1 parent 7a6136ed14
commit 3407ba802e
2 files changed
+7

No files matched your search

+3
View File
@@ -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):
+4
View File
@@ -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):