diff --git a/client/fingerprint/cgroup_test.go b/client/fingerprint/cgroup_test.go index c7cf2f775..3f7d3ee87 100644 --- a/client/fingerprint/cgroup_test.go +++ b/client/fingerprint/cgroup_test.go @@ -121,4 +121,30 @@ func TestCGroupFingerprint(t *testing.T) { t.Fatalf("unexpected attribute found, %s", a) } } + { + f := &CGroupFingerprint{ + logger: testLogger(), + lastState: cgroupAvailable, + mountPointDetector: &MountPointDetectorValidMountPoint{}, + } + + node := &structs.Node{ + Attributes: make(map[string]string), + } + + request := &cstructs.FingerprintRequest{Config: &config.Config{}, Node: node} + response := &cstructs.FingerprintResponse{ + Attributes: make(map[string]string, 0), + Links: make(map[string]string, 0), + Resources: &structs.Resources{}, + } + + err := f.Fingerprint(request, response) + if err != nil { + t.Fatalf("unexpected error, %s", err) + } + if a, _ := response.Attributes["unique.cgroup.mountpoint"]; a == "" { + t.Fatalf("expected attribute to be found, %s", a) + } + } }