@@ -200,40 +200,42 @@ func TestGrpc_StartUp(t *testing.T) {
200200 verifyUpdateDataPlaneHealth (t )
201201}
202202
203- //func TestGrpc_ConfigUpload(t *testing.T) {
204- // teardownTest := setupConnectionTest(t, true, false)
205- // defer teardownTest(t)
206- //
207- // nginxInstanceID := verifyConnection(t, 2)
208- // assert.False(t, t.Failed())
209- //
210- // request := fmt.Sprintf(`{
211- // "message_meta": {
212- // "message_id": "5d0fa83e-351c-4009-90cd-1f2acce2d184",
213- // "correlation_id": "79794c1c-8e91-47c1-a92c-b9a0c3f1a263",
214- // "timestamp": "2023-01-15T01:30:15.01Z"
215- // },
216- // "config_upload_request": {
217- // "instance_id": "%s"
218- // }
219- //}`, nginxInstanceID)
220- //
221- // client := resty.New()
222- // client.SetRetryCount(retryCount).SetRetryWaitTime(retryWaitTime).SetRetryMaxWaitTime(retryMaxWaitTime)
223- //
224- // url := fmt.Sprintf("http://%s/api/v1/requests", mockManagementPlaneAPIAddress)
225- // resp, err := client.R().EnableTrace().SetBody(request).Post(url)
226- //
227- // require.NoError(t, err)
228- // assert.Equal(t, http.StatusOK, resp.StatusCode())
229- //
230- // responses := getManagementPlaneResponses(t, 2)
231- //
232- // assert.Equal(t, mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus())
233- // assert.Equal(t, "Successfully updated all files", responses[0].GetCommandResponse().GetMessage())
234- // assert.Equal(t, mpi.CommandResponse_COMMAND_STATUS_OK, responses[1].GetCommandResponse().GetStatus())
235- // assert.Equal(t, "Successfully updated all files", responses[1].GetCommandResponse().GetMessage())
236- //}
203+ func TestGrpc_ConfigUpload (t * testing.T ) {
204+ teardownTest := setupConnectionTest (t , true , false )
205+ defer teardownTest (t )
206+
207+ nginxInstanceID := verifyConnection (t , 2 )
208+ assert .False (t , t .Failed ())
209+
210+ request := fmt .Sprintf (`{
211+ "message_meta": {
212+ "message_id": "5d0fa83e-351c-4009-90cd-1f2acce2d184",
213+ "correlation_id": "79794c1c-8e91-47c1-a92c-b9a0c3f1a263",
214+ "timestamp": "2023-01-15T01:30:15.01Z"
215+ },
216+ "config_upload_request": {
217+ "instance_id": "%s"
218+ }
219+ }` , nginxInstanceID )
220+
221+ t .Logf ("Sending config upload request: %s" , request )
222+
223+ client := resty .New ()
224+ client .SetRetryCount (retryCount ).SetRetryWaitTime (retryWaitTime ).SetRetryMaxWaitTime (retryMaxWaitTime )
225+
226+ url := fmt .Sprintf ("http://%s/api/v1/requests" , mockManagementPlaneAPIAddress )
227+ resp , err := client .R ().EnableTrace ().SetBody (request ).Post (url )
228+
229+ require .NoError (t , err )
230+ assert .Equal (t , http .StatusOK , resp .StatusCode ())
231+
232+ responses := getManagementPlaneResponses (t , 2 )
233+
234+ assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_OK , responses [0 ].GetCommandResponse ().GetStatus ())
235+ assert .Equal (t , "Successfully updated all files" , responses [0 ].GetCommandResponse ().GetMessage ())
236+ assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_OK , responses [1 ].GetCommandResponse ().GetStatus ())
237+ assert .Equal (t , "Successfully updated all files" , responses [1 ].GetCommandResponse ().GetMessage ())
238+ }
237239
238240func TestGrpc_ConfigApply (t * testing.T ) {
239241 ctx := context .Background ()
0 commit comments