---
"Test cat recovery output":

  - do:
      cat.recovery: {}

  - match:
      $body: |
               /^$/

  - do:
      index:
        index:  index1
        type:   type1
        id:     1
        body:   { foo: bar }
        refresh: true
  - do:
      cat.recovery:
          h: i,s,t,ty,st,shost,thost,rep,snap,f,fr,fp,tf,b,br,bp,tb,to,tor,top

  - match:
      $body: |
              /^
              (
                index1      \s+
                \d          \s+                                 # shard
                (?:\d+ms|\d+(?:\.\d+)?s)    \s+                 # time in ms or seconds
                (empty_store|existing_store|peer|snapshot|local_shards) \s+ # source type
                (init|index|verify_index|translog|finalize|done) \s+ # stage
                [-\w./]+    \s+                                 # source_host
                [-\w./]+    \s+                                 # target_host
                [-\w./]+    \s+                                 # repository
                [-\w./]+    \s+                                 # snapshot
                \d+         \s+                                 # files
                \d+         \s+                                 # files_recovered
                \d+\.\d+%   \s+                                 # files_percent
                \d+         \s+                                 # files_total
                \d+         \s+                                 # bytes
                \d+         \s+                                 # bytes_recovered
                \d+\.\d+%   \s+                                 # bytes_percent
                \d+         \s+                                 # bytes_total
                -?\d+       \s+                                 # translog_ops
                \d+         \s+                                 # translog_ops_recovered
                -?\d+\.\d+%                                     # translog_ops_percent
                \n
              )+
              $/

  - do:
      cat.recovery:
          h: shard,source_node,bytes

  - match:
      $body: |
              /^
              (
                \d          \s+                                 # shard
                ((\S+\s?){1,10})\s+                             # source_node
                \d+                                             # bytes
                \n
              )+
              $/

  - do:
      cat.recovery:
          h: shard,target_node,bytes

  - match:
      $body: |
              /^
              (
                \d          \s+                                 # shard
                ((\S+\s?){1,10})\s+                             # target_node
                \d+                                             # bytes
                \n
              )+
              $/
