From 5ad4a720767a0d79042e60a067c7899b7a7683ab Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 3 Sep 2013 16:20:46 -0700 Subject: [PATCH 1/2] fix(omaha): go fmt --- omaha/omaha.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omaha/omaha.go b/omaha/omaha.go index a66af8a..416c89c 100644 --- a/omaha/omaha.go +++ b/omaha/omaha.go @@ -80,8 +80,8 @@ type App struct { Status string `xml:"status,attr,omitempty"` // update engine extensions - Track string `xml:"track,attr,omitempty"` - FromTrack string `xml:"from_track,attr,omitempty"` + Track string `xml:"track,attr,omitempty"` + FromTrack string `xml:"from_track,attr,omitempty"` // coreos update engine extensions BootId string `xml:"bootid,attr,omitempty"` From ddc4c22205ec33055da87de617b9255b1d3eb0a3 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 3 Sep 2013 16:21:08 -0700 Subject: [PATCH 2/2] feat(omaha): add oem and previousbootid Add two new extensions for coreos --- fixtures/update-engine/update/request.xml | 2 +- omaha/omaha.go | 4 +++- omaha/omaha_test.go | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fixtures/update-engine/update/request.xml b/fixtures/update-engine/update/request.xml index b5e4982..f413143 100644 --- a/fixtures/update-engine/update/request.xml +++ b/fixtures/update-engine/update/request.xml @@ -1,7 +1,7 @@ - + diff --git a/omaha/omaha.go b/omaha/omaha.go index 416c89c..5bf8091 100644 --- a/omaha/omaha.go +++ b/omaha/omaha.go @@ -84,7 +84,9 @@ type App struct { FromTrack string `xml:"from_track,attr,omitempty"` // coreos update engine extensions - BootId string `xml:"bootid,attr,omitempty"` + BootId string `xml:"bootid,attr,omitempty"` + PreviousBootId string `xml:"previousbootid,attr,omitempty"` + Oem string `xml:"oem,attr,omitempty"` } func NewApp(id string) *App { diff --git a/omaha/omaha_test.go b/omaha/omaha_test.go index 287aeab..2cecac8 100644 --- a/omaha/omaha_test.go +++ b/omaha/omaha_test.go @@ -32,6 +32,14 @@ func TestOmahaRequestUpdateCheck(t *testing.T) { t.Error("Expected a Boot Id") } + if v.Apps[0].PreviousBootId != "{8BDE4C4D-9083-4D61-B41C-3253212C0C37}" { + t.Error("Expected a Previous Boot Id") + } + + if v.Apps[0].Oem != "ec3000" { + t.Error("Expected an OEM") + } + if v.Apps[0].UpdateCheck == nil { t.Error("Expected an UpdateCheck") }