Skip to content

Commit

Permalink
o/snapstate: add SnapSetupEdge on snap setup task created in Download…
Browse files Browse the repository at this point in the history
… and DownloadComponents
  • Loading branch information
andrewphelpsj committed Jan 31, 2025
1 parent 4905bda commit 44cc1d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions overlord/snapstate/snapstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,7 @@ func downloadTasks(
t.Set("snap-setup", snapsup)
snapsupTask = t
ts.MarkEdge(t, BeginEdge)
ts.MarkEdge(t, SnapSetupEdge)
} else {
t.WaitFor(prev)
t.Set("snap-setup-task", snapsupTask.ID())
Expand Down
3 changes: 3 additions & 0 deletions overlord/snapstate/snapstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10087,6 +10087,7 @@ func (s *snapmgrTestSuite) TestDownload(c *C) {
downloadSnap := ts.MaybeEdge(snapstate.BeginEdge)
c.Assert(downloadSnap, NotNil)
c.Check(downloadSnap.Kind(), Equals, "download-snap")
c.Check(downloadSnap, DeepEquals, ts.MaybeEdge(snapstate.SnapSetupEdge))

var snapsup snapstate.SnapSetup
err = downloadSnap.Get("snap-setup", &snapsup)
Expand Down Expand Up @@ -10184,6 +10185,7 @@ func (s *snapmgrTestSuite) TestDownloadWithComponents(c *C) {
begin := ts.MaybeEdge(snapstate.BeginEdge)
c.Assert(begin, NotNil)
c.Check(begin.Kind(), Equals, "download-snap")
c.Check(begin, DeepEquals, ts.MaybeEdge(snapstate.SnapSetupEdge))

const componentExclusive = false
verifySnapAndComponentSetupsForDownload(c, begin, ts, downloadDir, componentExclusive)
Expand Down Expand Up @@ -10473,6 +10475,7 @@ func (s *snapmgrTestSuite) TestDownloadComponents(c *C) {
begin := ts.MaybeEdge(snapstate.BeginEdge)
c.Assert(begin, NotNil)
c.Check(begin.Kind(), Equals, "download-component")
c.Check(begin, DeepEquals, ts.MaybeEdge(snapstate.SnapSetupEdge))

const componentExclusive = true
verifySnapAndComponentSetupsForDownload(c, begin, ts, downloadDir, componentExclusive)
Expand Down

0 comments on commit 44cc1d2

Please sign in to comment.