Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate integration test failures #98

Closed
t1m0thyj opened this issue Jul 11, 2022 · 1 comment · Fixed by #248
Closed

Investigate integration test failures #98

t1m0thyj opened this issue Jul 11, 2022 · 1 comment · Fixed by #248
Labels
bug Something isn't working priority-low severity-low

Comments

@t1m0thyj
Copy link
Member

________________________ TestTsoIntegration.test_issue_command_should_return_valid_response ________________________

self = <integration.test_zos_tso.TestTsoIntegration testMethod=test_issue_command_should_return_valid_response>

    def test_issue_command_should_return_valid_response(self):
        """Executing the issue_command method should return a valid response from TSO"""
>       command_output = self.tso.issue_command("TIME")

tests\integration\test_zos_tso.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\zos_tso\zowe\zos_tso_for_zowe_sdk\tso.py:59: in issue_command
    command_output = self.send_tso_message(session_key, command)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <zowe.zos_tso_for_zowe_sdk.tso.Tso object at 0x000001D6F54ACCA0>, session_key = 'XXX', message = 'TIME'

    def send_tso_message(self, session_key, message):
        """Send a command to an existing TSO session.

        Parameters
        ----------
        session_key: str
            The session key of an existing TSO session
        message: str
            The message/command to be sent to the TSO session

        Returns
        -------
        list
            A non-normalized list from TSO containing the result from the command
        """
        custom_args = self._create_custom_request_arguments()
        custom_args["url"] = "{}/{}".format(self.request_endpoint, str(session_key))
        custom_args["json"] = {"TSO RESPONSE":{"VERSION":"0100","DATA":str(message)}}
        response_json = self.request_handler.perform_request("PUT", custom_args)
>       return response_json["tsoData"]
E       KeyError: 'tsoData'

src\zos_tso\zowe\zos_tso_for_zowe_sdk\tso.py:130: KeyError
@t1m0thyj t1m0thyj changed the title Investigate zos-tso integration test failure Investigate integration test failures Jul 13, 2022
@shalearkane
Copy link
Contributor

___________________________________________ TestConsoleIntegration.test_console_command_time_should_return_time ____________________________________________

self = <integration.test_zos_console.TestConsoleIntegration testMethod=test_console_command_time_should_return_time>

    def test_console_command_time_should_return_time(self):
        """Test the execution of the time command should return the current time"""
>       command_output = self.console.issue_command("D T")

tests/integration/test_zos_console.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/zos_console/zowe/zos_console_for_zowe_sdk/console.py:44: in issue_command
    response_json = self.request_handler.perform_request("PUT", custom_args)
src/core/zowe/core_for_zowe_sdk/request_handler.py:72: in perform_request
    self.__validate_response()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <zowe.core_for_zowe_sdk.request_handler.RequestHandler object at 0x7f327afec130>

    def __validate_response(self):
        """Validate if request response is acceptable based on expected code list.
    
        Raises
        ------
        UnexpectedStatus
            If the response status code is not in the expected code list
        RequestFailed
            If the HTTP/HTTPS request fails
        """
        # Automatically checks if status code is between 200 and 400
        if self.response:
            if self.response.status_code not in self.expected_code:
                raise UnexpectedStatus(self.expected_code, self.response.status_code, self.response.text)
        else:
            output_str = str(self.response.request.url)
            output_str += "\n" + str(self.response.request.headers)
            output_str += "\n" + str(self.response.request.body)
            output_str += "\n" + str(self.response.text)
>           raise RequestFailed(self.response.status_code, output_str)
E           zowe.core_for_zowe_sdk.exceptions.RequestFailed: HTTP Request has failed with status code 400. 
E            https://zzow03.zowe.marist.cloud:10443/zosmf/restconsoles/consoles/defcn
E           {'User-Agent': 'python-requests/2.25.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-type': 'application/json', 'X-CSRF-ZOSMF-HEADER': '', 'Content-Length': '14', 'Authorization': 'Basic TUVOVEVFMjpxcVBnV0Q1dQ=='}
E           b'{"cmd": "D T"}'
E           {"reason":"The console name MENTEECN already been used by user MENTEE1, please use other name or connect other user to delete theconsole.","return-code":1,"reason-code":19}

src/core/zowe/core_for_zowe_sdk/request_handler.py:136: RequestFailed```

@zFernand0 zFernand0 added bug Something isn't working priority-low severity-low labels Mar 9, 2023
@t1m0thyj t1m0thyj moved this to Low Priority in Zowe CLI Squad Dec 26, 2023
@t1m0thyj t1m0thyj linked a pull request Jan 9, 2024 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from Low Priority to Closed in Zowe CLI Squad Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low severity-low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants