From 9c455eeff78134cfb7bad74894736e4709902806 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Tue, 23 Jan 2024 11:31:13 +0100 Subject: [PATCH] cli oscap fix name already taken (#13856) (cherry picked from commit 5e2585abe17037eb46b1c75f0037a80df568e1a6) --- tests/foreman/cli/test_oscap.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/foreman/cli/test_oscap.py b/tests/foreman/cli/test_oscap.py index ecbc50f06de..c198e5fa636 100644 --- a/tests/foreman/cli/test_oscap.py +++ b/tests/foreman/cli/test_oscap.py @@ -286,8 +286,9 @@ def test_positive_create_scap_content_with_valid_originalfile_name( :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'original-filename': name, 'scap-file': settings.oscap.content_path} + {'original-filename': name, 'scap-file': settings.oscap.content_path, 'title': title} ) assert scap_content['original-filename'] == name @@ -406,8 +407,9 @@ def test_positive_delete_scap_content_with_id(self, module_target_sat): :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'scap-file': settings.oscap.content_path} + {'scap-file': settings.oscap.content_path, 'title': title} ) module_target_sat.cli.Scapcontent.delete({'id': scap_content['id']}) with pytest.raises(CLIReturnCodeError): @@ -436,8 +438,9 @@ def test_positive_delete_scap_content_with_title(self, module_target_sat): :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'scap-file': settings.oscap.content_path} + {'scap-file': settings.oscap.content_path, 'title': title} ) module_target_sat.cli.Scapcontent.delete({'title': scap_content['title']}) with pytest.raises(CLIReturnCodeError):