Skip to content

Commit b2b00e2

Browse files
committed
tests/probes/environmentvariable58: add test to cover 7c78b84
1 parent 7a15fc1 commit b2b00e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/probes/environmentvariable58/test_probes_environmentvariable58.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ function test_probes_environmentvariable58 {
2424
local ret_val=0;
2525
local DF="$1.xml"
2626
local RF="$1.results.xml"
27+
echo "result file: $RF"
28+
local stderr=$(mktemp $1.err.XXXXXX)
29+
echo "stderr file: $stderr"
2730

2831
[ -f $RF ] && rm -f $RF
2932

3033
bash ${srcdir}/$1.xml.sh > $DF
3134
LINES=$?
3235

33-
$OSCAP oval eval --results $RF $DF
36+
$OSCAP oval eval --results $RF $DF 2> $stderr
3437

3538
if [ -f $RF ]; then
3639
verify_results "def" $DF $RF 1 && verify_results "tst" $DF $RF $LINES
@@ -39,6 +42,11 @@ function test_probes_environmentvariable58 {
3942
ret_val=1
4043
fi
4144

45+
# Test fails if there are any warnings or "Entity has no value" on stderr.
46+
echo "Verify that there are no warnings on stderr"
47+
grep -Ei "(W:|Entity has no value)" $stderr && ret_val=1
48+
49+
rm $stderr
4250
return $ret_val
4351
}
4452

0 commit comments

Comments
 (0)