|
|
|
@ -93,6 +93,7 @@ func (suite *ServerTestSuite) TestHealthRoute() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").Return(parentPath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -132,6 +133,7 @@ func (suite *ServerTestSuite) TestRegisterDevicesRoute() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").Return(path.Join(parentPath, "scrutiny_test.db")).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").Return(parentPath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -171,6 +173,7 @@ func (suite *ServerTestSuite) TestUploadDeviceMetricsRoute() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -219,6 +222,7 @@ func (suite *ServerTestSuite) TestPopulateMultiple() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -314,6 +318,7 @@ func (suite *ServerTestSuite) TestSendTestNotificationRoute_WebhookFailure() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -352,6 +357,7 @@ func (suite *ServerTestSuite) TestSendTestNotificationRoute_ScriptFailure() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -390,6 +396,7 @@ func (suite *ServerTestSuite) TestSendTestNotificationRoute_ScriptSuccess() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -428,6 +435,7 @@ func (suite *ServerTestSuite) TestSendTestNotificationRoute_ShoutrrrFailure() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
@ -465,6 +473,7 @@ func (suite *ServerTestSuite) TestGetDevicesSummaryRoute_Nvme() {
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(path.Join(parentPath, "scrutiny_test.db"))
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.src.frontend.path").AnyTimes().Return(parentPath)
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.listen.basepath").Return(suite.Basepath).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.scheme").Return("http").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.port").Return("8086").AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().IsSet("web.influxdb.token").Return(true).AnyTimes()
|
|
|
|
|
fakeConfig.EXPECT().GetString("web.influxdb.token").Return("my-super-secret-auth-token").AnyTimes()
|
|
|
|
|