Debian Codegraph @

tests/probes/sql57/unsupported_engine.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 set -e -o pipefail
4 . $builddir/tests/test_common.sh
5
6 name=$(basenamescip-shell system . . basename. $0 .sh)
7 result=$(mktempscip-shell system . . mktemp. ${name}.out.XXXXXX)
8 stderr=$(mktempscip-shell system . . mktemp. ${name}.err.XXXXXX)
9 echoscip-shell system . . echo. "Result file: $result"
10 echoscip-shell system . . echo. "stderr file: $stderr"
11
12 echoscip-shell system . . echo. "Evaluating content."
13 $OSCAP oval eval --results $result $srcdir/${name}.oval.xml 2> $stderr
14 # filter out the expected error in stderr
15 sedscip-shell system . . sed. -i -E "/^E: probe_sql57: DB engine not supported: sqlserver/dscip-shell filesystem . . `/^E: probe_sql57: DB engine not supported: sqlserver/d`." "$stderr"
16 [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr
17 echoscip-shell system . . echo. "Validating results."
18 #$OSCAP oval validate --results $result
19 echoscip-shell system . . echo. "Testing results values."
20 assert_exists 1 '/oval_resultsscip-shell filesystem . . `/oval_results`.'
21 assert_exists 1 '/oval_results/oval_definitionsscip-shell filesystem . . `/oval_results/oval_definitions`.'
22 assert_exists 1 '/oval_results/oval_definitions/testsscip-shell filesystem . . `/oval_results/oval_definitions/tests`.'
23 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_testscip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test`.'
24 assert_exists 5 '/oval_results/oval_definitions/tests/ind-def:sql57_test/@*scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test/@*`.'
25 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test[@id="oval:org.gentoo.dev.swift.postgres:tst:1"]scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test[@id="oval:org.gentoo.dev.swift.postgres:tst:1"]`.'
26 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test[@version="1"]scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test[@version="1"]`.'
27 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test[@check_existence="only_one_exists"]scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test[@check_existence="only_one_exists"]`.'
28 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test[@check="all"]scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test[@check="all"]`.'
29 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test/@commentscip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test/@comment`.'
30 assert_exists 2 '/oval_results/oval_definitions/tests/ind-def:sql57_test/*scip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test/*`.'
31 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test/ind-def:objectscip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test/ind-def:object`.'
32 assert_exists 1 '/oval_results/oval_definitions/tests/ind-def:sql57_test/ind-def:statescip-shell filesystem . . `/oval_results/oval_definitions/tests/ind-def:sql57_test/ind-def:state`.'
33 assert_exists 1 '/oval_results/oval_definitions/objectsscip-shell filesystem . . `/oval_results/oval_definitions/objects`.'
34 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_objectscip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object`.'
35 assert_exists 3 '/oval_results/oval_definitions/objects/ind-def:sql57_object/@*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/@*`.'
36 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object[@id="oval:org.gentoo.dev.swift.postgres:obj:1"]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object[@id="oval:org.gentoo.dev.swift.postgres:obj:1"]`.'
37 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object[@version="1"]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object[@version="1"]`.'
38 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/@commentscip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/@comment`.'
39 assert_exists 4 '/oval_results/oval_definitions/objects/ind-def:sql57_object/*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/*`.'
40 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:enginescip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:engine`.'
41 assert_exists 0 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:engine/@*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:engine/@*`.'
42 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:engine[text()="sqlserver"]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:engine[text()="sqlserver"]`.'
43 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:versionscip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:version`.'
44 assert_exists 0 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:version/@*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:version/@*`.'
45 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:version[text()="1.0"]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:version[text()="1.0"]`.'
46 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_stringscip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string`.'
47 assert_exists 0 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string/@*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string/@*`.'
48 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string[text()]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string[text()]`.'
49 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:sqlscip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:sql`.'
50 assert_exists 0 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:sql/@*scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:sql/@*`.'
51 assert_exists 1 '/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string[text()]scip-shell filesystem . . `/oval_results/oval_definitions/objects/ind-def:sql57_object/ind-def:connection_string[text()]`.'
52 assert_exists 1 '/oval_results/oval_definitions/statesscip-shell filesystem . . `/oval_results/oval_definitions/states`.'
53 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_statescip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state`.'
54 assert_exists 3 '/oval_results/oval_definitions/states/ind-def:sql57_state/@*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/@*`.'
55 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state[@id="oval:org.gentoo.dev.swift.postgres:ste:1"]scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state[@id="oval:org.gentoo.dev.swift.postgres:ste:1"]`.'
56 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state[@version="1"]scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state[@version="1"]`.'
57 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/@commentscip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/@comment`.'
58 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/*`.'
59 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:resultscip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result`.'
60 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/@*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/@*`.'
61 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result[@datatype="record"]scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result[@datatype="record"]`.'
62 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/*`.'
63 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:fieldscip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field`.'
64 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field/@*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field/@*`.'
65 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field[@name="usename"]scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field[@name="usename"]`.'
66 assert_exists 1 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field[text()="sqladmin"]scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field[text()="sqladmin"]`.'
67 assert_exists 0 '/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field/*scip-shell filesystem . . `/oval_results/oval_definitions/states/ind-def:sql57_state/ind-def:result/oval-def:field/*`.'
68 assert_exists 1 '/oval_results/resultsscip-shell filesystem . . `/oval_results/results`.'
69 assert_exists 1 '/oval_results/results/*scip-shell filesystem . . `/oval_results/results/*`.'
70 assert_exists 1 '/oval_results/results/systemscip-shell filesystem . . `/oval_results/results/system`.'
71 assert_exists 3 '/oval_results/results/system/*scip-shell filesystem . . `/oval_results/results/system/*`.'
72 assert_exists 1 '/oval_results/results/system/definitionsscip-shell filesystem . . `/oval_results/results/system/definitions`.'
73 assert_exists 1 '/oval_results/results/system/definitions/definitionscip-shell filesystem . . `/oval_results/results/system/definitions/definition`.'
74 assert_exists 3 '/oval_results/results/system/definitions/definition/@*scip-shell filesystem . . `/oval_results/results/system/definitions/definition/@*`.'
75 assert_exists 1 '/oval_results/results/system/definitions/definition[@definition_id="oval:org.gentoo.dev.swift.postgres:def:1"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition[@definition_id="oval:org.gentoo.dev.swift.postgres:def:1"]`.'
76 assert_exists 1 '/oval_results/results/system/definitions/definition[@result="error"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition[@result="error"]`.'
77 assert_exists 1 '/oval_results/results/system/definitions/definition[@version="1"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition[@version="1"]`.'
78 assert_exists 1 '/oval_results/results/system/definitions/definition/*scip-shell filesystem . . `/oval_results/results/system/definitions/definition/*`.'
79 assert_exists 1 '/oval_results/results/system/definitions/definition/criteriascip-shell filesystem . . `/oval_results/results/system/definitions/definition/criteria`.'
80 assert_exists 2 '/oval_results/results/system/definitions/definition/criteria/@*scip-shell filesystem . . `/oval_results/results/system/definitions/definition/criteria/@*`.'
81 assert_exists 1 '/oval_results/results/system/definitions/definition/criteria[@result="error"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition/criteria[@result="error"]`.'
82 assert_exists 1 '/oval_results/results/system/definitions/definition/criteria[@operator="AND"]scip-shell filesystem . . `/oval_results/results/system/definitions/definition/criteria[@operator="AND"]`.'
83 assert_exists 1 '/oval_results/results/system/definitions/definition/criteria/*scip-shell filesystem . . `/oval_results/results/system/definitions/definition/criteria/*`.'
84 assert_exists 1 '/oval_results/results/system/testsscip-shell filesystem . . `/oval_results/results/system/tests`.'
85 assert_exists 1 '/oval_results/results/system/tests/testscip-shell filesystem . . `/oval_results/results/system/tests/test`.'
86 assert_exists 5 '/oval_results/results/system/tests/test/@*scip-shell filesystem . . `/oval_results/results/system/tests/test/@*`.'
87 assert_exists 1 '/oval_results/results/system/tests/test[@result="error"]scip-shell filesystem . . `/oval_results/results/system/tests/test[@result="error"]`.'
88 assert_exists 0 '/oval_results/results/system/tests/test/*scip-shell filesystem . . `/oval_results/results/system/tests/test/*`.'
89 assert_exists 1 '/oval_results/results/system/oval_system_characteristicsscip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics`.'
90 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objectsscip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects`.'
91 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/objectscip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object`.'
92 assert_exists 3 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/@*scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/@*`.'
93 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object[@id="oval:org.gentoo.dev.swift.postgres:obj:1"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object[@id="oval:org.gentoo.dev.swift.postgres:obj:1"]`.'
94 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object[@version="1"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object[@version="1"]`.'
95 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object[@flag="error"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object[@flag="error"]`.'
96 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/*scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/*`.'
97 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/message/@*scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/message/@*`.'
98 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[@level="error"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[@level="error"]`.'
99 assert_exists 1 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[text()="DB engine not supported: sqlserver"]scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/message[text()="DB engine not supported: sqlserver"]`.'
100 assert_exists 0 '/oval_results/results/system/oval_system_characteristics/collected_objects/object/message/*scip-shell filesystem . . `/oval_results/results/system/oval_system_characteristics/collected_objects/object/message/*`.'
101
102 rmscip-shell system . . rm. $result