Add user privilege level setting to IPMI sensors (#3643)

This commit is contained in:
Daniel Nelson
2018-01-05 15:59:25 -08:00
committed by GitHub
parent 35f1b9f500
commit 2938c2fa79
5 changed files with 27 additions and 15 deletions

View File

@@ -15,9 +15,10 @@ import (
func TestGather(t *testing.T) {
i := &Ipmi{
Servers: []string{"USERID:PASSW0RD@lan(192.168.1.1)"},
Path: "ipmitool",
Timeout: internal.Duration{Duration: time.Second * 5},
Servers: []string{"USERID:PASSW0RD@lan(192.168.1.1)"},
Path: "ipmitool",
Privilege: "USER",
Timeout: internal.Duration{Duration: time.Second * 5},
}
// overwriting exec commands with mock commands
execCommand = fakeExecCommand
@@ -29,7 +30,7 @@ func TestGather(t *testing.T) {
assert.Equal(t, acc.NFields(), 266, "non-numeric measurements should be ignored")
conn := NewConnection(i.Servers[0])
conn := NewConnection(i.Servers[0], i.Privilege)
assert.Equal(t, "USERID", conn.Username)
assert.Equal(t, "lan", conn.Interface)