Refactor #17354

Test for idempotent operating system creation in Puppet fact parser

Added by Dominic Cleal 4 months ago. Updated 4 months ago.

Status:Closed
Priority:Low
Assigned To:Dominic Cleal
Category:Tests
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4026
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

Description

There are small idempotency issues in the Puppet fact parser, leading to bugs such as #17335, where the OS is successfully created on the first run, but subsequent runs fail as the parser tried to recreate an existing OS.

The tests should be expanded to call importer.operatingsystem twice and to verify the OS is unchanged.


Related issues

Related to Foreman - Bug #17335: puppet_fact_parser.rb does not correctly add hosts facts ... Closed 11/15/2016

Associated revisions

Revision 1285cc0d
Added by Dominic Cleal 4 months ago

fixes #17354 - test and improve idempotency of OS fact parser

History

#1 Updated by Dominic Cleal 4 months ago

  • Related to Bug #17335: puppet_fact_parser.rb does not correctly add hosts facts whos minor number does not exist or is empty added

#2 Updated by Dominic Cleal 4 months ago

Other small issues found while expanding these tests:

  1. On the first run, the OS is an instance of Operatingsystem with the family attribute set on save by set_family, but subsequent runs return an STI subclass. The first run should also return the STI subclass.
  2. Some newer OSes are missing the refactoring from #3962, causing #class to return Operatingsystem
  3. The fact parser modifies OS release facts in the incoming hash through #gsub!

#3 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4026 added

#4 Updated by Dominic Cleal 4 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal 4 months ago

  • Release set to 1.14.0

Also available in: Atom PDF