Skip to content

Commit

Permalink
Merge pull request #159 from brnv/master
Browse files Browse the repository at this point in the history
Add test for dbus/methods.go:GetServiceProperty function
  • Loading branch information
lucab committed May 19, 2016
2 parents 209fe3f + c2b03c2 commit 7d19429
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dbus/methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ func TestGetUnitPropertiesRejectsInvalidName(t *testing.T) {
}
}

// TestGetServiceProperty reads the `systemd-udevd.service` which should exist
// on all systemd systems and ensures that one of its property is valid.
func TestGetServiceProperty(t *testing.T) {
conn := setupConn(t)

service := "systemd-udevd.service"

prop, err := conn.GetServiceProperty(service, "Type")
if err != nil {
t.Fatal(err)
}

if prop.Name != "Type" {
t.Fatal("unexpected property name")
}

value := prop.Value.Value().(string)
if value != "notify" {
t.Fatal("unexpected property value")
}
}

// TestSetUnitProperties changes a cgroup setting on the `tmp.mount`
// which should exist on all systemd systems and ensures that the
// property was set.
Expand Down

0 comments on commit 7d19429

Please sign in to comment.