Skip to content

Commit 2d6a4b5

Browse files
authored
Remove selinux context test as its already covered in the unit test (SatelliteQE#22236)
1 parent 600d953 commit 2d6a4b5

1 file changed

Lines changed: 0 additions & 63 deletions

File tree

tests/foreman/installer/test_installer.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -514,69 +514,6 @@ def test_positive_selinux_foreman_module(target_sat):
514514
assert semodule_result.status == 0
515515

516516

517-
@pytest.mark.upgrade
518-
def test_positive_apache_selinux_context(target_sat):
519-
"""Check if Apache module config files have correct SELinux context
520-
521-
:id: 8f7a9b2c-4d3e-4f5a-9c8b-7a6d5e4f3c2b
522-
523-
:steps:
524-
1. Check existing Apache module config files in /etc/httpd/conf.modules.d/
525-
2. Verify all config files have httpd_config_t SELinux context
526-
3. Create a test file using Puppet without seltype parameter
527-
4. Verify the test file automatically gets httpd_config_t context
528-
529-
:expectedresults:
530-
1. All Apache module config files have httpd_config_t context
531-
2. No files have incorrect etc_t context
532-
3. Files created by Puppet automatically get httpd_config_t context
533-
534-
:CaseImportance: Medium
535-
536-
:customerscenario: true
537-
538-
:Verifies: SAT-30020
539-
"""
540-
result = target_sat.execute('ls -1Z /etc/httpd/conf.modules.d/*.conf')
541-
assert result.status == 0, "Failed to list Apache module config files"
542-
543-
config_files = result.stdout.strip().split('\n')
544-
assert len(config_files) > 0, "No Apache config files found"
545-
546-
incorrect_files = []
547-
for line in config_files:
548-
if line and ':httpd_config_t:' not in line:
549-
incorrect_files.append(line)
550-
551-
assert not incorrect_files, (
552-
f"Found {len(incorrect_files)} Apache config file(s) with incorrect SELinux context:\n"
553-
+ '\n'.join(incorrect_files)
554-
)
555-
556-
puppet_manifest = """
557-
file { '/etc/httpd/conf.modules.d/99-selinux-test.conf':
558-
ensure => file,
559-
content => "# Test file for SELinux context verification\\n",
560-
mode => '0644',
561-
owner => 'root',
562-
group => 'root',
563-
}
564-
"""
565-
target_sat.put(puppet_manifest, '/tmp/test_selinux.pp', temp_file=True)
566-
target_sat.execute('rm -f /etc/httpd/conf.modules.d/99-selinux-test.conf')
567-
568-
result = target_sat.execute('puppet apply /tmp/test_selinux.pp')
569-
assert result.status == 0, f"Puppet apply failed: {result.stdout}"
570-
571-
result = target_sat.execute('ls -1Z /etc/httpd/conf.modules.d/99-selinux-test.conf')
572-
assert result.status == 0, "Failed to check test file SELinux context"
573-
assert ':httpd_config_t:' in result.stdout, (
574-
f"Test file has incorrect SELinux context. Expected :httpd_config_t::\n{result.stdout}"
575-
)
576-
577-
target_sat.execute('rm -f /etc/httpd/conf.modules.d/99-selinux-test.conf')
578-
579-
580517
@pytest.mark.upgrade
581518
@pytest.mark.parametrize('service', SATELLITE_SERVICES)
582519
def test_positive_check_installer_service_running(target_sat, service):

0 commit comments

Comments
 (0)