From 5a6b808e40c56b578c9d29a79bd1c321e37de9cf Mon Sep 17 00:00:00 2001 From: Dehan Meng Date: Mon, 20 Jan 2025 09:09:10 +0800 Subject: [PATCH] qemu_guest_agent: Called before the variable is assigned add_line_at_end is called before the {guest_homepath} is assigned. same as cmd_get_guestkey, cmd_del_key_file. Signed-off-by: Dehan Meng --- qemu/tests/cfg/qemu_guest_agent.cfg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qemu/tests/cfg/qemu_guest_agent.cfg b/qemu/tests/cfg/qemu_guest_agent.cfg index c772fee611..b6505e3e7e 100644 --- a/qemu/tests/cfg/qemu_guest_agent.cfg +++ b/qemu/tests/cfg/qemu_guest_agent.cfg @@ -555,9 +555,6 @@ cmd_clean_keys = rm -rf ~/.ssh/* ssh_keygen_cmd = "ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa" cmd_get_hostkey = "cat ~/.ssh/id_rsa.pub" - add_line_at_end = "echo >> ${guest_homepath}/.ssh/authorized_keys" - cmd_get_guestkey = "cat ${guest_homepath}/.ssh/authorized_keys" - cmd_del_key_file = "rm -rf ${guest_homepath}/.ssh/authorized_keys" cmd_install_sshpass = "dnf -y install sshpass" # Please set user password # guest_user_passwd = @@ -568,6 +565,7 @@ guest_homepath = /${guest_user} test_login_guest = ssh ${guest_user}@%s -o StrictHostKeyChecking=no ls ${guest_homepath} output_check_str = 'anaconda-ks.cfg' + cmd_get_guestkey = "cat ${guest_homepath}/.ssh/authorized_keys" - non_root_user: only Linux guest_user = "fedora" @@ -576,6 +574,7 @@ cmd_remove_user = userdel -rf ${guest_user} test_login_guest = ssh ${guest_user}@%s -o StrictHostKeyChecking=no ls '/home' output_check_str = '${guest_user}' + cmd_get_guestkey = "cat ${guest_homepath}/.ssh/authorized_keys" - administrator: only Windows guest_user = "Administrator" @@ -595,6 +594,8 @@ cmd_sshpass = 'sshpass -p %s ssh ${guest_user}@%s -o StrictHostKeyChecking=no dir "${guest_homepath}"' test_login_guest = ssh ${guest_user}@%s -o StrictHostKeyChecking=no dir "${guest_homepath}" output_check_str = "Downloads" + add_line_at_end = "echo >> ${guest_homepath}/.ssh/authorized_keys" + cmd_del_key_file = "rm -rf ${guest_homepath}/.ssh/authorized_keys" - check_get_cpustats: only Linux no RHEL.7 RHEL.8 RHEL.9.1 RHEL.9.0