diff --git a/src/core/plugins/systemimage/plugin.js b/src/core/plugins/systemimage/plugin.js index 5398c787..ae8c9f8e 100644 --- a/src/core/plugins/systemimage/plugin.js +++ b/src/core/plugins/systemimage/plugin.js @@ -30,7 +30,7 @@ class SystemimagePlugin extends Plugin { * systemimage:install action * @returns {Promise>} */ - action__install() { + action__install({ verify_recovery } = {}) { return api .getImages( this.props.settings.channel, @@ -56,6 +56,16 @@ class SystemimagePlugin extends Plugin { { "adb:wait": null }, + ...(verify_recovery + ? [ + { + "adb:assert_prop": { + prop: "ro.ubuntu.recovery", + value: "true" + } + } + ] + : []), { "adb:preparesystemimage": null }, diff --git a/src/core/plugins/systemimage/plugin.spec.js b/src/core/plugins/systemimage/plugin.spec.js index 300edeb3..16a7756e 100644 --- a/src/core/plugins/systemimage/plugin.spec.js +++ b/src/core/plugins/systemimage/plugin.spec.js @@ -19,8 +19,8 @@ beforeEach(() => jest.clearAllMocks()); describe("systemimage plugin", () => { describe("actions", () => { - describe("download", () => { - it("should create download steps", () => + describe("install", () => { + it("should create install actions", () => systemimage.action__install().then(r => { expect(r).toHaveLength(1); expect(r[0].actions).toHaveLength(5); @@ -49,6 +49,14 @@ describe("systemimage plugin", () => { } }); })); + it("should verify recovery", () => + systemimage.action__install({ verify_recovery: true }).then(r => { + expect(r).toHaveLength(1); + expect(r[0].actions).toHaveLength(6); + expect(r[0].actions).toContainEqual({ + "adb:assert_prop": { prop: "ro.ubuntu.recovery", value: "true" } + }); + })); }); }); describe("remote_values", () => {