From b3c6dd0baaaab94fc6a436ce5698abf32fb6445c Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 29 Mar 2019 15:52:41 -0700 Subject: [PATCH] fix tests --- builder/hyperv/iso/builder_test.go | 2 +- builder/hyperv/vmcx/builder.go | 4 ++-- builder/hyperv/vmcx/builder_test.go | 2 +- website/source/docs/builders/hyperv-vmcx.html.md.erb | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/builder/hyperv/iso/builder_test.go b/builder/hyperv/iso/builder_test.go index a07ab38bd..640221de2 100644 --- a/builder/hyperv/iso/builder_test.go +++ b/builder/hyperv/iso/builder_test.go @@ -21,7 +21,7 @@ func testConfig() map[string]interface{} { "iso_url": "http://www.packer.io", "shutdown_command": "yes", "ssh_username": "foo", - "ram_size": 64, + "memory": 64, "disk_size": 256, "disk_block_size": 1, "guest_additions_mode": "none", diff --git a/builder/hyperv/vmcx/builder.go b/builder/hyperv/vmcx/builder.go index a611a300d..d56d8b908 100644 --- a/builder/hyperv/vmcx/builder.go +++ b/builder/hyperv/vmcx/builder.go @@ -576,10 +576,10 @@ func (b *Builder) checkRamSize() error { log.Println(fmt.Sprintf("%s: %v", "RamSize", b.config.RamSize)) if b.config.RamSize < MinRamSize { - return fmt.Errorf("ram_size: Virtual machine requires memory size >= %v MB, but defined: %v", + return fmt.Errorf("memory: Virtual machine requires memory size >= %v MB, but defined: %v", MinRamSize, b.config.RamSize) } else if b.config.RamSize > MaxRamSize { - return fmt.Errorf("ram_size: Virtual machine requires memory size <= %v MB, but defined: %v", + return fmt.Errorf("memory: Virtual machine requires memory size <= %v MB, but defined: %v", MaxRamSize, b.config.RamSize) } diff --git a/builder/hyperv/vmcx/builder_test.go b/builder/hyperv/vmcx/builder_test.go index 735d1be8a..9f268aab4 100644 --- a/builder/hyperv/vmcx/builder_test.go +++ b/builder/hyperv/vmcx/builder_test.go @@ -22,7 +22,7 @@ func testConfig() map[string]interface{} { "shutdown_command": "yes", "ssh_username": "foo", "switch_name": "switch", // to avoid using builder.detectSwitchName which can lock down in travis-ci - "ram_size": 64, + "memory": 64, "guest_additions_mode": "none", "clone_from_vmcx_path": "generated", packer.BuildNameConfigKey: "foo", diff --git a/website/source/docs/builders/hyperv-vmcx.html.md.erb b/website/source/docs/builders/hyperv-vmcx.html.md.erb index 22a31dac1..fec366b58 100644 --- a/website/source/docs/builders/hyperv-vmcx.html.md.erb +++ b/website/source/docs/builders/hyperv-vmcx.html.md.erb @@ -207,7 +207,7 @@ builder. created, must be empty prior to running the builder. By default this is "output-BUILDNAME" where "BUILDNAME" is the name of the build. -- `ram_size` (number) - The amount, in megabytes, of RAM to assign to the +- `memory` (number) - The amount, in megabytes, of RAM to assign to the VM. By default, this is 1 GB. - `secondary_iso_images` (array of strings) - A list of ISO paths to @@ -393,7 +393,7 @@ Packer config: "winrm_password": "vagrant", "winrm_timeout" : "4h", "shutdown_command": "f:\\run-sysprep.cmd", - "ram_size": 4096, + "memory": 4096, "cpu": 4, "generation": 2, "switch_name":"LAN", @@ -902,7 +902,7 @@ virtual switch with an `External` connection type. "variables": { "vm_name": "ubuntu-xenial", "cpu": "2", - "ram_size": "1024", + "memory": "1024", "disk_size": "21440", "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.1-server-amd64.iso", "iso_checksum_type": "sha1", @@ -937,7 +937,7 @@ virtual switch with an `External` connection type. "boot" ], "shutdown_command": "echo 'packer' | sudo -S -E shutdown -P now", - "ram_size": "{{user `ram_size`}}", + "memory": "{{user `memory`}}", "cpu": "{{user `cpu`}}", "generation": 2, "enable_secure_boot": false