github.com/tonnydourado/packer@v0.6.1-0.20140701134019-5d0cd9676a37/test/provisioner_shell.bats (about)

     1  #!/usr/bin/env bats
     2  #
     3  # This tests the amazon-ebs builder. The teardown function will automatically
     4  # delete any AMIs with a tag of `packer-test` being equal to "true" so
     5  # be sure any test cases set this.
     6  
     7  load test_helper
     8  fixtures provisioner-shell
     9  
    10  setup() {
    11      cd $FIXTURE_ROOT
    12  }
    13  
    14  teardown() {
    15      aws_ami_cleanup
    16  }
    17  
    18  @test "shell provisioner: inline scripts" {
    19      run packer build $FIXTURE_ROOT/inline.json
    20      [ "$status" -eq 0 ]
    21      [[ "$output" == *"HELLO I AM ubuntu"* ]]
    22      [[ "$output" == *"AND ANOTHER"* ]]
    23  }
    24  
    25  @test "shell provisioner: script" {
    26      run packer build $FIXTURE_ROOT/script.json
    27      [ "$status" -eq 0 ]
    28      [[ "$output" == *"HELLO I AM DOG"* ]]
    29  }
    30  
    31  @test "shell provisioner: scripts" {
    32      run packer build $FIXTURE_ROOT/scripts.json
    33      [ "$status" -eq 0 ]
    34      [[ "$output" == *"HELLO I AM DOG"* ]]
    35  }