Esempio n. 1
0
    def setUpClass(cls):
        super(PermissionTestCase, cls).setUpClass()
        cls.permissions = PERMISSIONS.copy()
        if get_server_software() == 'upstream':
            cls.permissions[None].extend(cls.permissions.pop('DiscoveryRule'))
            cls.permissions[None].remove('app_root')
            cls.permissions[None].remove('attachments')
            cls.permissions[None].remove('configuration')
            cls.permissions[None].remove('logs')
            cls.permissions[None].remove('view_cases')
            cls.permissions[None].remove('view_log_viewer')

        result = ssh.command('rpm -qa | grep rubygem-foreman_openscap')
        if result.return_code != 0:
            cls.permissions.pop('ForemanOpenscap::Policy')
            cls.permissions.pop('ForemanOpenscap::ScapContent')
            cls.permissions[None].remove('destroy_arf_reports')
            cls.permissions[None].remove('view_arf_reports')
            cls.permissions[None].remove('create_arf_reports')
        result = ssh.command('rpm -qa | grep rubygem-foreman_remote_execution')
        if result.return_code != 0:
            cls.permissions.pop('JobInvocation')
            cls.permissions.pop('JobTemplate')
            cls.permissions.pop('RemoteExecutionFeature')
            cls.permissions.pop('TemplateInvocation')

        #: e.g. ['Architecture', 'Audit', 'AuthSourceLdap', …]
        cls.permission_resource_types = list(cls.permissions.keys())
        #: e.g. ['view_architectures', 'create_architectures', …]
        cls.permission_names = list(
            chain.from_iterable(cls.permissions.values()))
Esempio n. 2
0
    def setUpClass(cls):
        super(PermissionTestCase, cls).setUpClass()
        cls.permissions = PERMISSIONS.copy()
        if get_server_software() == 'upstream':
            cls.permissions[None].extend(cls.permissions.pop('DiscoveryRule'))
            cls.permissions[None].remove('app_root')
            cls.permissions[None].remove('attachments')
            cls.permissions[None].remove('configuration')
            cls.permissions[None].remove('logs')
            cls.permissions[None].remove('view_cases')
            cls.permissions[None].remove('view_log_viewer')
            cls.permissions[None].remove('view_search')

        result = ssh.command('rpm -qa | grep rubygem-foreman_openscap')
        if result.return_code != 0:
            cls.permissions.pop('ForemanOpenscap::Policy')
            cls.permissions.pop('ForemanOpenscap::ScapContent')
            cls.permissions[None].remove('destroy_arf_reports')
            cls.permissions[None].remove('view_arf_reports')
            cls.permissions[None].remove('create_arf_reports')

        #: e.g. ['Architecture', 'Audit', 'AuthSourceLdap', …]
        cls.permission_resource_types = list(cls.permissions.keys())
        #: e.g. ['view_architectures', 'create_architectures', …]
        cls.permission_names = list(
            chain.from_iterable(cls.permissions.values()))
Esempio n. 3
0
    def test_positive_foreman_version(self):
        """Check if /usr/share/foreman/VERSION does not contain the
        develop tag.

        @Feature: Smoke Test

        @Assert: The file content does not have the develop tag.

        """
        result = ssh.command('cat /usr/share/foreman/VERSION')
        self.assertEqual(result.return_code, 0)

        if get_server_software() == 'downstream':
            self.assertNotIn('develop', u''.join(result.stdout))
        else:
            self.assertIn('develop', u''.join(result.stdout))
Esempio n. 4
0
    def test_foreman_version(self):
        """@Test: Check if /usr/share/foreman/VERSION does not contain the
        develop tag.

        @Feature: Smoke Test

        @Assert: The file content does not have the develop tag.

        """
        result = ssh.command('cat /usr/share/foreman/VERSION')
        self.assertEqual(result.return_code, 0)

        if get_server_software() == 'downstream':
            self.assertNotIn('develop', u''.join(result.stdout))
        else:
            self.assertIn('develop', u''.join(result.stdout))
Esempio n. 5
0
    def setUpClass(cls):
        super(PermissionTestCase, cls).setUpClass()
        cls.permissions = PERMISSIONS.copy()
        if get_server_software() == 'upstream':
            cls.permissions[None].extend(cls.permissions.pop('DiscoveryRule'))
            cls.permissions[None].remove('app_root')
            cls.permissions[None].remove('attachments')
            cls.permissions[None].remove('configuration')
            cls.permissions[None].remove('logs')
            cls.permissions[None].remove('view_cases')
            cls.permissions[None].remove('view_log_viewer')
            cls.permissions[None].remove('view_search')

        #: e.g. ['Architecture', 'Audit', 'AuthSourceLdap', …]
        cls.permission_resource_types = list(cls.permissions.keys())
        #: e.g. ['view_architectures', 'create_architectures', …]
        cls.permission_names = list(
            chain.from_iterable(cls.permissions.values()))
Esempio n. 6
0
    def setUpClass(cls):
        super(PermissionsTestCase, cls).setUpClass()
        cls.permissions = PERMISSIONS.copy()
        if get_server_software() == 'upstream':
            cls.permissions[None].extend(cls.permissions.pop('DiscoveryRule'))
            cls.permissions[None].remove('app_root')
            cls.permissions[None].remove('attachments')
            cls.permissions[None].remove('configuration')
            cls.permissions[None].remove('logs')
            cls.permissions[None].remove('view_cases')
            cls.permissions[None].remove('view_log_viewer')
            cls.permissions[None].remove('view_search')

        #: e.g. ['Architecture', 'Audit', 'AuthSourceLdap', …]
        cls.permission_resource_types = list(cls.permissions.keys())
        #: e.g. ['view_architectures', 'create_architectures', …]
        cls.permission_names = list(
            chain.from_iterable(cls.permissions.values()))