Exemple #1
0
    def test_positive_list_default_content_with_admin(self):
        """List the default scap content with admin account

        :id: 32c41c22-6aef-424e-8e69-a65c00f1c811

        :setup:

            1. Oscap should be enabled.
            2. Default content should already be populated.
            3. Oscap-cli hammer plugin installed.

        :steps:

            1. Login to shell from admin account.
            2. Execute the scap-content command with list as sub-command.

        :expectedresults: The scap-content are listed.

        :CaseImportance: Critical
        """
        result = Scapcontent.list()
        self.assertIn(
            OSCAP_DEFAULT_CONTENT['rhel7_content'],
            [scap['title'] for scap in result]
        )
Exemple #2
0
    def test_positive_list_default_content_with_admin(self):
        """List the default scap content with admin account

        :id: 32c41c22-6aef-424e-8e69-a65c00f1c811

        :setup:

            1. Oscap should be enabled.
            2. Default content should already be populated.
            3. Oscap-cli hammer plugin installed.

        :steps:

            1. Login to shell from admin account.
            2. Execute the scap-content command with list as sub-command.

        :expectedresults: Default scap-content are listed.

        :BZ: 1749692

        :customerscenario: true

        :CaseImportance: Critical
        """
        scap_contents = [content['title'] for content in Scapcontent.list()]
        for title in OSCAP_DEFAULT_CONTENT.values():
            assert title in scap_contents
Exemple #3
0
    def test_positive_list_default_content_with_admin(self):
        """List the default scap content with admin account

        :id: 32c41c22-6aef-424e-8e69-a65c00f1c811

        :setup:

            1. Oscap should be enabled.
            2. Default content should already be populated.
            3. Oscap-cli hammer plugin installed.

        :steps:

            1. Login to shell from admin account.
            2. Execute the scap-content command with list as sub-command.

        :expectedresults: The scap-content are listed.

        :CaseImportance: Critical
        """
        result = Scapcontent.list()
        self.assertIn(
            OSCAP_DEFAULT_CONTENT['rhel7_content'],
            [scap['title'] for scap in result]
        )
Exemple #4
0
 def setUpClass(cls):
     super(OpenScapTestCase, cls).setUpClass()
     cls.title = gen_string('alpha')
     result = [scap['title'] for scap in Scapcontent.list() if scap.get('title') in cls.title]
     if not result:
         make_scapcontent({'title': cls.title, 'scap-file': settings.oscap.content_path})
     cls.scap_id_rhel7, cls.scap_profile_id_rhel7 = cls.fetch_scap_and_profile_id(
         cls.title, OSCAP_PROFILE['security7']
     )
     cls.tailoring_file_path = file_downloader(
         file_url=settings.oscap.tailoring_path, hostname=settings.server.hostname
     )[0]
     Ansible.roles_import({'proxy-id': 1})
     Ansible.variables_import({'proxy-id': 1})
Exemple #5
0
 def setUpClass(cls):
     super(OpenScapTestCase, cls).setUpClass()
     _, cls.file_name = os.path.split(settings.oscap.content_path)
     # uploads the scap content to satellite
     ssh.upload_file(local_file=settings.oscap.content_path,
                     remote_file="/tmp/{0}".format(cls.file_name))
     cls.title = 'rhel-6-content'
     result = [
         scap['title'] for scap in Scapcontent.list()
         if scap.get('title') in cls.title
     ]
     if not result:
         make_scapcontent({
             'title': cls.title,
             'scap-file': '/tmp/{0}'.format(cls.file_name)
         })
     cls.scap_id_rhel6, cls.scap_profile_id_rhel6 = (
         cls.fetch_scap_and_profile_id(cls.title, OSCAP_PROFILE['common']))
Exemple #6
0
 def setUpClass(cls):
     super(OpenScapTestCase, cls).setUpClass()
     _, cls.file_name = os.path.split(settings.oscap.content_path)
     # uploads the scap content to satellite
     ssh.upload_file(local_file=settings.oscap.content_path,
                     remote_file="/tmp/{0}".format(cls.file_name))
     cls.title = gen_string('alpha')
     result = [
         scap['title'] for scap in Scapcontent.list()
         if scap.get('title') in cls.title
     ]
     if not result:
         make_scapcontent({
             'title': cls.title,
             'scap-file': '/tmp/{0}'.format(cls.file_name)
         })
     cls.scap_id_rhel6, cls.scap_profile_id_rhel6 = (
         cls.fetch_scap_and_profile_id(cls.title,
                                       OSCAP_PROFILE['security6']))
     Ansible.roles_import({'proxy-id': 1})
     Ansible.variables_import({'proxy-id': 1})
Exemple #7
0
 def setUpClass(cls):
     super(OpenScapTestCase, cls).setUpClass()
     _, cls.file_name = os.path.split(settings.oscap.content_path)
     # uploads the scap content to satellite
     ssh.upload_file(
         local_file=settings.oscap.content_path,
         remote_file="/tmp/{0}".format(cls.file_name)
     )
     cls.title = 'rhel-6-content'
     result = [scap['title'] for scap in Scapcontent.list() if
               scap.get('title') in cls.title]
     if not result:
         make_scapcontent({
             'title': cls.title,
             'scap-file': '/tmp/{0}'.format(cls.file_name)
         })
     cls.scap_id_rhel6, cls.scap_profile_id_rhel6 = (
         cls.fetch_scap_and_profile_id(
             cls.title,
             OSCAP_PROFILE['common']
         )
     )