Skip to content

Commit d504e91

Browse files
committed
test: Use daemons instead of zebras to test SELinux alerts
The "zebra_write_config" boolean is no longer available in RHEL 10.
1 parent ffcef40 commit d504e91

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test/verify/check-selinux

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class TestSelinux(testlib.MachineCase):
6363

6464
# Do some local modifications
6565
m.execute("semanage fcontext --add -t samba_share_t /var/tmp/")
66-
m.execute("semanage boolean --modify --on zebra_write_config")
67-
self.allow_journal_messages("audit: type=1405 .* bool=zebra_write_config val=1 old_val=0.*")
66+
m.execute("semanage boolean --modify --on daemons_dump_core")
67+
self.allow_journal_messages("audit: type=1405 .* bool=daemons_dump_core val=1 old_val=0.*")
6868
self.allow_journal_messages(".*couldn't .* /org/fedoraproject/Setroubleshootd: GDBus.Error:org.freedesktop.DBus.Error.NoReply:.*")
6969

7070
self.login_and_go("/selinux")
@@ -91,7 +91,7 @@ class TestSelinux(testlib.MachineCase):
9191
b.wait_js_func("ph_count_check", "#selinux-alerts tbody", num_alerts - 1)
9292

9393
# wait for Modifications table to initialize
94-
b.wait_text_matches(".modifications-table", "Allow zebra.*write.*config")
94+
b.wait_text_matches(".modifications-table", "Allow.*daemons.*core")
9595

9696
# httpd_read_user_content should be off by default
9797
self.assertIn("-> off", m.execute("getsebool httpd_read_user_content"))
@@ -209,15 +209,15 @@ class TestSelinux(testlib.MachineCase):
209209

210210
b.grant_permissions("clipboard-read", "clipboard-write")
211211

212-
b.wait_visible(".pf-v5-c-data-list__cell:contains(Allow zebra)")
212+
b.wait_visible(".pf-v5-c-data-list__cell:contains(daemons to)")
213213
b.wait_visible(".pf-v5-c-data-list__cell:contains(fcontext -a -f a -t samba_share_t -r 's0' '/var/tmp/')")
214214
b.click("button:contains('View automation script')")
215215
ansible_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(2) textarea"
216216
shell_script_sel = ".automation-script-modal .pf-v5-c-modal-box__body section:nth-child(3) textarea"
217217
b.click("button:contains('Shell')")
218218
b.wait_in_text(shell_script_sel, "boolean -D")
219219
b.wait_in_text(shell_script_sel, "fcontext -D")
220-
b.wait_in_text(shell_script_sel, "boolean -m -1 zebra_write_config")
220+
b.wait_in_text(shell_script_sel, "boolean -m -1 daemons_dump_core")
221221
b.wait_in_text(shell_script_sel, "fcontext -a -f a -t samba_share_t -r 's0' '/var/tmp/'")
222222

223223
# Check ansible
@@ -233,7 +233,7 @@ class TestSelinux(testlib.MachineCase):
233233
return script
234234

235235
b.click("button:contains('Ansible')")
236-
b.wait_text_matches(ansible_script_sel, "Allow zebra.*write.*config")
236+
b.wait_text_matches(ansible_script_sel, "Allow.*daemons.*core")
237237

238238
ansible_m = self.machines["ansible_machine"]
239239
ansible_m.execute("semanage module -D")
@@ -247,11 +247,11 @@ class TestSelinux(testlib.MachineCase):
247247
self.assertEqual(local, se_after)
248248

249249
# Check that ansible is idempotent
250-
m.execute("semanage boolean --modify --off zebra_write_config")
250+
m.execute("semanage boolean --modify --off daemons_dump_core")
251251
b.reload()
252252
b.enter_page("/selinux")
253253
with b.wait_timeout(30):
254-
b.wait_visible(".pf-v5-c-data-list__cell:contains(Disallow zebra)")
254+
b.wait_text_matches(".pf-v5-c-data-list__cell:contains(daemons)", "Disallow.*daemons.*core")
255255
b.click("button:contains('View automation script')")
256256
ansible_m.write("roles/selinux/tasks/main.yml", b.text(ansible_script_sel))
257257
se_before = se_after
@@ -274,7 +274,7 @@ class TestSelinux(testlib.MachineCase):
274274
b.click('.contextMenu li:nth-child(2) button')
275275
b.wait_in_text(".xterm-accessibility-tree", "semanage import <<EOF")
276276
b.wait_in_text(".xterm-accessibility-tree", "boolean -D")
277-
b.wait_in_text(".xterm-accessibility-tree", "boolean -m -0 zebra_write_config")
277+
b.wait_in_text(".xterm-accessibility-tree", "boolean -m -0 daemons_dump_core")
278278
b.wait_in_text(".xterm-accessibility-tree", "fcontext -a -f a -t samba_share_t -r 's0' '/var/tmp/'")
279279

280280
m.execute("semanage boolean -D; semanage fcontext -D; semanage module -D")

0 commit comments

Comments
 (0)