Project

General

Profile

Actions

Bug #9044

closed

Tests can fail randomly on mac.succ

Added by Marek Hulán about 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In some tests we use mac.succ to get next new address in order to test mac change. The original mac is generated by factory girl sequence so with more tests using this factory girl the mac changes in tests. When we get mac ending with '...:.f' and we call succ we get invalid mac containing 'g'. It causes hard to debug issues since when we validate host we normalize the mac (see validations.rb) which does not match invalid mac resulting in nilifying the attribute.

To illustrate

host.mac = host.mac.succ
host.mac.present? # => true
host.valid?       # host.mac is nil now, causing validations errors

I'll change tests to correctly increment mac address and I'll change the mac normalization method to handle "else" in case.


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #9195: MAC address validator raises an error if MAC is invalid instead of recording an error in validated objectClosedMarek Hulán02/03/2015Actions
Blocks Foreman - Bug #8052: Smart class parameters with ERB snippets are broken for other that String typesClosedMarek Hulán10/23/2014Actions
Actions #1

Updated by Marek Hulán about 9 years ago

  • Status changed from New to Assigned
Actions #2

Updated by The Foreman Bot about 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2097 added
  • Pull request deleted ()
Actions #3

Updated by Dominic Cleal about 9 years ago

  • Blocks Bug #8052: Smart class parameters with ERB snippets are broken for other that String types added
Actions #4

Updated by Dominic Cleal about 9 years ago

  • translation missing: en.field_release set to 30
Actions #5

Updated by Marek Hulán about 9 years ago

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

Updated by Dominic Cleal about 9 years ago

  • translation missing: en.field_release changed from 30 to 32
Actions #7

Updated by Dominic Cleal about 9 years ago

  • Related to Bug #9195: MAC address validator raises an error if MAC is invalid instead of recording an error in validated object added
Actions

Also available in: Atom PDF