Merge pull request #408 from GNS3/asa8_warning

Show a warning when starting ASA8
This commit is contained in:
Jeremy Grossmann 2016-01-22 10:53:19 -08:00
commit cd9cb3eb6a
2 changed files with 26 additions and 0 deletions

View File

@ -694,6 +694,8 @@ class QemuVM(BaseVM):
log.info('QEMU VM "{name}" [{id}] has set the QEMU initrd path to {initrd}'.format(name=self._name,
id=self._id,
initrd=initrd))
if "asa" in initrd:
self.project.emit("log.warning", {"message": "Warning ASA 8 is not officialy supported by GNS3 and Cisco, we recommend to use ASAv. Depending of your hardware this could not work or you could be limited to one instance."})
self._initrd = initrd
@property

View File

@ -460,6 +460,30 @@ def test_hdd_disk_image(vm, tmpdir):
assert vm.hdd_disk_image == force_unix_path(str(tmpdir / "QEMU" / "test"))
def test_initrd(vm, tmpdir):
vm.manager.config.set("Server", "images_path", str(tmpdir))
with patch("gns3server.modules.project.Project.emit") as mock:
vm.initrd = str(tmpdir / "test")
assert vm.initrd == force_unix_path(str(tmpdir / "test"))
vm.initrd = "test"
assert vm.initrd == force_unix_path(str(tmpdir / "QEMU" / "test"))
assert not mock.called
def test_initrd_asa(vm, tmpdir):
vm.manager.config.set("Server", "images_path", str(tmpdir))
with patch("gns3server.modules.project.Project.emit") as mock:
vm.initrd = str(tmpdir / "asa842-initrd.gz")
assert vm.initrd == force_unix_path(str(tmpdir / "asa842-initrd.gz"))
vm.initrd = "asa842-initrd.gz"
assert vm.initrd == force_unix_path(str(tmpdir / "QEMU" / "asa842-initrd.gz"))
assert mock.called
def test_options(linux_platform, vm):
vm.kvm = False
vm.options = "-usb"