github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/packer-hello-world-example/README.md (about)

     1  # Packer "Hello, World" Example
     2  
     3  This folder contains the simplest possible Packer template—one that builds a Docker image with a text file that says
     4  "Hello, World"!—to demonstrate how you can use Terratest to write automated tests for your Packer templates. 
     5  
     6  Check out [test/packer_hello_world_example_test.go](/test/packer_hello_world_example_test.go) to see how you can write
     7  automated tests for this simple template.
     8  
     9  
    10  
    11  
    12  ## Building the Packer template
    13  
    14  1. Install [Packer](https://www.packer.io/) and make sure it's on your `PATH`.
    15  1. Install [Docker](https://www.docker.com/) and make sure it's on your `PATH`.
    16  1. Run `packer build build.json`.
    17  1. Run `docker run -it --rm gruntwork/packer-hello-world-example cat /test.txt`.
    18  1. You should see the text "Hello, World!"
    19  
    20  
    21  
    22  
    23  ## Running automated tests against the Packer template
    24  
    25  1. Install [Packer](https://www.packer.io/) and make sure it's on your `PATH`.
    26  1. Install [Docker](https://www.docker.com/) and make sure it's on your `PATH`.
    27  1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`.
    28  1. `cd test`
    29  1. `go test -v -run TestPackerHelloWorldExample`