github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0191.yml (about)

     1  notes:
     2    - inernal test case only
     3  
     4  tasks:
     5  
     6    -
     7      name: task
     8      task:
     9        -
    10          func: block
    11          desc: loop through test cases
    12          loop:
    13            - item1
    14            - item2
    15          do:
    16            - func: call
    17              do: bb
    18  
    19    -
    20      name: bb
    21      task:
    22        -
    23          func: cmd
    24          do:
    25            - name: print
    26              cmd: |
    27                {{.loopitem}}
    28  
    29        -
    30          func: block
    31          desc: obtain the instances and loop through each instance
    32          loop:
    33            - instance1
    34            - instance2
    35            - instance3
    36          do:
    37            -
    38              func: cmd
    39              desc: processing instance .....
    40              do:
    41                - name: print
    42                  cmd: '{{.loopitem}}'
    43  
    44            -
    45              func: call
    46              do: cc
    47              if: '{{ne .loopitem "instance2"}}'
    48  
    49    -
    50      name: cc
    51      task:
    52        -
    53          func: shell
    54          do:
    55            - echo "in cc ...."
    56      finally:
    57        -
    58          func: shell
    59          vars:
    60            finally_cc: cc
    61          name: close_file
    62          desc: |
    63            ensure the opened file is closed
    64          do:
    65            - echo "close the file ....."