Skip to content

RemoteOperations::exec_command does not handle 'expect_error' parameter correctly #159

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

Closed
dmitry-lipetsk opened this issue Dec 7, 2024 · 0 comments · Fixed by #160
Closed
Assignees

Comments

@dmitry-lipetsk
Copy link
Collaborator

RemoteOperations::exec_command must not raise and Exception when we define expect_error = True

if expect_error:
raise Exception(result, error)

Test case:

    def test_exec_command_failure__expect_error(self):
        """
        Test exec_command for command execution failure.
        """
        cmd = "nonexistent_command"

        exit_status, result, error = self.operations.exec_command(cmd, verbose=True, wait_exit=True, shell=True, expect_error=True)

        assert error == b'bash: line 1: nonexistent_command: command not found\n'
        assert exit_status == 127
        assert result == b''
dmitry-lipetsk added a commit to dmitry-lipetsk/testgres that referenced this issue Dec 7, 2024
@dmitry-lipetsk dmitry-lipetsk self-assigned this Dec 7, 2024
dmitry-lipetsk added a commit that referenced this issue Dec 8, 2024
…expect_error

RemoteOperations::exec_command must not raise an exception when 'expect_error' is True (#159)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant