diff mbox series

[meta-filesystems,kirkstone,3/3] sshfs-fuse: fix ptests

Message ID 20251028202829.2311091-3-skandigraun@gmail.com
State New
Headers show
Series [meta-networking,kirkstone,1/3] openl2tp: Fix ptests | expand

Commit Message

Gyorgy Sarvari Oct. 28, 2025, 8:28 p.m. UTC
Disable host key checking during tests, so the test can be executed without
human intervention. Also add missing dependency.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest  | 9 +++++++++
 .../recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb   | 2 ++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest b/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest
index b63c4de0d9..b10922d02e 100644
--- a/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest
+++ b/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest
@@ -1,3 +1,12 @@ 
 #!/bin/sh
 
+trap "[ -d ~/.ssh.bak ] && rm -rf ~/.ssh && mv ~/.ssh.bak ~/.ssh || rm -rf ~/.ssh" INT EXIT
+if [ -d ~/.ssh ]; then
+  mv ~/.ssh ~/ssh.bak
+fi
+
+mkdir ~/.ssh
+echo "Host localhost" >> ~/.ssh/config
+echo "    StrictHostKeyChecking no" >> ~/.ssh/config
+
 pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
diff --git a/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb b/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb
index f91e682d24..bde0949992 100644
--- a/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb
+++ b/meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb
@@ -19,9 +19,11 @@  SRC_URI += " \
 RDEPENDS:${PN}-ptest += " \
         ${PYTHON_PN}-pytest \
         bash \
+        fuse \
 "
 
 do_install_ptest() {
         install -d ${D}${PTEST_PATH}/test
         cp -rf ${S}/test/* ${D}${PTEST_PATH}/test/
+        ln -sf ${bindir}/sshfs ${D}${PTEST_PATH}/sshfs
 }