Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions checkbox-support/checkbox_support/snap_utils/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def model_to_resource(model_assertion):
resource["{}_track".format(key)] = track
else:
resource[key] = val

# Check if the model has a store
if "store" not in resource:
resource["store"] = "unknown"
return resource


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def test_model_to_resource_uc18(self):
"kernel_track": "18",
"gadget": "pc",
"gadget_track": "18",
"store": "unknown",
}
self.assertDictEqual(correct_resource, model_to_resource(a))
with self.assertRaises(StopIteration):
Expand All @@ -107,6 +108,7 @@ def test_model_to_resource_uc20(self):
"gadget_track": "20/edge",
"kernel": "pc-kernel",
"kernel_track": "20/edge",
"store": "unknown",
}
self.assertDictEqual(correct_resource, model_to_resource(a))
with self.assertRaises(StopIteration):
Expand All @@ -133,6 +135,7 @@ def test_model_to_resource_bionic_server(self):
"brand-id": "generic",
"model": "generic-classic",
"sign-key-sha3-384": "d-JcZF9nD9eBw7bwMnH61x-bklnQOhQud1Is6o_cn2wTj8EYDi9musrIT9z2MdAa",
"store": "unknown",
}
self.assertDictEqual(correct_resource, model_to_resource(a))
self.assertNotIn("kernel", model_to_resource(a))
Expand Down Expand Up @@ -160,6 +163,7 @@ def test_model_to_resource_focal_server(self):
"brand-id": "generic",
"model": "generic-classic",
"sign-key-sha3-384": "d-JcZF9nD9eBw7bwMnH61x-bklnQOhQud1Is6o_cn2wTj8EYDi9musrIT9z2MdAa",
"store": "unknown",
}
self.assertDictEqual(correct_resource, model_to_resource(a))
self.assertNotIn("kernel", model_to_resource(a))
Expand Down
1 change: 1 addition & 0 deletions providers/base/units/snapd/snapd.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL CHECKBOX_RUNTIME
unit: template
template-resource: com.canonical.certification::model_assertion
template-unit: job
template-filter: model_assertion.store not in ('unknown')
id: snappy/test-store-config-{store}
template-id: snappy/test-store-config-store
_summary: Test that image is using the correct snappy store configuration.
Expand Down