#!/usr/bin/env bash
process_keys() {
  # results of test 1
  echo "Read Test D" > keys_in.log
  echo "Read Test D" > keys_out.log
  cat keysB_rank00??_in.log  | sort -n -k 5 >> keys_in.log
  cat keysD_rank??t00??_out.log | sort -n -k 5 >> keys_out.log

  # multiple read of a sion task --> sort -u
  cat keysB_rank00??_in.log  | sort -u -n -k 5 >> keys_in.log
  cat keysE_rank??t00??_out.log | sort -u -n -k 5 >> keys_out.log

  cat keysB_rank00??_in.log  | sort -n -k 5 >> keys_in.log
  cat keysF_rank??t00??_out.log | sort -n -k 5 >> keys_out.log

  cat keysB_rank00??_in.log  | sort -n -k 5 >> keys_in.log
  cat keysJ_rank??t00??_out.log | sort -n -k 5 >> keys_out.log

  # skipping verification of rest, cannot be easily compared (only some tasks are read)
}
. ./test_parallel.sh
test_parallel genapi_4 \
  post_hook:process_keys \
  diff:keys_in.log:keys_out.log
