@@ -91,12 +91,12 @@ type Daemon struct {
91
91
IntervalSec determines the rate of execution of maintenance routine. This is not a sleep duration. The constant
92
92
rate of execution is maintained by taking away routine's elapsed time from actual interval between runs.
93
93
*/
94
- IntervalSec int `json:"IntervalSec"`
95
- MailClient inet.MailClient `json:"MailClient"` // Send notification mails via this mailer
96
- Recipients []string `json:"Recipients"` // Address of recipients of notification mails
97
- FeaturesToTest * toolbox.FeatureSet `json:"-"` // FeaturesToTest are toolbox features to be tested during health check.
98
- MailCmdRunnerToTest * mailcmd.CommandRunner `json:"-"` // MailCmdRunnerToTest is mail command runner to be tested during health check.
99
- HTTPHandlersToCheck httpd.HandlerCollection `json:"-"` // HTTPHandlersToCheck are the URL handlers of an HTTP daemon to be tested during health check.
94
+ IntervalSec int `json:"IntervalSec"`
95
+ MailClient inet.MailClient `json:"MailClient"` // Send notification mails via this mailer
96
+ Recipients []string `json:"Recipients"` // Address of recipients of notification mails
97
+ ToolboxSelfTest * toolbox.FeatureSet `json:"-"` // FeaturesToTest are toolbox features to be tested during health check.
98
+ MailCommandRunnerSelfTest * mailcmd.CommandRunner `json:"-"` // MailCmdRunnerToTest is mail command runner to be tested during health check.
99
+ HttpHandlersSelfTest httpd.HandlerCollection `json:"-"` // HTTPHandlersToCheck are the URL handlers of an HTTP daemon to be tested during health check.
100
100
101
101
// UploadReportToS3Bucket is the name of S3 bucket into which the maintenance daemon shall upload its summary reports.
102
102
UploadReportToS3Bucket string `json:"UploadReportToS3Bucket"`
@@ -161,22 +161,22 @@ func (daemon *Daemon) Execute(ctx context.Context) (string, bool) {
161
161
}()
162
162
go func () {
163
163
// Toolbox feature self test - the routine itself also uses concurrency internally
164
- if daemon .FeaturesToTest != nil {
165
- featureErr = daemon .FeaturesToTest .SelfTest ()
164
+ if daemon .ToolboxSelfTest != nil {
165
+ featureErr = daemon .ToolboxSelfTest .SelfTest ()
166
166
}
167
167
waitAllChecks .Done ()
168
168
}()
169
169
go func () {
170
170
// Mail command runner test - the routine itself also uses concurrency internally
171
- if daemon .MailCmdRunnerToTest != nil && daemon .MailCmdRunnerToTest .ReplyMailClient .IsConfigured () {
172
- mailCmdRunnerErr = daemon .MailCmdRunnerToTest .SelfTest ()
171
+ if daemon .MailCommandRunnerSelfTest != nil && daemon .MailCommandRunnerSelfTest .ReplyMailClient .IsConfigured () {
172
+ mailCmdRunnerErr = daemon .MailCommandRunnerSelfTest .SelfTest ()
173
173
}
174
174
waitAllChecks .Done ()
175
175
}()
176
176
go func () {
177
177
// HTTP special handler test - the routine itself also uses concurrency internally
178
- if daemon .HTTPHandlersToCheck != nil {
179
- httpHandlersErr = daemon .HTTPHandlersToCheck .SelfTest ()
178
+ if daemon .HttpHandlersSelfTest != nil {
179
+ httpHandlersErr = daemon .HttpHandlersSelfTest .SelfTest ()
180
180
}
181
181
waitAllChecks .Done ()
182
182
}()
@@ -440,7 +440,7 @@ func TestMaintenance(check *Daemon, t testingstub.T) {
440
440
t .Fatal ("did not run pre script" )
441
441
}
442
442
// Break a feature
443
- check .FeaturesToTest .LookupByTrigger [".s" ] = & toolbox.Shell {}
443
+ check .ToolboxSelfTest .LookupByTrigger [".s" ] = & toolbox.Shell {}
444
444
if result , ok := check .Execute (context .Background ()); ok || ! strings .Contains (result , "Shell.SelfTest" ) { // broken shell configuration
445
445
t .Fatal (result )
446
446
}
@@ -450,7 +450,7 @@ func TestMaintenance(check *Daemon, t testingstub.T) {
450
450
} else if ! strings .Contains (string (content ), "Shell.SelfTest" ) { // broken shell configuration
451
451
t .Fatal (string (content ))
452
452
}
453
- check .FeaturesToTest .LookupByTrigger [".s" ] = & toolbox.Shell {
453
+ check .ToolboxSelfTest .LookupByTrigger [".s" ] = & toolbox.Shell {
454
454
Unrestricted : true ,
455
455
InterpreterPath : "/bin/bash" ,
456
456
}
0 commit comments