mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge remote-tracking branch 'origin/master' into 2.1
This commit is contained in:
7 files changed
+15
-30
No files matched your search
@@ -359,20 +359,6 @@ def test_bios_option(vm, tmpdir, loop, fake_qemu_img_binary):
|
||||
assert ' '.join(['-bios', str(tmpdir / "test.img")]) in ' '.join(options)
|
||||
|
||||
|
||||
def test_vnc_option(vm, tmpdir, loop, fake_qemu_img_binary):
|
||||
vm._console_type = 'vnc'
|
||||
vm._console = 5905
|
||||
options = loop.run_until_complete(asyncio.async(vm._build_command()))
|
||||
assert '-vnc 127.0.0.1:5' in ' '.join(options)
|
||||
|
||||
|
||||
def test_spice_option(vm, tmpdir, loop, fake_qemu_img_binary):
|
||||
vm._console_type = 'spice'
|
||||
vm._console = 5905
|
||||
options = loop.run_until_complete(asyncio.async(vm._build_command()))
|
||||
assert '-spice addr=127.0.0.1,port=5905,disable-ticketing' in ' '.join(options)
|
||||
|
||||
|
||||
def test_disk_options_multiple_disk(vm, tmpdir, loop, fake_qemu_img_binary):
|
||||
|
||||
vm._hda_disk_image = str(tmpdir / "test0.qcow2")
|
||||
|
||||
@@ -254,7 +254,7 @@ def test_update_startup_script_h(vm):
|
||||
def test_update_startup_script_with_escaping_characters_in_name(vm):
|
||||
vm.startup_script = "set pcname initial-name\n"
|
||||
vm.name = "test\\"
|
||||
assert vm.startup_script == "set pcname test\\\n"
|
||||
assert vm.startup_script == "set pcname test\\{}".format(os.linesep)
|
||||
|
||||
|
||||
def test_get_startup_script(vm):
|
||||
|
||||
@@ -217,6 +217,15 @@ def test_write_file(http_controller, tmpdir, project):
|
||||
assert response.status == 403
|
||||
|
||||
|
||||
def test_write_and_get_file_with_leading_slashes_in_filename(http_controller, tmpdir, loop, project):
|
||||
response = http_controller.post("/projects/{project_id}/files//hello".format(project_id=project.id), body="world", raw=True)
|
||||
assert response.status == 200
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/files//hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 200
|
||||
assert response.body == b"world"
|
||||
|
||||
|
||||
def test_import(http_controller, tmpdir, controller):
|
||||
|
||||
with zipfile.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip:
|
||||
|
||||
Reference in new issue
Block a user