github.com/daniellockard/packer@v0.7.6-0.20141210173435-5a9390934716/test/provisioner_file.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-file
     9  
    10  setup() {
    11      cd $FIXTURE_ROOT
    12  }
    13  
    14  teardown() {
    15      aws_ami_cleanup
    16  }
    17  
    18  @test "file provisioner: single file" {
    19      run packer build $FIXTURE_ROOT/file.json
    20      [ "$status" -eq 0 ]
    21      [[ "$output" == *"24901 miles"* ]]
    22  }
    23  
    24  @test "file provisioner: directory (no trailing slash)" {
    25      run packer build $FIXTURE_ROOT/dir_no_trailing.json
    26      [ "$status" -eq 0 ]
    27      [[ "$output" == *"337 miles"* ]]
    28  }
    29  
    30  @test "file provisioner: directory (with trailing slash)" {
    31      run packer build $FIXTURE_ROOT/dir_with_trailing.json
    32      [ "$status" -eq 0 ]
    33      [[ "$output" == *"337 miles"* ]]
    34  }