fix tests

This commit is contained in:
Megan Marsh 2019-03-29 15:52:41 -07:00
parent 2b57b10284
commit b3c6dd0baa
4 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ func testConfig() map[string]interface{} {
"iso_url": "http://www.packer.io", "iso_url": "http://www.packer.io",
"shutdown_command": "yes", "shutdown_command": "yes",
"ssh_username": "foo", "ssh_username": "foo",
"ram_size": 64, "memory": 64,
"disk_size": 256, "disk_size": 256,
"disk_block_size": 1, "disk_block_size": 1,
"guest_additions_mode": "none", "guest_additions_mode": "none",

View File

@ -576,10 +576,10 @@ func (b *Builder) checkRamSize() error {
log.Println(fmt.Sprintf("%s: %v", "RamSize", b.config.RamSize)) log.Println(fmt.Sprintf("%s: %v", "RamSize", b.config.RamSize))
if b.config.RamSize < MinRamSize { 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) MinRamSize, b.config.RamSize)
} else if b.config.RamSize > MaxRamSize { } 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) MaxRamSize, b.config.RamSize)
} }

View File

@ -22,7 +22,7 @@ func testConfig() map[string]interface{} {
"shutdown_command": "yes", "shutdown_command": "yes",
"ssh_username": "foo", "ssh_username": "foo",
"switch_name": "switch", // to avoid using builder.detectSwitchName which can lock down in travis-ci "switch_name": "switch", // to avoid using builder.detectSwitchName which can lock down in travis-ci
"ram_size": 64, "memory": 64,
"guest_additions_mode": "none", "guest_additions_mode": "none",
"clone_from_vmcx_path": "generated", "clone_from_vmcx_path": "generated",
packer.BuildNameConfigKey: "foo", packer.BuildNameConfigKey: "foo",

View File

@ -207,7 +207,7 @@ builder.
created, must be empty prior to running the builder. By default this is created, must be empty prior to running the builder. By default this is
"output-BUILDNAME" where "BUILDNAME" is the name of the build. "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. VM. By default, this is 1 GB.
- `secondary_iso_images` (array of strings) - A list of ISO paths to - `secondary_iso_images` (array of strings) - A list of ISO paths to
@ -393,7 +393,7 @@ Packer config:
"winrm_password": "vagrant", "winrm_password": "vagrant",
"winrm_timeout" : "4h", "winrm_timeout" : "4h",
"shutdown_command": "f:\\run-sysprep.cmd", "shutdown_command": "f:\\run-sysprep.cmd",
"ram_size": 4096, "memory": 4096,
"cpu": 4, "cpu": 4,
"generation": 2, "generation": 2,
"switch_name":"LAN", "switch_name":"LAN",
@ -902,7 +902,7 @@ virtual switch with an `External` connection type.
"variables": { "variables": {
"vm_name": "ubuntu-xenial", "vm_name": "ubuntu-xenial",
"cpu": "2", "cpu": "2",
"ram_size": "1024", "memory": "1024",
"disk_size": "21440", "disk_size": "21440",
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.1-server-amd64.iso", "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.1-server-amd64.iso",
"iso_checksum_type": "sha1", "iso_checksum_type": "sha1",
@ -937,7 +937,7 @@ virtual switch with an `External` connection type.
"boot<enter>" "boot<enter>"
], ],
"shutdown_command": "echo 'packer' | sudo -S -E shutdown -P now", "shutdown_command": "echo 'packer' | sudo -S -E shutdown -P now",
"ram_size": "{{user `ram_size`}}", "memory": "{{user `memory`}}",
"cpu": "{{user `cpu`}}", "cpu": "{{user `cpu`}}",
"generation": 2, "generation": 2,
"enable_secure_boot": false "enable_secure_boot": false