def test_positive_download_tailoring_file(self):
        """ Download the tailoring file from satellite

        :id: 75d8c810-19a7-4285-bc3a-a1fb1a0e9088

        :steps:

            1.Create valid tailoring file with valid name
            2.Execute "tailoring-file" command with "download" as sub-command

        :expectedresults: The tailoring file should be downloaded

        BZ: 1857572

        :CaseImportance: Critical
        """
        name = gen_string('alphanumeric')
        file_path = f'/var/{self.tailoring_file_path}'
        tailoring_file = make_tailoringfile({
            'name':
            name,
            'scap-file':
            self.tailoring_file_path
        })
        assert tailoring_file['name'] == name
        result = TailoringFiles.download_tailoring_file({
            'name': name,
            'path': '/var/tmp/'
        })
        assert file_path in result[0]
        result = ssh.command(f'find {file_path} 2> /dev/null')
        assert result.return_code == 0
        assert file_path == result.stdout[0]
    def test_positive_download_tailoring_file(self):

        """ Download the tailoring file from satellite

        :id: 75d8c810-19a7-4285-bc3a-a1fb1a0e9088

        :steps:

            1.Create valid tailoring file with valid name
            2.Execute "tailoring-file" command with "download" as sub-command

        :expectedresults: The tailoring file should be downloaded

        :CaseImportance: Critical
        """
        name = gen_string('alphanumeric')
        file_path = '/tmp/{0}.xml'.format(name)
        tailoring_file = make_tailoringfile({
            'name': name,
            'scap-file': '/tmp/{0}'.format(self.file_name)})
        self.assertEqual(tailoring_file['name'], name)
        result = TailoringFiles.download_tailoring_file({
            'name': name,
            'path': '/tmp/'
        })
        self.assertIn(file_path, result[0])
        result = ssh.command('find {0}'.format(file_path))
        self.assertEqual(result.return_code, 0)
        self.assertIn(file_path, result.stdout)
Beispiel #3
0
    def test_positive_download_tailoring_file(self, tailoring_file_path,
                                              target_sat):
        """Download the tailoring file from satellite

        :id: 75d8c810-19a7-4285-bc3a-a1fb1a0e9088

        :steps:

            1.Create valid tailoring file with valid name
            2.Execute "tailoring-file" command with "download" as sub-command

        :expectedresults: The tailoring file should be downloaded

        BZ: 1857572

        :CaseImportance: Medium
        """
        name = gen_string('alphanumeric')
        file_path = f'/var{tailoring_file_path["satellite"]}'
        tailoring_file = make_tailoringfile({
            'name':
            name,
            'scap-file':
            tailoring_file_path['satellite']
        })
        assert tailoring_file['name'] == name
        result = TailoringFiles.download_tailoring_file({
            'name': name,
            'path': '/var/tmp/'
        })
        assert file_path in result
        result = target_sat.execute(f'find {file_path} 2> /dev/null')
        assert result.status == 0
        assert file_path == result.stdout.strip()
Beispiel #4
0
    def test_positive_download_tailoring_file(self):

        """ Download the tailoring file from satellite

        :id: 75d8c810-19a7-4285-bc3a-a1fb1a0e9088

        :steps:

            1.Create valid tailoring file with valid name
            2.Execute "tailoring-file" command with "download" as sub-command

        :expectedresults: The tailoring file should be downloaded

        :CaseImportance: Critical
        """
        name = gen_string('alphanumeric')
        file_path = '/tmp/{0}.xml'.format(name)
        tailoring_file = make_tailoringfile({
            'name': name,
            'scap-file': '/tmp/{0}'.format(self.file_name)})
        self.assertEqual(tailoring_file['name'], name)
        result = TailoringFiles.download_tailoring_file({
            'name': name,
            'path': '/tmp/'
        })
        self.assertIn(file_path, result[0])
        result = ssh.command('find {0}'.format(file_path))
        self.assertEqual(result.return_code, 0)
        self.assertIn(file_path, result.stdout)