Skip to content

Commit 954eb3d

Browse files
committed
tests: adjust for fixed cancellation
Now that canceling updates actually prevents starting further updates, test that has some cancelled qubes didn't finish all expected updates. Adjust the test to not generate cancelled statuses unless explicitly expected.
1 parent 4478671 commit 954eb3d

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

vmupdate/tests/conftest.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def run_agent(self, agent_args, status_notifier, termination):
145145
return closure
146146

147147

148-
def generate_vm_variations(app, variations):
148+
def generate_vm_variations(app, variations, include_cancelled=False):
149149
"""
150150
Generate all possible variations of vms for the given list of features.
151151
"""
@@ -182,15 +182,27 @@ def generate_vm_variations(app, variations):
182182
FinalStatus.SUCCESS: set(),
183183
FinalStatus.NO_UPDATES: set(),
184184
FinalStatus.ERROR: set(),
185-
FinalStatus.CANCELLED: set(),
186-
},
185+
}
186+
| (
187+
{
188+
FinalStatus.CANCELLED: set(),
189+
}
190+
if include_cancelled
191+
else {}
192+
),
187193
"has_template_updated": {
188194
FinalStatus.SUCCESS: set(),
189195
FinalStatus.NO_UPDATES: set(),
190196
FinalStatus.ERROR: set(),
191-
FinalStatus.CANCELLED: set(),
192197
FinalStatus.UNKNOWN: set(),
193-
},
198+
}
199+
| (
200+
{
201+
FinalStatus.CANCELLED: set(),
202+
}
203+
if include_cancelled
204+
else {}
205+
),
194206
}
195207

196208
klasses = list(reversed(sorted(list(domains["klass"].keys()))))

0 commit comments

Comments
 (0)