@@ -23,57 +23,57 @@ const (
2323
2424func TestGrpc_ConfigApply (t * testing.T ) {
2525 ctx := context .Background ()
26- teardownTest := setupConnectionTest (t , false , false )
26+ teardownTest := SetupConnectionTest (t , false , false )
2727 defer teardownTest (t )
2828
29- nginxInstanceID := verifyConnection (t , 2 )
29+ nginxInstanceID := VerifyConnection (t , 2 )
3030
31- responses := getManagementPlaneResponses (t , 1 )
31+ responses := GetManagementPlaneResponses (t , 1 )
3232 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_OK , responses [0 ].GetCommandResponse ().GetStatus ())
3333 assert .Equal (t , "Successfully updated all files" , responses [0 ].GetCommandResponse ().GetMessage ())
3434
3535 t .Run ("Test 1: No config changes" , func (t * testing.T ) {
36- clearManagementPlaneResponses (t )
37- performConfigApply (t , nginxInstanceID )
38- responses = getManagementPlaneResponses (t , 1 )
36+ ClearManagementPlaneResponses (t )
37+ PerformConfigApply (t , nginxInstanceID )
38+ responses = GetManagementPlaneResponses (t , 1 )
3939 t .Logf ("Config apply responses: %v" , responses )
4040
4141 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_OK , responses [0 ].GetCommandResponse ().GetStatus ())
4242 assert .Equal (t , "Config apply successful, no files to change" , responses [0 ].GetCommandResponse ().GetMessage ())
4343 })
4444
4545 t .Run ("Test 2: Valid config" , func (t * testing.T ) {
46- clearManagementPlaneResponses (t )
47- err := mockManagementPlaneGrpcContainer .CopyFileToContainer (
46+ ClearManagementPlaneResponses (t )
47+ err := MockManagementPlaneGrpcContainer .CopyFileToContainer (
4848 ctx ,
4949 "../config/nginx/nginx-with-test-location.conf" ,
5050 fmt .Sprintf ("/mock-management-plane-grpc/config/%s/etc/nginx/nginx.conf" , nginxInstanceID ),
5151 0o666 ,
5252 )
5353 require .NoError (t , err )
5454
55- performConfigApply (t , nginxInstanceID )
55+ PerformConfigApply (t , nginxInstanceID )
5656
57- responses = getManagementPlaneResponses (t , 1 )
57+ responses = GetManagementPlaneResponses (t , 1 )
5858 t .Logf ("Config apply responses: %v" , responses )
5959
6060 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_OK , responses [0 ].GetCommandResponse ().GetStatus ())
6161 assert .Equal (t , "Config apply successful" , responses [0 ].GetCommandResponse ().GetMessage ())
6262 })
6363
6464 t .Run ("Test 3: Invalid config" , func (t * testing.T ) {
65- clearManagementPlaneResponses (t )
66- err := mockManagementPlaneGrpcContainer .CopyFileToContainer (
65+ ClearManagementPlaneResponses (t )
66+ err := MockManagementPlaneGrpcContainer .CopyFileToContainer (
6767 ctx ,
6868 "../config/nginx/invalid-nginx.conf" ,
6969 fmt .Sprintf ("/mock-management-plane-grpc/config/%s/etc/nginx/nginx.conf" , nginxInstanceID ),
7070 0o666 ,
7171 )
7272 require .NoError (t , err )
7373
74- performConfigApply (t , nginxInstanceID )
74+ PerformConfigApply (t , nginxInstanceID )
7575
76- responses = getManagementPlaneResponses (t , 2 )
76+ responses = GetManagementPlaneResponses (t , 2 )
7777 t .Logf ("Config apply responses: %v" , responses )
7878
7979 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_ERROR , responses [0 ].GetCommandResponse ().GetStatus ())
@@ -85,10 +85,10 @@ func TestGrpc_ConfigApply(t *testing.T) {
8585 })
8686
8787 t .Run ("Test 4: File not in allowed directory" , func (t * testing.T ) {
88- clearManagementPlaneResponses (t )
89- performInvalidConfigApply (t , nginxInstanceID )
88+ ClearManagementPlaneResponses (t )
89+ PerformInvalidConfigApply (t , nginxInstanceID )
9090
91- responses = getManagementPlaneResponses (t , 1 )
91+ responses = GetManagementPlaneResponses (t , 1 )
9292 t .Logf ("Config apply responses: %v" , responses )
9393
9494 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_FAILURE , responses [0 ].GetCommandResponse ().GetStatus ())
0 commit comments