Skip to content

Commit

Permalink
Update tests as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
Hook25 committed Nov 19, 2024
1 parent ff2672e commit 6152d9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 5 additions & 3 deletions checkbox-ng/plainbox/impl/session/test_resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,11 +2033,13 @@ def test_simple_session(self):

def test_simple_session_with_rejected(self):
"""
verify that _restore_SessionState_jobs_and_results() works when
faced with a representation of a simple session (no generated jobs
or anything "exotic").
verify that _restore_SessionState_jobs_and_results() also resumes in
the job_state_map jobs that were manually excluded from the user
(rejected jobs)
"""
job = make_job(id="job")
# this job was de-selected by the user manually in the test selection
# screen
job1 = make_job(id="job1")
session_repr = {
"jobs": {job.id: job.checksum, job1.id: job1.checksum},
Expand Down
12 changes: 10 additions & 2 deletions metabox/metabox/scenarios/restart/agent_respawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,26 @@ class ResumeAfterFinishPreserveOutputRemote(Scenario):

@tag("resume", "manual", "regression")
class ResumePreservesRejectedJobsStateMap(Scenario):
"""
Check that the job_state_map survives both manual closure and restarts
"""

launcher = "# no launcher"
steps = [
Start(),
Expect("Select test plan"),
SelectTestPlan("2021.com.canonical.certification::pass-and-crash"),
SelectTestPlan(
"2021.com.canonical.certification::checkbox-crash-then-reboot"
),
Send(keys.KEY_ENTER),
Expect("Press (T) to start"),
Send(keys.KEY_ENTER),
Expect("basic-shell-crashing"),
Expect("Crash Checkbox"),
Send(keys.KEY_DOWN + keys.KEY_SPACE),
Expect("[ ]"),
Send("T"),
Expect("Waiting for the system to shut down or reboot"),
Start(),
Expect("Do you want to submit 'upload to certification' report?"),
Signal(keys.SIGINT),
Start(),
Expand Down

0 comments on commit 6152d9f

Please sign in to comment.