Skip to content

Commit

Permalink
Refs #38169 - add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Feb 3, 2025
1 parent 6c6953a commit 0db5fb2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/katello/rhsm_fact_parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,18 @@ def test_uname_architecture

assert 'i386', parser.architecture.name
end

def test_operatingsystem_race_condition_handling
existing_os = ::Operatingsystem.create(name: 'RedHat', major: '9', minor: '')
::Operatingsystem.expects(:find_by).twice.returns(nil)
@facts['distribution.name'] = 'Red Hat Enterprise Linux'
@facts['distribution.version'] = '9'
@facts['distribution.id'] = 'Nine'

assert_nothing_raised do
parser.operatingsystem
existing_os.destroy
end
end
end
end

0 comments on commit 0db5fb2

Please sign in to comment.