@@ -651,8 +651,8 @@ func TestAgent_AddCheck(t *testing.T) {
651651 Status : api .HealthCritical ,
652652 }
653653 chk := & structs.CheckType {
654- Script : "exit 0" ,
655- Interval : 15 * time .Second ,
654+ ScriptArgs : [] string { "exit" , "0" } ,
655+ Interval : 15 * time .Second ,
656656 }
657657 err := a .AddCheck (health , chk , false , "" )
658658 if err != nil {
@@ -690,8 +690,8 @@ func TestAgent_AddCheck_StartPassing(t *testing.T) {
690690 Status : api .HealthPassing ,
691691 }
692692 chk := & structs.CheckType {
693- Script : "exit 0" ,
694- Interval : 15 * time .Second ,
693+ ScriptArgs : [] string { "exit" , "0" } ,
694+ Interval : 15 * time .Second ,
695695 }
696696 err := a .AddCheck (health , chk , false , "" )
697697 if err != nil {
@@ -729,8 +729,8 @@ func TestAgent_AddCheck_MinInterval(t *testing.T) {
729729 Status : api .HealthCritical ,
730730 }
731731 chk := & structs.CheckType {
732- Script : "exit 0" ,
733- Interval : time .Microsecond ,
732+ ScriptArgs : [] string { "exit" , "0" } ,
733+ Interval : time .Microsecond ,
734734 }
735735 err := a .AddCheck (health , chk , false , "" )
736736 if err != nil {
@@ -764,8 +764,8 @@ func TestAgent_AddCheck_MissingService(t *testing.T) {
764764 ServiceID : "baz" ,
765765 }
766766 chk := & structs.CheckType {
767- Script : "exit 0" ,
768- Interval : time .Microsecond ,
767+ ScriptArgs : [] string { "exit" , "0" } ,
768+ Interval : time .Microsecond ,
769769 }
770770 err := a .AddCheck (health , chk , false , "" )
771771 if err == nil || err .Error () != `ServiceID "baz" does not exist` {
@@ -829,8 +829,8 @@ func TestAgent_AddCheck_ExecDisable(t *testing.T) {
829829 Status : api .HealthCritical ,
830830 }
831831 chk := & structs.CheckType {
832- Script : "exit 0" ,
833- Interval : 15 * time .Second ,
832+ ScriptArgs : [] string { "exit" , "0" } ,
833+ Interval : 15 * time .Second ,
834834 }
835835 err := a .AddCheck (health , chk , false , "" )
836836 if err == nil || ! strings .Contains (err .Error (), "Scripts are disabled on this agent" ) {
@@ -904,8 +904,8 @@ func TestAgent_RemoveCheck(t *testing.T) {
904904 Status : api .HealthCritical ,
905905 }
906906 chk := & structs.CheckType {
907- Script : "exit 0" ,
908- Interval : 15 * time .Second ,
907+ ScriptArgs : [] string { "exit" , "0" } ,
908+ Interval : 15 * time .Second ,
909909 }
910910 err := a .AddCheck (health , chk , false , "" )
911911 if err != nil {
@@ -1315,8 +1315,8 @@ func TestAgent_PersistCheck(t *testing.T) {
13151315 Status : api .HealthPassing ,
13161316 }
13171317 chkType := & structs.CheckType {
1318- Script : "/bin/true" ,
1319- Interval : 10 * time .Second ,
1318+ ScriptArgs : [] string { "/bin/true" } ,
1319+ Interval : 10 * time .Second ,
13201320 }
13211321
13221322 file := filepath .Join (a .Config .DataDir , checksDir , checkIDHash (check .CheckID ))
@@ -1473,7 +1473,7 @@ func TestAgent_PurgeCheckOnDuplicate(t *testing.T) {
14731473 id = "mem"
14741474 name = "memory check"
14751475 notes = "my cool notes"
1476- script = "/bin/check-redis.py"
1476+ args = [ "/bin/check-redis.py"]
14771477 interval = "30s"
14781478 }
14791479 ` )
0 commit comments