Tests for 'NetworkConfigurationValidator. prepare_data' fail from time to time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Committed
|
High
|
Ihor Kalnytskyi |
Bug Description
Unit tests for 'NetworkConfigu
2015-10-30 12:48:40.986 | TestNetworkConf
2015-10-30 12:48:40.987 | [gw1] linux2 -- Python 2.7.6 /home/jenkins/
2015-10-30 12:48:40.987 | self = <nailgun.
2015-10-30 12:48:40.987 |
2015-10-30 12:48:40.987 | def test_networks_
2015-10-30 12:48:40.987 | self.nc[
2015-10-30 12:48:40.987 | > self.assertRais
2015-10-30 12:48:40.987 |
2015-10-30 12:48:40.987 | nailgun/
2015-10-30 12:48:40.988 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2015-10-30 12:48:40.988 | nailgun/
2015-10-30 12:48:40.988 | context = self.get_
2015-10-30 12:48:40.988 | ../.tox/
2015-10-30 12:48:40.988 | return func(*args, **keywargs)
2015-10-30 12:48:40.988 | nailgun/
2015-10-30 12:48:40.988 | get_invalid_
2015-10-30 12:48:40.988 | nailgun/
2015-10-30 12:48:40.989 | self.validator(
2015-10-30 12:48:40.989 | nailgun/
2015-10-30 12:48:40.989 | data = cls.base_
2015-10-30 12:48:40.989 | nailgun/
2015-10-30 12:48:40.989 | valid_data = cls.prepare_
2015-10-30 12:48:40.989 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2015-10-30 12:48:40.989 |
2015-10-30 12:48:40.989 | cls = <class 'nailgun.
2015-10-30 12:48:40.989 | data = {'networks': [{'cidr': '172.16.0.0/24', 'gateway': '172.16.0.1', 'group_id': 1, 'ip_ranges': [['172.16.0.2', '172.16.0.126']], ...}]}
2015-10-30 12:48:40.990 |
2015-10-30 12:48:40.990 | @classmethod
2015-10-30 12:48:40.990 | def prepare_data(cls, data):
2015-10-30 12:48:40.990 | """Prepares input data.
2015-10-30 12:48:40.990 |
2015-10-30 12:48:40.990 | Filter input data based on the fact that
2015-10-30 12:48:40.990 | updating parameters of the fuel admin network
2015-10-30 12:48:40.990 | is forbidden for default node group.
2015-10-30 12:48:40.990 |
2015-10-30 12:48:40.990 | Admin network cannot be updated because of:
2015-10-30 12:48:40.991 | - sharing itself between environments;
2015-10-30 12:48:40.991 | - having no mechanism to change its parameters on deployed Master node.
2015-10-30 12:48:40.991 | """
2015-10-30 12:48:40.991 | if data.get(
2015-10-30 12:48:40.991 | default_admin = db.query(
2015-10-30 12:48:40.991 | NetworkGroup)
2015-10-30 12:48:40.991 | data["networks"] = [
2015-10-30 12:48:40.991 | n for n in data["networks"]
2015-10-30 12:48:40.991 | > if n.get("id") != default_admin.id
2015-10-30 12:48:40.991 | ]
2015-10-30 12:48:40.991 | E AttributeError: 'NoneType' object has no attribute 'id'
Full console output can be found in the attachment.
tags: | added: tech-debt |
Changed in fuel: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Igor Kalnitsky (ikalnitsky) |
milestone: | none → 8.0 |
no longer affects: | mos |
The problem is that tests don't prepare DB state before running validator. In this particular case we rely on default (shared) admin network existance in the database, but it may not exist. It depends on test order.