Skip to content
Snippets Groups Projects
Commit 26492f0e authored by Esben Haabendal's avatar Esben Haabendal
Browse files

openharmony-standard-image-tests: Fix ptest ssh timeout in QEMU


SSH host keys are generated by sshdgenkeys.service, which is started by socket
activation on first SSH connection. On QEMU this can take a very long time, even
more than the 300 seconds that is the default timeout when running SSH commands
testimage recipes.

Pre-generated SSH host keys prevents this.

Note, this is only done in the -test image, as it is insecure and should never
be done in images used for other purposes!

Signed-off-by: default avatarEsben Haabendal <esben@geanix.com>
parent ce5d550e
No related branches found
No related tags found
1 merge request!119Fix problems with ssh timeout in ptest CI job
...@@ -40,6 +40,9 @@ INHERIT += "uninative" ...@@ -40,6 +40,9 @@ INHERIT += "uninative"
# instead. # instead.
HOSTTOOLS += "ip ping ps scp ssh stty" HOSTTOOLS += "ip ping ps scp ssh stty"
# Yocto does not have ssh-keygen-native, so we need to use ssh-keygen from host
HOSTTOOLS += "ssh-keygen"
# Default to enabling serial debug console on RaspberryPi # Default to enabling serial debug console on RaspberryPi
# Placed here to amend the machine config living in meta-raspberrypi # Placed here to amend the machine config living in meta-raspberrypi
ENABLE_UART:raspberrypi4-64 ?= "1" ENABLE_UART:raspberrypi4-64 ?= "1"
......
...@@ -25,3 +25,13 @@ IMAGE_INSTALL += "ptest-runner" ...@@ -25,3 +25,13 @@ IMAGE_INSTALL += "ptest-runner"
# install OpenHarmony components and ptests # install OpenHarmony components and ptests
IMAGE_INSTALL += "openharmony-standard-ptest" IMAGE_INSTALL += "openharmony-standard-ptest"
# Pre-generate SSH host keys for quick first time SSH connection
ROOTFS_POSTPROCESS_COMMAND += "ssh_host_key_gen;"
SSH_HOST_KEY_TYPES="rsa ecdsa ed25519"
ssh_host_key_gen() {
mkdir -p "${IMAGE_ROOTFS}${sysconfdir}/ssh/"
for type in ${SSH_HOST_KEY_TYPES} ; do
ssh-keygen -f "${IMAGE_ROOTFS}${sysconfdir}/ssh/ssh_host_"$type"_key" -N '' -t $type
done
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment