From c2b03c2c252b717c4bb763adcf279d36434035fd Mon Sep 17 00:00:00 2001 From: Alexey Baranov Date: Thu, 19 May 2016 17:35:33 +0600 Subject: [PATCH] tests: dbus/methods.go:GetServiceProperty --- dbus/methods_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dbus/methods_test.go b/dbus/methods_test.go index c9f9ccde..9c0d0114 100644 --- a/dbus/methods_test.go +++ b/dbus/methods_test.go @@ -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.