Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-59885

CURL() tests fail when the "Get" and "Request" options are conflicting

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      It was observed that a CURL() function test failed when the CURL() call had conflicting values for the "get" and "request" options.

      For example:

      SELECT CURL("http://test:8080", {"get":false, "request":GET})
       

      Output from QE tests:

      Curl output:

      2023-11-27 17:12:41 | INFO | MainProcess | test_thread | [remote_util.execute_command_raw] running command.raw on 172.23.120.106: curl --get https://maps.googleapis.com/maps/api/geocode/json -d 'address=santa+cruz&components=country:ES&key=AIzaSyCT6niGCMsgegJkQSYSqpoLZ4_rSO59XQQ'
      2023-11-27 17:12:42 | INFO | MainProcess | test_thread | [remote_util.execute_command_raw] command executed with root but got an error ['  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current', '                                 Dload  Upload   Total   Spent    Left  Speed', '', '  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0', '  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0', '100   111  100   111    0     0    106      0  0:00:01  0:00:01 -- ...
      2023-11-27 17:12:42 | INFO | MainProcess | test_thread | [tuq_curl.test_conflicting_get_options] (['{', '   "error_message" : "The provided API key is invalid. ",', '   "results" : [],', '   "status" : "REQUEST_DENIED"', '}'], ['  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current', '                                 Dload  Upload   Total   Spent    Left  Speed', '', '  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0', '  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0', '100   111  100   111    0     0    106      0  0:00:01  0:00:01 --:--:--   106', '100   111  100   111    0     0    106      0  0:00:01  0:00:01 --:--:--   106']) 

      CURL() output:

      2023-11-27 17:12:42 | INFO | MainProcess | test_thread | [remote_util.execute_commands_inside] running command on 172.23.120.106: /opt/couchbase/bin/cbq -e 172.23.120.106:8093 -q -u Administrator -p password -s="select curl('https://maps.googleapis.com/maps/api/geocode/json', {'get':False,'request':'GET','data': 'address=santa+cruz&components=country:ES&key=AIzaSyCT6niGCMsgegJkQSYSqpoLZ4_rSO59XQQ'})"
       
          self.assertEqual(actual_curl['results'][0]['$1'], expected_curl, f"Actual result: {actual_curl['results'][0]['$1']}")
      AssertionError: {'error_message': "Invalidrequest.Missingthe'address','comp[79 chars]EST'} != {'error_message': 'TheprovidedAPIkeyisinvalid.', 'results':[27 chars]IED'}
      - {'error_message': "Invalidrequest.Missingthe'address','components','latlng'or'place_id'parameter.",
      + {'error_message': 'TheprovidedAPIkeyisinvalid.',
         'results': [],
      -  'status': 'INVALID_REQUEST'}
      +  'status': 'REQUEST_DENIED'} : Actual result: {'error_message': "Invalidrequest.Missingthe'address','components','latlng'or'place_id'parameter.", 'results': [], 'status': 'INVALID_REQUEST'} 

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              dhanya.gowrish Dhanya Gowrish
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty