Skip to content

Commit f1e0cb2

Browse files
committed
Make systemdunitproperty probe test more independent
The current test of the `systemdunitproperty` probe is relying on the assumption that the `systemd-journald.service` unit doesn't have the `Conflicts` property set. In Rawhide, this assumption is no longer true, because `Conflicts` is now set to `soft-reboot.target` by default. This change breaks our test. In this commit, we will make the test less dependent on actual property value. Instead, we will check a dummy property that is unlikely to occur. Fixes: #2066
1 parent ef654dd commit f1e0cb2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/probes/systemdunitproperty/test_probes_systemdunitproperty.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@
9494
<state state_ref="oval:0:ste:3"/>
9595
</systemdunitproperty_test>
9696

97-
<!-- check that there doesn't exist systemd-journald.service unit with valid Conflicts property -->
97+
<!-- check that there doesn't exist systemd-journald.service unit with valid OscapTestingProperty property -->
9898
<systemdunitproperty_test id="oval:0:tst:5" check="all" check_existence="none_exist" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" comment="true" version="1">
9999
<object object_ref="oval:0:obj:5"/>
100100
</systemdunitproperty_test>
101101

102-
<!-- check if there is at least one systemd-journald.service unit it has value of Conflicts property equal to empty string -->
102+
<!-- check if there is at least one systemd-journald.service unit it has value of OscapTestingProperty property equal to empty string -->
103103
<systemdunitproperty_test id="oval:0:tst:6" check="all" check_existence="at_least_one_exists" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" comment="false" version="1">
104104
<object object_ref="oval:0:obj:5"/>
105105
<state state_ref="oval:0:ste:4"/>
@@ -145,7 +145,7 @@
145145

146146
<systemdunitproperty_object id="oval:0:obj:5" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
147147
<unit>systemd-journald.service</unit>
148-
<property>Conflicts</property>
148+
<property>OscapTestingProperty</property>
149149
</systemdunitproperty_object>
150150

151151
<systemdunitproperty_object id="oval:0:obj:6" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">

tests/probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@
8787
<state state_ref="oval:0:ste:3"/>
8888
</systemdunitproperty_test>
8989

90-
<!-- check that there doesn't exist systemd-journald.service unit with valid Conflicts property -->
90+
<!-- check that there doesn't exist systemd-journald.service unit with valid OscapTestingProperty property -->
9191
<systemdunitproperty_test id="oval:0:tst:5" check="all" check_existence="none_exist" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" comment="true" version="1">
9292
<object object_ref="oval:0:obj:5"/>
9393
</systemdunitproperty_test>
9494

95-
<!-- check if there is at least one systemd-journald.service unit it has value of Conflicts property equal to empty string -->
95+
<!-- check if there is at least one systemd-journald.service unit it has value of OscapTestingProperty property equal to empty string -->
9696
<systemdunitproperty_test id="oval:0:tst:6" check="all" check_existence="at_least_one_exists" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" comment="false" version="1">
9797
<object object_ref="oval:0:obj:5"/>
9898
<state state_ref="oval:0:ste:4"/>
@@ -132,7 +132,7 @@
132132

133133
<systemdunitproperty_object id="oval:0:obj:5" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
134134
<unit>systemd-journald.service</unit>
135-
<property>Conflicts</property>
135+
<property>OscapTestingProperty</property>
136136
</systemdunitproperty_object>
137137

138138
<systemdunitproperty_object id="oval:0:obj:6" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">

0 commit comments

Comments
 (0)