@@ -720,66 +720,3 @@ def test_positive_reporting_emails_of_oscap_reports():
720720
721721 :CaseAutomation: NotAutomated
722722 """
723-
724-
725- @pytest .mark .rhel_ver_list ([8 ])
726- def test_positive_oscap_run_via_local_files (
727- module_org , default_proxy , lifecycle_env , target_sat , rex_contenthost
728- ):
729- """End-to-End Oscap run via local files deployed with ansible
730-
731- :id: 0dde5893-540c-4e03-a206-55fccdb2b9ca
732-
733- :parametrized: yes
734-
735- :customerscenario: true
736-
737- :setup: scap content, scap policy, Remote execution
738-
739- :steps:
740-
741- 1. Create a valid scap content
742- 2. Import Ansible role theforeman.foreman_scap_client
743- 3. Create a scap policy with ansible as deploy option
744- 4. Associate the policy with a hostgroup
745- 5. Run the Ansible job and then trigger the Oscap job.
746- 6. Oscap must Utilize the local files for the client scan.
747-
748- :expectedresults: Oscap run should happen using the --localfile argument.
749-
750- :BZ: 2081777,2211952
751-
752- :CaseImportance: Critical
753- """
754- contenthost = rex_contenthost
755- prepare_scap_client_and_prerequisites (
756- target_sat , contenthost , module_org , default_proxy , lifecycle_env
757- )
758-
759- file_name = 'security-data-oval-com.redhat.rhsa-RHEL8.xml.bz2'
760- download_url = 'https://www.redhat.com/security/data/oval/v2/RHEL8/rhel-8.oval.xml.bz2'
761-
762- # The file here needs to be present on the client in order
763- # to perform the scan from the local-files.
764- contenthost .execute (f'curl -o { file_name } { download_url } ' )
765-
766- # Apply policy
767- job_id = target_sat .cli .Host .ansible_roles_play ({'name' : contenthost .hostname .lower ()})[0 ].get (
768- 'id'
769- )
770- target_sat .wait_for_tasks (
771- f'resource_type = JobInvocation and resource_id = { job_id } and action ~ "hosts job"'
772- )
773- try :
774- result = target_sat .cli .JobInvocation .info ({'id' : job_id })['success' ]
775- assert result == '1'
776- except AssertionError as err :
777- output = ' ' .join (
778- target_sat .cli .JobInvocation .get_output ({'id' : job_id , 'host' : contenthost .hostname })
779- )
780- result = f'host output: { output } '
781- raise AssertionError (result ) from err
782-
783- assert contenthost .run ('grep profile /etc/foreman_scap_client/config.yaml' ).status == 0
784- result = contenthost .execute_foreman_scap_client ()
785- assert f"WARNING: Using local file '/root/{ file_name } '" in result
0 commit comments