Debian Codegraph @

yaml-filter/tests/test-yamlp.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # SPDX-License-Identifier: MIT
4 # Copyright (c) 2020 Red Hat Inc., Durham, North Carolina.
5
6 yamlp_testscip-shell shell shell-project 0.0.0 yamlp_test().()
7 {
8 echoscip-shell system . . echo. "$1:"
9 echoscip-shell system . . echo. -n " ($2) "
10 out=$("${BINARY_DIR:-../build}/yamlp" -F -f "$1" "$2") || return 1
11 echoscip-shell system . . echo. -n "-> $out"
12 if [scip-shell system . . `[`. "$out" != "$3" ]; then
13 echoscip-shell system . . echo. ": FAILED, expected result: $3"
14 return 2
15 else
16 echoscip-shell system . . echo. ": OK"
17 fi
18 }
19
20 yamlp_testscip-shell shell shell-project 0.0.0 yamlp_test(). "${SOURCE_DIR:-..}/res/openshift-logging.yaml" ".spec.pipelines[:].inputSource" "[logs.app, logs.infra, logs.audit]"
21 res=$((res+$?))
22
23 yamlp_testscip-shell shell shell-project 0.0.0 yamlp_test(). "${SOURCE_DIR:-..}/res/openshift-upgradeable.yaml" ".status.conditions[:]['status','type']" \
24 '[{status: "False", type: Degraded}, {status: "False", type: Progressing}, {status: "True", type: Available}, {status: "True", type: Upgradeable}]'
25 res=$((res+$?))
26
27 exit $res