github.com/facebookincubator/ttpforge@v1.0.13-0.20240405153150-5ae801628835/example-ttps/checks/path-exists.yaml (about)

     1  ---
     2  api_version: 2.0
     3  uuid: 7ba3a119-dde3-4900-97cb-9e105ca6e357
     4  name: Demo of the path_exists Post-Execution Check
     5  description: |
     6    The `path_exists` check can be used to verify that a given
     7    file exists and has the correct hash. This helps
     8    TTP authors ensure that their TTP executed correctly and wasn't
     9    blocked by EDR/AV.
    10  requirements:
    11    platforms:
    12      - os: darwin
    13      - os: linux
    14  tests:
    15    - name: default
    16  steps:
    17    - name: create_demo_file
    18      create_file: |-
    19        {{$target_path := (printf "/tmp/ttpforge-path-exists-demo-%v" (randAlphaNum 10))}}{{$target_path}}
    20      contents: foo
    21      cleanup: default
    22      checks:
    23        - msg: "Expected path does not exist or does not have correct contents!"
    24          path_exists: "{{$target_path}}"
    25          checksum:
    26            sha256: 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae