File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11if (ENABLE_PROBES_UNIX)
22 add_oscap_test ("test_probes_shadow.sh" LABELS unix )
33 add_oscap_test ("test_probes_shadow_offline.sh" LABELS unix )
4+ add_oscap_test ("test_probes_shadow_offline_unsupported.sh" LABELS unix macos )
45endif ()
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ . $builddir /tests/test_common.sh
4+
5+ set -e -o pipefail
6+
7+ function test_probes_shadow_offline_unsupported {
8+ probecheck " shadow" || return 255
9+
10+ case " $( uname) " in
11+ Darwin) ;;
12+ * ) return 255 ;;
13+ esac
14+
15+ local definition=" ${srcdir} /test_probes_shadow_offline.xml"
16+ local results=" results_unsupported.xml"
17+ [ -f " $results " ] && rm -f " $results "
18+
19+ tmpdir=$( make_temp_dir /tmp " test_offline_mode_shadow_unsupported" )
20+ mkdir -p " ${tmpdir} /etc"
21+ echo " root:!locked::0:99999:7:::" > " ${tmpdir} /etc/shadow"
22+ set_offline_chroot_dir " ${tmpdir} "
23+
24+ $OSCAP oval eval --results " $results " " $definition "
25+
26+ set_offline_chroot_dir " "
27+ rm -rf " ${tmpdir} "
28+
29+ result=" $results "
30+ assert_exists 1 ' oval_results/results/system/definitions/definition[@definition_id="oval:1:def:1"][@result="not applicable"]'
31+ assert_exists 1 ' oval_results/results/system/tests/test[@test_id="oval:1:tst:1"][@result="not applicable"]'
32+ assert_exists 1 ' oval_results/results/system/oval_system_characteristics/collected_objects/object[@id="oval:1:obj:1"][@flag="not applicable"]'
33+ }
34+
35+ test_init
36+
37+ test_run " test_probes_shadow_offline_unsupported" test_probes_shadow_offline_unsupported
38+
39+ test_exit
You can’t perform that action at this time.
0 commit comments