Merge ~adam-collard/maas:flaky-node-constraint-filter-tests into maas:master

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: bef77946199e427174cfca6e9c0f78395baf9b21
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas:flaky-node-constraint-filter-tests
Merge into: maas:master
Diff against target: 164 lines (+44/-18)
1 file modified
src/maasserver/tests/test_node_constraint_filter_forms.py (+44/-18)
Reviewer Review Type Date Requested Status
MAAS Lander Needs Fixing
Alberto Donato (community) Approve
Review via email: mp+405306@code.launchpad.net

Commit message

Request block devices that are big enough to be bootable in tests

Avoids 'interesting' block devices being picked as boot device and then
failing validation.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) wrote :

+1

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b flaky-node-constraint-filter-tests lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/10407/consoleText

Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b flaky-node-constraint-filter-tests lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/10411/consoleText

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b flaky-node-constraint-filter-tests lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/10412/console
COMMIT: bef77946199e427174cfca6e9c0f78395baf9b21

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/tests/test_node_constraint_filter_forms.py b/src/maasserver/tests/test_node_constraint_filter_forms.py
2index 2be483c..08c071a 100644
3--- a/src/maasserver/tests/test_node_constraint_filter_forms.py
4+++ b/src/maasserver/tests/test_node_constraint_filter_forms.py
5@@ -835,18 +835,22 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
6
7 def test_storage_matches_disk_with_root_mount_on_disk(self):
8 node1 = factory.make_Node(with_boot_disk=False)
9- factory.make_PhysicalBlockDevice(node=node1)
10+ factory.make_PhysicalBlockDevice(node=node1, bootable=True)
11 block_device = factory.make_PhysicalBlockDevice(node=node1)
12 factory.make_Filesystem(mount_point="/", block_device=block_device)
13 node2 = factory.make_Node(with_boot_disk=False)
14- factory.make_PhysicalBlockDevice(node=node2)
15+ factory.make_PhysicalBlockDevice(node=node2, bootable=True)
16 self.assertConstrainedNodes([node1], {"storage": "0"})
17
18 def test_storage_matches_disk_with_root_mount_on_partition(self):
19 node1 = factory.make_Node(with_boot_disk=False)
20- factory.make_PhysicalBlockDevice(node=node1, formatted_root=True)
21+ factory.make_PhysicalBlockDevice(
22+ node=node1, formatted_root=True, bootable=True
23+ )
24 node2 = factory.make_Node(with_boot_disk=False)
25- block_device = factory.make_PhysicalBlockDevice(node=node2)
26+ block_device = factory.make_PhysicalBlockDevice(
27+ node=node2, bootable=True
28+ )
29 partition_table = factory.make_PartitionTable(
30 block_device=block_device
31 )
32@@ -856,14 +860,18 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
33
34 def test_storage_matches_partition_with_root_mount(self):
35 node1 = factory.make_Node(with_boot_disk=False)
36- block_device = factory.make_PhysicalBlockDevice(node=node1)
37+ block_device = factory.make_PhysicalBlockDevice(
38+ node=node1, bootable=True
39+ )
40 partition_table = factory.make_PartitionTable(
41 block_device=block_device
42 )
43 partition = factory.make_Partition(partition_table=partition_table)
44 factory.make_Filesystem(mount_point="/", partition=partition)
45 node2 = factory.make_Node(with_boot_disk=False)
46- block_device2 = factory.make_PhysicalBlockDevice(node=node2)
47+ block_device2 = factory.make_PhysicalBlockDevice(
48+ node=node2, bootable=True
49+ )
50 partition_table2 = factory.make_PartitionTable(
51 block_device=block_device2
52 )
53@@ -898,17 +906,19 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
54 def test_storage_single_contraint_matches_on_tags(self):
55 node1 = factory.make_Node(with_boot_disk=False)
56 factory.make_PhysicalBlockDevice(
57- node=node1, tags=["ssd"], formatted_root=True
58+ node=node1, tags=["ssd"], formatted_root=True, bootable=True
59 )
60 node2 = factory.make_Node(with_boot_disk=False)
61 factory.make_PhysicalBlockDevice(
62- node=node2, tags=["rotary"], formatted_root=True
63+ node=node2, tags=["rotary"], formatted_root=True, bootable=True
64 )
65 self.assertConstrainedNodes([node1], {"storage": "0(ssd)"})
66
67 def test_storage_single_constraint_matches_with_tags(self):
68 node1 = factory.make_Node(with_boot_disk=False)
69- block_device = factory.make_PhysicalBlockDevice(node=node1)
70+ block_device = factory.make_PhysicalBlockDevice(
71+ node=node1, bootable=True
72+ )
73 partition_table = factory.make_PartitionTable(
74 block_device=block_device
75 )
76@@ -917,7 +927,9 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
77 )
78 factory.make_Filesystem(mount_point="/", partition=partition)
79 node2 = factory.make_Node(with_boot_disk=False)
80- block_device2 = factory.make_PhysicalBlockDevice(node=node2)
81+ block_device2 = factory.make_PhysicalBlockDevice(
82+ node=node2, bootable=True
83+ )
84 partition_table2 = factory.make_PartitionTable(
85 block_device=block_device2
86 )
87@@ -990,7 +1002,9 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
88
89 def test_storage_multi_contraint_matches_physical_and_unused(self):
90 node1 = factory.make_Node(with_boot_disk=False)
91- factory.make_PhysicalBlockDevice(node=node1, formatted_root=True)
92+ factory.make_PhysicalBlockDevice(
93+ node=node1, formatted_root=True, bootable=True
94+ )
95 # 1gb, 2gb, 3gb block device
96 factory.make_PhysicalBlockDevice(node=node1, size=1 * (1000 ** 3))
97 factory.make_PhysicalBlockDevice(node=node1, size=2 * (1000 ** 3))
98@@ -1040,13 +1054,17 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
99
100 def test_storage_multi_contraint_matches_partition_unused(self):
101 node1 = factory.make_Node(with_boot_disk=False)
102- factory.make_PhysicalBlockDevice(node=node1, formatted_root=True)
103+ factory.make_PhysicalBlockDevice(
104+ node=node1, formatted_root=True, bootable=True
105+ )
106 # 1gb, 2gb, 3gb block device
107 factory.make_PhysicalBlockDevice(node=node1, size=1 * (1000 ** 3))
108 factory.make_PhysicalBlockDevice(node=node1, size=2 * (1000 ** 3))
109 factory.make_PhysicalBlockDevice(node=node1, size=3 * (1000 ** 3))
110 node2 = factory.make_Node(with_boot_disk=False)
111- factory.make_PhysicalBlockDevice(node=node2, formatted_root=True)
112+ factory.make_PhysicalBlockDevice(
113+ node=node2, formatted_root=True, bootable=True
114+ )
115 # 5gb, 6gb, 7gb block device
116 factory.make_PhysicalBlockDevice(node=node2, size=5 * (1000 ** 3))
117 factory.make_PhysicalBlockDevice(node=node2, size=6 * (1000 ** 3))
118@@ -1059,13 +1077,17 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
119 )
120 factory.make_Filesystem(mount_point="/srv", partition=used_partition)
121 node3 = factory.make_Node(with_boot_disk=False)
122- factory.make_PhysicalBlockDevice(node=node3, formatted_root=True)
123+ factory.make_PhysicalBlockDevice(
124+ node=node3, formatted_root=True, bootable=True
125+ )
126 # 8gb, 9gb, 10gb block device
127 factory.make_PhysicalBlockDevice(node=node3, size=8 * (1000 ** 3))
128 factory.make_PhysicalBlockDevice(node=node3, size=9 * (1000 ** 3))
129 factory.make_PhysicalBlockDevice(node=node3, size=10 * (1000 ** 3))
130 # node3: un-used partition on block device
131- block_device = factory.make_PhysicalBlockDevice(node=node3)
132+ block_device = factory.make_PhysicalBlockDevice(
133+ node=node3, bootable=True
134+ )
135 partition_table = factory.make_PartitionTable(
136 block_device=block_device
137 )
138@@ -1081,7 +1103,7 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
139 def test_storage_multi_contraint_matches_on_tags(self):
140 node1 = factory.make_Node(with_boot_disk=False)
141 factory.make_PhysicalBlockDevice(
142- node=node1, tags=["ssd"], formatted_root=True
143+ node=node1, tags=["ssd"], formatted_root=True, bootable=True
144 )
145 factory.make_PhysicalBlockDevice(node=node1, tags=["ssd", "removable"])
146 node2 = factory.make_Node(with_boot_disk=False)
147@@ -1139,11 +1161,15 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
148
149 def test_storage_multi_contraint_matches_large_disk_count(self):
150 node1 = factory.make_Node(with_boot_disk=False)
151- factory.make_PhysicalBlockDevice(node=node1, formatted_root=True)
152+ factory.make_PhysicalBlockDevice(
153+ node=node1, formatted_root=True, bootable=True
154+ )
155 for _ in range(10):
156 factory.make_PhysicalBlockDevice(node=node1)
157 node2 = factory.make_Node(with_boot_disk=False)
158- factory.make_PhysicalBlockDevice(node=node2, formatted_root=True)
159+ factory.make_PhysicalBlockDevice(
160+ node=node2, formatted_root=True, bootable=True
161+ )
162 for _ in range(5):
163 factory.make_PhysicalBlockDevice(node=node2)
164 self.assertConstrainedNodes(

Subscribers

People subscribed via source and target branches