Debian Codegraph @

tests/probe_behavior/collect_limit.sh

raw symbols SCIP
1 #!/bin/bash
2
3 set -e -o pipefail
4
5 . $builddir/tests/test_common.sh
6
7 export OSCAP_PROBE_MAX_COLLECTED_ITEMS=100
8 seq 110 > /tmp/longfile
9 result=$(mktemp)
10 $OSCAP oval eval --results "$result" $srcdir/collect_limit.oval.xml
11 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object'
12 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object[@flag="incomplete"]'
13 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[@level="warning"]'
14 text="Object is incomplete because the object matches more than 100 items."
15 assert_exists 1 "/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[text()=\"$text\"]"
16 assert_exists 100 '/oval_results/results/system/oval_system_characteristics/system_data/ind-sys:textfilecontent_item'
17 rm -f /tmp/longfile
18 rm -f "$result"