Skip to content

Conversation

@Acesif
Copy link
Contributor

@Acesif Acesif commented Oct 25, 2024

Currently I'm stuck on this error and having difficulty resolving this:
The pytest test script and conftest are in tests/python

_____________________________ test_ssh_wrapper_command_execution _____________________________

ssh_server = {'container_name': 'openssh-wrapper', 'private_key_path': '/home/acesif/PROBE/probe_src/tests/python/ssh_keys/id_rsa', 'ssh_dir': '/home/acesif/PROBE/probe_src/tests/python/ssh_keys'}

    def test_ssh_wrapper_command_execution(ssh_server):
        env = os.environ.copy()
        env["__PROBE_LIB"] = "../../libprobe/build"  # Ensure the libprobe path is correctly set
    
        ssh = paramiko.SSHClient()
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    
        # Connect via SSH wrapper and run a command
        wrapper_cmd = [
            "python", "-m", "probe_py.manual.cli", "ssh", "--", "-i", ssh_server["private_key_path"], "-p", "2222",
            "sshwrapper@localhost", "ls"
        ]
    
        result = subprocess.run(wrapper_cmd, env=env, capture_output=True)
>       assert result.returncode == 0, f"SSH Wrapper command failed: {result.stderr.decode()}"
E       AssertionError: SSH Wrapper command failed: Warning: Permanently added '[localhost]:2222' (ED25519) to the list of known hosts.
E         Error relocating /tmp/probe_log_1tC9Gl/libprobe.so: __fprintf_chk: symbol not found
E         Error relocating /tmp/probe_log_1tC9Gl/libprobe.so: __snprintf_chk: symbol not found
E         Error relocating /tmp/probe_log_1tC9Gl/libprobe.so: __memcpy_chk: symbol not found
E         
E       assert 127 == 0
E        +  where 127 = CompletedProcess(args=['python', '-m', 'probe_py.manual.cli', 'ssh', '--', '-i', '/home/acesif/PROBE/probe_src/tests/p..._snprintf_chk: symbol not found\nError relocating /tmp/probe_log_1tC9Gl/libprobe.so: __memcpy_chk: symbol not found\n").returncode

test_ssh_wrapper.py:22: AssertionError
================================== short test summary info ===================================
FAILED test_ssh_wrapper.py::test_ssh_wrapper_command_execution - AssertionError: SSH Wrapper command failed: Warning: Permanently added '[localhost]:2222' (ED25519) to the list of known hosts.
===================================== 1 failed in 20.69s =====================================

@Acesif Acesif marked this pull request as draft October 25, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant