diff --git a/cmd/sysotad/spread.suite/introspection/introspection-expected-debug.txt b/cmd/sysotad/spread.suite/introspection/introspection-expected-debug.txt
index 22ff9cc0bc70e3b3b0c09f49bf1ed0fa2285ee3a..1bd6cd30cd223f250fe2629f60d80e2d6539de96 100644
--- a/cmd/sysotad/spread.suite/introspection/introspection-expected-debug.txt
+++ b/cmd/sysotad/spread.suite/introspection/introspection-expected-debug.txt
@@ -1,32 +1,32 @@
-NAME TYPE SIGNATURE RESULT/VALUE FLAGS
-org.freedesktop.DBus.Introspectable interface - - -
-.Introspect method - s -
-org.freedesktop.DBus.ObjectManager interface - - -
-.GetManagedObjects method - a{oa{sa{sv}}} -
-.InterfacesAdded signal oa{sa{sv}} - -
-.InterfacesRemoved signal oas - -
-org.freedesktop.DBus.Properties interface - - -
-.Get method ss v -
-.GetAll method s a{sv} -
-.Set method ssv - -
-.PropertiesChanged signal sa{sv}as - -
-org.oniroproject.sysota1.BootLoader interface - - -
-.CancelSwitch method - - -
-.CommitSwitch method - - -
-.QueryActive method - s -
-.QueryInactive method - s -
-.Reboot method u - -
-.TrySwitch method s - -
-org.oniroproject.sysota1.RAUC interface - - -
-.GetPrimary method - s -
-.GetState method s s -
-.PostInstall method as - -
-.PreInstall method as - -
-.SetPrimary method s - -
-.SetState method ss - -
-org.oniroproject.sysota1.Service interface - - -
-.UpdateDevice method a{ss} o -
-.UpdateStreams method - - -
-.Maker property s "dummy-maker" const
-.Model property s "dummy-model" const
-.Stream property s "dummy-stream" emits-change writable
+NAME TYPE SIGNATURE RESULT/VALUE FLAGS
+org.freedesktop.DBus.Introspectable interface - - -
+.Introspect method - s -
+org.freedesktop.DBus.ObjectManager interface - - -
+.GetManagedObjects method - a{oa{sa{sv}}} -
+.InterfacesAdded signal oa{sa{sv}} - -
+.InterfacesRemoved signal oas - -
+org.freedesktop.DBus.Properties interface - - -
+.Get method ss v -
+.GetAll method s a{sv} -
+.Set method ssv - -
+.PropertiesChanged signal sa{sv}as - -
+org.oniroproject.sysota1.BootLoader interface - - -
+.CancelSwitch method - - -
+.CommitSwitch method - - -
+.QueryActive method - s -
+.QueryInactive method - s -
+.Reboot method u - -
+.TrySwitch method s - -
+org.oniroproject.sysota1.RAUC interface - - -
+.GetPrimary method - s -
+.GetState method s s -
+.PostInstall method as - -
+.PreInstall method as - -
+.SetPrimary method s - -
+.SetState method ss - -
+org.oniroproject.sysota1.Service interface - - -
+.UpdateDevice method a{ss} o -
+.UpdateStreams method - - -
+.Maker property s "test-maker" const
+.Model property s "test-model" const
+.Stream property s "test-stream" emits-change writable
diff --git a/cmd/sysotad/spread.suite/introspection/introspection-expected-production.txt b/cmd/sysotad/spread.suite/introspection/introspection-expected-production.txt
index 357c8212ec1c12ffe431582220df68e5b6b78ecd..a425b3c93dd4711d5924c0b7fcf6b2d1885a812a 100644
--- a/cmd/sysotad/spread.suite/introspection/introspection-expected-production.txt
+++ b/cmd/sysotad/spread.suite/introspection/introspection-expected-production.txt
@@ -1,25 +1,25 @@
-NAME TYPE SIGNATURE RESULT/VALUE FLAGS
-org.freedesktop.DBus.Introspectable interface - - -
-.Introspect method - s -
-org.freedesktop.DBus.ObjectManager interface - - -
-.GetManagedObjects method - a{oa{sa{sv}}} -
-.InterfacesAdded signal oa{sa{sv}} - -
-.InterfacesRemoved signal oas - -
-org.freedesktop.DBus.Properties interface - - -
-.Get method ss v -
-.GetAll method s a{sv} -
-.Set method ssv - -
-.PropertiesChanged signal sa{sv}as - -
-org.oniroproject.sysota1.RAUC interface - - -
-.GetPrimary method - s -
-.GetState method s s -
-.PostInstall method as - -
-.PreInstall method as - -
-.SetPrimary method s - -
-.SetState method ss - -
-org.oniroproject.sysota1.Service interface - - -
-.UpdateDevice method a{ss} o -
-.UpdateStreams method - - -
-.Maker property s "dummy-maker" const
-.Model property s "dummy-model" const
-.Stream property s "dummy-stream" emits-change writable
+NAME TYPE SIGNATURE RESULT/VALUE FLAGS
+org.freedesktop.DBus.Introspectable interface - - -
+.Introspect method - s -
+org.freedesktop.DBus.ObjectManager interface - - -
+.GetManagedObjects method - a{oa{sa{sv}}} -
+.InterfacesAdded signal oa{sa{sv}} - -
+.InterfacesRemoved signal oas - -
+org.freedesktop.DBus.Properties interface - - -
+.Get method ss v -
+.GetAll method s a{sv} -
+.Set method ssv - -
+.PropertiesChanged signal sa{sv}as - -
+org.oniroproject.sysota1.RAUC interface - - -
+.GetPrimary method - s -
+.GetState method s s -
+.PostInstall method as - -
+.PreInstall method as - -
+.SetPrimary method s - -
+.SetState method ss - -
+org.oniroproject.sysota1.Service interface - - -
+.UpdateDevice method a{ss} o -
+.UpdateStreams method - - -
+.Maker property s "test-maker" const
+.Model property s "test-model" const
+.Stream property s "test-stream" emits-change writable
diff --git a/cmd/sysotad/spread.suite/introspection/task.yaml b/cmd/sysotad/spread.suite/introspection/task.yaml
index 25ccb7050a233d0392381a4d31d41b3a308fceb3..84dd3b9e502a6c99128017396894c30ec71aae46 100644
--- a/cmd/sysotad/spread.suite/introspection/task.yaml
+++ b/cmd/sysotad/spread.suite/introspection/task.yaml
@@ -8,11 +8,9 @@ environment:
BOOT_API_DEBUG/off: "false"
EXPECTED/off: introspection-expected-production.txt
prepare: |
- # We are not expecting a config file since we are clobbering things below.
- test ! -e /etc/sysota/sysotad.conf
-
systemctl stop sysotad.service
- cat <<SYSOTAD_CONF >/etc/sysota/sysotad.conf
+ mkdir -p /run/sysota
+ cat <<SYSOTAD_CONF >/run/sysota/sysotad.conf
[Debug]
BootAPI = $BOOT_API_DEBUG
SYSOTAD_CONF
@@ -21,5 +19,4 @@ execute: |
diff -u introspection-actual.txt "$EXPECTED"
restore: |
rm -f introspection-actual.txt
- rm -f /etc/sysota/sysotad.conf
systemctl stop sysotad.service
diff --git a/cmd/sysotad/spread.suite/smoke/task.yaml b/cmd/sysotad/spread.suite/smoke/task.yaml
index 53b9291de7f60785cecc0ad58764336a10c0c5ff..72c3e0c083ae805d554869f323138c6bff066dd4 100644
--- a/cmd/sysotad/spread.suite/smoke/task.yaml
+++ b/cmd/sysotad/spread.suite/smoke/task.yaml
@@ -4,12 +4,12 @@
summary: Initial smoke tests
execute: |
# The three properties can be read
- test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Maker)" = 's "dummy-maker"'
- test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Model)" = 's "dummy-model"'
- test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream)" = 's "dummy-stream"'
+ test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Maker)" = 's "test-maker"'
+ test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Model)" = 's "test-model"'
+ test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream)" = 's "test-stream"'
# The 'Stream' property can be written as well
- test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream)" = 's "dummy-stream"'
+ test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream)" = 's "test-stream"'
test "$(busctl set-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream s custom)" = ''
test "$(busctl get-property org.oniroproject.sysota1 /org/oniroproject/sysota1/Service org.oniroproject.sysota1.Service Stream)" = 's "custom"'
diff --git a/service/service.go b/service/service.go
index b87831473194db6d9d5fc0d68fb92b6eebf274fb..11b63d9b2ab778ebd511eedbbcb82e2a7c55d4a0 100644
--- a/service/service.go
+++ b/service/service.go
@@ -120,9 +120,9 @@ func New(config *ota.Config, state *ota.SystemState, conn *dbus.Conn) (*Service,
}
// Configure and add the update service.
- svc.updateService.maker = "dummy-maker"
- svc.updateService.model = "dummy-model"
- svc.updateService.stream = "dummy-stream"
+ svc.updateService.maker = config.DeviceMaker
+ svc.updateService.model = config.DeviceModel
+ svc.updateService.stream = config.UpdateStream
svc.sh.AddHostedService(&svc.updateService)
// Configure and add the RAUC service
diff --git a/service/service_test.go b/service/service_test.go
index 5c24f36a7e52274757db52349d0f0fd36c962107..679b3e1c6ec23e46df7f7c08c6364129efa616c9 100644
--- a/service/service_test.go
+++ b/service/service_test.go
@@ -62,7 +62,11 @@ func (s *serviceSuite) EnsureService(c *C) {
}
func (s *serviceSuite) SetUpTest(c *C) {
- s.config = ota.Config{}
+ s.config = ota.Config{
+ DeviceMaker: "test-maker",
+ DeviceModel: "test-model",
+ UpdateStream: "test-stream",
+ }
s.state = ota.SystemState{}
}
@@ -217,15 +221,15 @@ func (s *serviceSuite) TestAccessPropertiesAcrossDBus(c *C) {
err := svcObject.Call("org.freedesktop.DBus.Properties.Get", 0, "org.oniroproject.sysota1.Service", "Maker").Store(&propValue)
c.Assert(err, IsNil)
- c.Check(propValue, Equals, dbus.MakeVariant("dummy-maker"))
+ c.Check(propValue, Equals, dbus.MakeVariant("test-maker"))
err = svcObject.Call("org.freedesktop.DBus.Properties.Get", 0, "org.oniroproject.sysota1.Service", "Model").Store(&propValue)
c.Assert(err, IsNil)
- c.Check(propValue, Equals, dbus.MakeVariant("dummy-model"))
+ c.Check(propValue, Equals, dbus.MakeVariant("test-model"))
err = svcObject.Call("org.freedesktop.DBus.Properties.Get", 0, "org.oniroproject.sysota1.Service", "Stream").Store(&propValue)
c.Assert(err, IsNil)
- c.Check(propValue, Equals, dbus.MakeVariant("dummy-stream"))
+ c.Check(propValue, Equals, dbus.MakeVariant("test-stream"))
err = svcObject.Call("org.freedesktop.DBus.Properties.Get", 0, "org.oniroproject.sysota1.Service", "Potato").Store(&propValue)
c.Assert(err, ErrorMatches, `org.freedesktop.DBus.Properties.Error.PropertyNotFound`)
@@ -238,9 +242,9 @@ func (s *serviceSuite) TestAccessPropertiesAcrossDBus(c *C) {
err = svcObject.Call("org.freedesktop.DBus.Properties.GetAll", 0, "org.oniroproject.sysota1.Service").Store(&propMap)
c.Assert(err, IsNil)
c.Check(propMap, DeepEquals, map[string]dbus.Variant{
- "Maker": dbus.MakeVariant("dummy-maker"),
- "Model": dbus.MakeVariant("dummy-model"),
- "Stream": dbus.MakeVariant("dummy-stream"),
+ "Maker": dbus.MakeVariant("test-maker"),
+ "Model": dbus.MakeVariant("test-model"),
+ "Stream": dbus.MakeVariant("test-stream"),
})
err = svcObject.Call("org.freedesktop.DBus.Properties.GetAll", 0, "org.oniroproject.sysota1.Potato").Store(&propMap)
@@ -274,9 +278,9 @@ func (s *serviceSuite) TestAccessPropertiesLocally(c *C) {
s.EnsureService(c)
// Properties can be read locally.
- c.Check(s.svc.Maker(), Equals, "dummy-maker")
- c.Check(s.svc.Model(), Equals, "dummy-model")
- c.Check(s.svc.Stream(), Equals, "dummy-stream")
+ c.Check(s.svc.Maker(), Equals, "test-maker")
+ c.Check(s.svc.Model(), Equals, "test-model")
+ c.Check(s.svc.Stream(), Equals, "test-stream")
// Stream can be changed.
// TODO(zyga): observe the property changed signal.
diff --git a/spread.yaml b/spread.yaml
index e38d852ec8ef3125b14262d7fc4a87771725e925..5138ad913a1ddd3c30e44221b17d27c6d5363c71 100644
--- a/spread.yaml
+++ b/spread.yaml
@@ -87,9 +87,18 @@ suites:
summary: integration tests for sysotad (service)
prepare-each: |
mkdir -p /etc/sysota
+ mkdir -p /run/sysota
+ cat <<SYSOTAD_CONF >/etc/sysota/sysotad.conf
+ [Device]
+ Maker=test-maker
+ Model=test-model
+ [Update]
+ Stream=test-stream
+ SYSOTAD_CONF
restore-each: |
# Remove any configuration changes.
rm -f /etc/sysota/sysotad.conf
+ rm -f /run/sysota/sysotad.conf
rmdir /etc/sysota
rm -rf /run/sysotad