mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
add test case for available cgroups
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user