Project

General

Profile

Actions

Bug #9044

closed

Tests can fail randomly on mac.succ

Added by Marek Hulán over 9 years ago. Updated over 6 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

Also available in: Atom PDF