@@ -1822,7 +1822,7 @@ func TestAgent_ReloadDoesNotTriggerWatch(t *testing.T) {
18221822 for i := 1 ; i < 7 ; i ++ {
18231823 contents , err := os .ReadFile (tmpFile )
18241824 if err != nil {
1825- t .Fatalf ("should be able to read file, but had: %#v" , err )
1825+ r .Fatalf ("should be able to read file, but had: %#v" , err )
18261826 }
18271827 contentsStr = string (contents )
18281828 if contentsStr != "" {
@@ -1909,14 +1909,14 @@ func TestAgent_ReloadDoesNotTriggerWatch(t *testing.T) {
19091909 ensureNothingCritical (r , "red-is-dead" )
19101910
19111911 if err := a .reloadConfigInternal (cfg2 ); err != nil {
1912- t .Fatalf ("got error %v want nil" , err )
1912+ r .Fatalf ("got error %v want nil" , err )
19131913 }
19141914
19151915 // We check that reload does not go to critical
19161916 ensureNothingCritical (r , "red-is-dead" )
19171917 ensureNothingCritical (r , "testing-agent-reload-001" )
19181918
1919- require .NoError (t , a .updateTTLCheck (checkID , api .HealthPassing , "testing-agent-reload-002" ))
1919+ require .NoError (r , a .updateTTLCheck (checkID , api .HealthPassing , "testing-agent-reload-002" ))
19201920
19211921 ensureNothingCritical (r , "red-is-dead" )
19221922 })
@@ -2926,7 +2926,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29262926 req , _ := http .NewRequest ("PUT" , "/v1/agent/check/register" , jsonReader (nodeCheck ))
29272927 resp := httptest .NewRecorder ()
29282928 a .srv .h .ServeHTTP (resp , req )
2929- require .Equal (t , http .StatusForbidden , resp .Code )
2929+ require .Equal (r , http .StatusForbidden , resp .Code )
29302930 })
29312931 })
29322932
@@ -2936,7 +2936,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29362936 req .Header .Add ("X-Consul-Token" , svcToken .SecretID )
29372937 resp := httptest .NewRecorder ()
29382938 a .srv .h .ServeHTTP (resp , req )
2939- require .Equal (t , http .StatusForbidden , resp .Code )
2939+ require .Equal (r , http .StatusForbidden , resp .Code )
29402940 })
29412941 })
29422942
@@ -2946,7 +2946,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29462946 req .Header .Add ("X-Consul-Token" , nodeToken .SecretID )
29472947 resp := httptest .NewRecorder ()
29482948 a .srv .h .ServeHTTP (resp , req )
2949- require .Equal (t , http .StatusOK , resp .Code )
2949+ require .Equal (r , http .StatusOK , resp .Code )
29502950 })
29512951 })
29522952
@@ -2955,7 +2955,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29552955 req , _ := http .NewRequest ("PUT" , "/v1/agent/check/register" , jsonReader (svcCheck ))
29562956 resp := httptest .NewRecorder ()
29572957 a .srv .h .ServeHTTP (resp , req )
2958- require .Equal (t , http .StatusForbidden , resp .Code )
2958+ require .Equal (r , http .StatusForbidden , resp .Code )
29592959 })
29602960 })
29612961
@@ -2965,7 +2965,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29652965 req .Header .Add ("X-Consul-Token" , nodeToken .SecretID )
29662966 resp := httptest .NewRecorder ()
29672967 a .srv .h .ServeHTTP (resp , req )
2968- require .Equal (t , http .StatusForbidden , resp .Code )
2968+ require .Equal (r , http .StatusForbidden , resp .Code )
29692969 })
29702970 })
29712971
@@ -2975,7 +2975,7 @@ func TestAgent_RegisterCheck_ACLDeny(t *testing.T) {
29752975 req .Header .Add ("X-Consul-Token" , svcToken .SecretID )
29762976 resp := httptest .NewRecorder ()
29772977 a .srv .h .ServeHTTP (resp , req )
2978- require .Equal (t , http .StatusOK , resp .Code )
2978+ require .Equal (r , http .StatusOK , resp .Code )
29792979 })
29802980 })
29812981}
@@ -5976,17 +5976,17 @@ func TestAgent_Monitor(t *testing.T) {
59765976 res := httptest .NewRecorder ()
59775977 a .srv .h .ServeHTTP (res , registerReq )
59785978 if http .StatusOK != res .Code {
5979- t .Fatalf ("expected 200 but got %v" , res .Code )
5979+ r .Fatalf ("expected 200 but got %v" , res .Code )
59805980 }
59815981
59825982 // Wait until we have received some type of logging output
5983- require .Eventually (t , func () bool {
5983+ require .Eventually (r , func () bool {
59845984 return len (resp .Body .Bytes ()) > 0
59855985 }, 3 * time .Second , 100 * time .Millisecond )
59865986
59875987 cancelFunc ()
59885988 code := <- codeCh
5989- require .Equal (t , http .StatusOK , code )
5989+ require .Equal (r , http .StatusOK , code )
59905990 got := resp .Body .String ()
59915991
59925992 // Only check a substring that we are highly confident in finding
@@ -6026,11 +6026,11 @@ func TestAgent_Monitor(t *testing.T) {
60266026 res := httptest .NewRecorder ()
60276027 a .srv .h .ServeHTTP (res , registerReq )
60286028 if http .StatusOK != res .Code {
6029- t .Fatalf ("expected 200 but got %v" , res .Code )
6029+ r .Fatalf ("expected 200 but got %v" , res .Code )
60306030 }
60316031
60326032 // Wait until we have received some type of logging output
6033- require .Eventually (t , func () bool {
6033+ require .Eventually (r , func () bool {
60346034 return len (resp .Body .Bytes ()) > 0
60356035 }, 3 * time .Second , 100 * time .Millisecond )
60366036 cancelFunc ()
@@ -6063,24 +6063,24 @@ func TestAgent_Monitor(t *testing.T) {
60636063 res := httptest .NewRecorder ()
60646064 a .srv .h .ServeHTTP (res , registerReq )
60656065 if http .StatusOK != res .Code {
6066- t .Fatalf ("expected 200 but got %v" , res .Code )
6066+ r .Fatalf ("expected 200 but got %v" , res .Code )
60676067 }
60686068
60696069 // Wait until we have received some type of logging output
6070- require .Eventually (t , func () bool {
6070+ require .Eventually (r , func () bool {
60716071 return len (resp .Body .Bytes ()) > 0
60726072 }, 3 * time .Second , 100 * time .Millisecond )
60736073
60746074 cancelFunc ()
60756075 code := <- codeCh
6076- require .Equal (t , http .StatusOK , code )
6076+ require .Equal (r , http .StatusOK , code )
60776077
60786078 // Each line is output as a separate JSON object, we grab the first and
60796079 // make sure it can be unmarshalled.
60806080 firstLine := bytes .Split (resp .Body .Bytes (), []byte ("\n " ))[0 ]
60816081 var output map [string ]interface {}
60826082 if err := json .Unmarshal (firstLine , & output ); err != nil {
6083- t .Fatalf ("err: %v" , err )
6083+ r .Fatalf ("err: %v" , err )
60846084 }
60856085 })
60866086 })
@@ -6672,7 +6672,7 @@ func TestAgentConnectCARoots_list(t *testing.T) {
66726672
66736673 dec := json .NewDecoder (resp .Body )
66746674 value := & structs.IndexedCARoots {}
6675- require .NoError (t , dec .Decode (value ))
6675+ require .NoError (r , dec .Decode (value ))
66766676 if ca .ID != value .ActiveRootID {
66776677 r .Fatalf ("%s != %s" , ca .ID , value .ActiveRootID )
66786678 }
@@ -7080,7 +7080,7 @@ func TestAgentConnectCALeafCert_goodNotLocal(t *testing.T) {
70807080
70817081 dec := json .NewDecoder (resp .Body )
70827082 issued2 := & structs.IssuedCert {}
7083- require .NoError (t , dec .Decode (issued2 ))
7083+ require .NoError (r , dec .Decode (issued2 ))
70847084 if issued .CertPEM == issued2 .CertPEM {
70857085 r .Fatalf ("leaf has not updated" )
70867086 }
@@ -7092,9 +7092,9 @@ func TestAgentConnectCALeafCert_goodNotLocal(t *testing.T) {
70927092 }
70937093
70947094 // Verify that the cert is signed by the new CA
7095- requireLeafValidUnderCA (t , issued2 , ca )
7095+ requireLeafValidUnderCA (r , issued2 , ca )
70967096
7097- require .NotEqual (t , issued , issued2 )
7097+ require .NotEqual (r , issued , issued2 )
70987098 })
70997099 }
71007100}
@@ -7471,11 +7471,11 @@ func TestAgentConnectCALeafCert_secondaryDC_good(t *testing.T) {
74717471 // Try and sign again (note no index/wait arg since cache should update in
74727472 // background even if we aren't actively blocking)
74737473 a2 .srv .h .ServeHTTP (resp , req )
7474- require .Equal (t , http .StatusOK , resp .Code )
7474+ require .Equal (r , http .StatusOK , resp .Code )
74757475
74767476 dec := json .NewDecoder (resp .Body )
74777477 issued2 := & structs.IssuedCert {}
7478- require .NoError (t , dec .Decode (issued2 ))
7478+ require .NoError (r , dec .Decode (issued2 ))
74797479 if issued .CertPEM == issued2 .CertPEM {
74807480 r .Fatalf ("leaf has not updated" )
74817481 }
@@ -7487,9 +7487,9 @@ func TestAgentConnectCALeafCert_secondaryDC_good(t *testing.T) {
74877487 }
74887488
74897489 // Verify that the cert is signed by the new CA
7490- requireLeafValidUnderCA (t , issued2 , dc1_ca2 )
7490+ requireLeafValidUnderCA (r , issued2 , dc1_ca2 )
74917491
7492- require .NotEqual (t , issued , issued2 )
7492+ require .NotEqual (r , issued , issued2 )
74937493 })
74947494}
74957495
@@ -7499,12 +7499,12 @@ func waitForActiveCARoot(t *testing.T, srv *HTTPHandlers, expect *structs.CARoot
74997499 resp := httptest .NewRecorder ()
75007500 srv .h .ServeHTTP (resp , req )
75017501 if http .StatusOK != resp .Code {
7502- t .Fatalf ("expected 200 but got %v" , resp .Code )
7502+ r .Fatalf ("expected 200 but got %v" , resp .Code )
75037503 }
75047504
75057505 dec := json .NewDecoder (resp .Body )
75067506 roots := & structs.IndexedCARoots {}
7507- require .NoError (t , dec .Decode (roots ))
7507+ require .NoError (r , dec .Decode (roots ))
75087508
75097509 var root * structs.CARoot
75107510 for _ , r := range roots .Roots {
0 commit comments