]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
oeqa/ssh: Handle SSHCall timeout error code
authorluca fancellu <luca.fancellu@arm.com>
Thu, 9 Nov 2023 14:36:31 +0000 (14:36 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Nov 2023 17:44:15 +0000 (17:44 +0000)
commit948fecca1db4c7a30fcca5fcf5eef95cd12efb00
treefd2fdebd4225b07c76d71e15fdd0b31f2bcd6856
parent5356afef9f0ee70fb804ff9fc8746bcaa47c02ba
oeqa/ssh: Handle SSHCall timeout error code

The current code in ssh.py is terminating the ssh process that
does not finish its computation in a given timeout (when timeout
is passed), the SSHCall function is returning the process error
code.

The Openssl ssh before version 8.6_p1 is returning 0 when it is
terminated, from commit 8a9520836e71830f4fccca066dba73fea3d16bda
onwards (version >= 8.6_p1) ssh is returning 255 instead.

So for version of ssh older than 8.6_p1 when the SSHCall time out,
the return code will be 0, meaning success, which is wrong.

Fix this issue checking if the process has timeout (hence it's been
terminated) and checking if the returned code is 0, in that case
set it to 255 to advertise that an error occurred.

Add a test case excercising the timeout in the SSHTest, test_ssh
test function.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/lib/oeqa/core/target/ssh.py
meta/lib/oeqa/runtime/cases/ssh.py