pulp_2_tests.tests.platform.cli.test_selinux

Location: Pulp 2 TestsTestspulp_2_tests.tests.platform.cli.test_selinux

Tests to verify that Pulp has proper SELinux permissions.

pulp_2_tests.tests.platform.cli.test_selinux.CELERY_LABEL = ':system_r:celery_t:s0'

A label commonly applied to celery processes.

The “user” segment of the label is intentionally omitted, as it is known to vary. See Pulp Smash #444 (comment).

class pulp_2_tests.tests.platform.cli.test_selinux.FileLabelsTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test that files have correct SELinux labels.

This test case targets Pulp Smash #442.

classmethod setUpClass()

Create a CLI client.

test_pulp_celery_fc()

Test files listed in pulp-celery.fc.

test_pulp_server_fc()

Test files listed in pulp-server.fc.

test_pulp_streamer_fc()

Test files listed in pulp-streamer.fc.

pulp_2_tests.tests.platform.cli.test_selinux.HTTPD_LABEL = ':system_r:httpd_t:s0'

A label commonly applied to httpd processes.

The “user” segment of the label is intentionally omitted, as it is known to vary. See Pulp Smash #444 (comment).

pulp_2_tests.tests.platform.cli.test_selinux.PS_FIELDS = ('label', 'args')

The fields that ps should display. See man ps for details.

class pulp_2_tests.tests.platform.cli.test_selinux.Process(label, args)

Bases: tuple

A single line of output from ps.

args

Alias for field number 1

label

Alias for field number 0

class pulp_2_tests.tests.platform.cli.test_selinux.ProcessLabelsTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test that Pulp processes have correct SELinux labels.

This test case targets Pulp Smash #444.

classmethod setUpClass()

Get all of the processes running on the target Pulp system.

test_celerybeat()

Verify the label of the Pulp celerybeat process.

It should have a label of CELERY_LABEL.

test_httpd()

Verify the labels of the wsgi:pulp* processes.

They should have a label of HTTPD_LABEL.

test_reserved_resource_worker_0()

Verify the labels of the reserved_resource_worker-0 processes.

They should have a label of CELERY_LABEL.

test_resource_manager()

Verify the labels of the resource_manager processes.

They should have a label of CELERY_LABEL.

pulp_2_tests.tests.platform.cli.test_selinux.setUpModule()

Skip tests if the requirements are not met.

Skipped if either default platform requirements aren’t met or selinux is disabled by user config.