adding documetnation for smartctl exit codes and addl test.
This commit is contained in:
@@ -40,6 +40,7 @@ func (c *BaseCollector) postJson(url string, body interface{}, target interface{
|
|||||||
return json.NewDecoder(r.Body).Decode(target)
|
return json.NewDecoder(r.Body).Decode(target)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://www.linuxguide.it/command_line/linux-manpage/do.php?file=smartctl#sect7
|
||||||
func (c *BaseCollector) LogSmartctlExitCode(exitCode int) {
|
func (c *BaseCollector) LogSmartctlExitCode(exitCode int) {
|
||||||
if exitCode&0x01 != 0 {
|
if exitCode&0x01 != 0 {
|
||||||
c.logger.Errorln("smartctl could not parse commandline")
|
c.logger.Errorln("smartctl could not parse commandline")
|
||||||
|
|||||||
@@ -8,6 +8,19 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestConfiguration_InvalidConfigPath(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
//setup
|
||||||
|
testConfig, _ := config.Create()
|
||||||
|
|
||||||
|
//test
|
||||||
|
err := testConfig.ReadConfig("does_not_exist.yaml")
|
||||||
|
|
||||||
|
//assert
|
||||||
|
require.Error(t, err, "should return an error")
|
||||||
|
}
|
||||||
|
|
||||||
func TestConfiguration_GetScanOverrides_Simple(t *testing.T) {
|
func TestConfiguration_GetScanOverrides_Simple(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user