diff --git a/test/builder_hyperone.bats b/test/builder_hyperone.bats index ea99ab9aa..3d263f16a 100755 --- a/test/builder_hyperone.bats +++ b/test/builder_hyperone.bats @@ -33,3 +33,9 @@ teardown() { [ "$status" -eq 0 ] [ "$(hyperone_has_image "packerbats-minimal")" -eq 1 ] } + +@test "hyperone: build chroot.json" { + run packer build ${USER_VARS} $FIXTURE_ROOT/chroot.json + [ "$status" -eq 0 ] + [ "$(hyperone_has_image "packerbats-chroot")" -eq 1 ] +} diff --git a/test/fixtures/builder-hyperone/chroot.json b/test/fixtures/builder-hyperone/chroot.json new file mode 100644 index 000000000..5e16366e7 --- /dev/null +++ b/test/fixtures/builder-hyperone/chroot.json @@ -0,0 +1,27 @@ +{ + "variables": { + "token": null, + "project": null + }, + "builders": [{ + "token": "{{ user `token` }}", + "project": "{{ user `project` }}", + "type": "hyperone", + "source_image": "ubuntu", + "disk_size": 10, + "vm_type": "a1.nano", + "chroot_disk": true, + "chroot_command_wrapper": "sudo {{.Command}}", + "pre_mount_commands": [ + "parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print", + "mkfs.ext4 {{.Device}}1" + ], + "post_mount_commands": [ + "apt-get update", + "apt-get install debootstrap", + "debootstrap --arch amd64 bionic {{.MountPath}}" + ], + "image_name": "packerbats-chroot-{{timestamp}}" + }], + "provisioners": [] +}