#!/bin/bash . "$TF_DIR/include/subtest.sh" . "$TF_DIR/include/tools.sh" tf_enum_subtests() { echo unknown echo unknown_dash1 echo unknown_dash2 echo unknown_none echo unknown_same echo shellfu_path echo inigrep_path echo app_version echo cache_home echo libexec echo libexec_prefix # warn "unknown devel key: $key" } ckfuzzy() { local es local out="result/$name.stdout" mkdir -p result cat > "$out" case "$name" in shellfu_path) grep -q '^/usr/' ;; inigrep_path) grep -q '^/usr/' ;; app_version) grep -q '[0-9]' ;; cache_home) grep -qx '/home/.*/.cache/satcmd' ;; libexec) grep -q '^/usr/' ;; libexec_prefix) grep -q '.' ;; esac <"$out"; es=$? if test $es -gt 0; then tf_warn "bad output format" cat "$out" return "$TF_ES_FAIL" fi } tf_do_subtest() { local name=$1 local o_err="oracle/$name.stderr" case $name in unknown) tf_testflt -n "$name" -E "$o_err" -S 2 satcmd --saturnin-get-foo ;; unknown_dash1) tf_testflt -n "$name" -E "$o_err" -S 2 satcmd --saturnin-get-- ;; unknown_dash2) tf_testflt -n "$name" -E "$o_err" -S 2 satcmd --saturnin-get--- ;; unknown_none) tf_testflt -n "$name" -E "$o_err" -S 2 satcmd --saturnin-get- ;; unknown_same) tf_testflt -n "$name" -E "$o_err" -S 2 satcmd --saturnin-get---saturnin-get ;; shellfu_path) satcmd --saturnin-get-shellfu-path | ckfuzzy ;; inigrep_path) satcmd --saturnin-get-inigrep-path | ckfuzzy ;; app_version) satcmd --saturnin-get-app-version | ckfuzzy ;; cache_home) satcmd --saturnin-get-cache-home | ckfuzzy ;; libexec) satcmd --saturnin-get-libexec | ckfuzzy ;; libexec_prefix) satcmd --saturnin-get-libexec-prefix | ckfuzzy ;; esac } tf_do_subtests