Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set user password fix #6060

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

fangge1212
Copy link
Contributor

No description provided.

1. Escape "$" in the encrypted password
If "$" is not escaped in the virsh command parameter, libvirt will
parse it to wrong value and set wrong password in guest.

2. Fail the test case if it can't login guest with new password
Previsouly, the code only logged the message and doesn't fail the case.

Signed-off-by: Fangge Jin <[email protected]>
@fangge1212
Copy link
Contributor Author

I will provide test results later

1. Remove the code of logging in guest with old password as it is
   meaningless
2. Move the restore vm logic to finally block

Signed-off-by: Fangge Jin <[email protected]>
@fangge1212
Copy link
Contributor Author

Test results:
# avocado run --vt-type libvirt --vt-omit-data-loss --vt-machine-type q35 virsh.set_user_password --vt-connect-uri qemu:///system

JOB ID : c26eb2744988e353e3529c0f8b6edb7b85c63653
JOB LOG : /var/log/avocado/job-results/job-2024-12-12T02.49-c26eb27/job.log
(1/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.root.encrypted: STARTED
(1/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.root.encrypted: PASS (50.03 s)
(2/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.root.non-encrypted: STARTED
(2/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.root.non-encrypted: PASS (49.91 s)
(3/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.normal_user.encrypted: STARTED
(3/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.normal_user.encrypted: PASS (53.32 s)
(4/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.normal_user.non-encrypted: STARTED
(4/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.normal_test.normal_user.non-encrypted:PASS (54.06 s)
(5/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_start_ga: STARTED
(5/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_start_ga: PASS (6.97 s)
(6/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_existed_domain: STARTED
(6/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_existed_domain: PASS (7.06 s)
(7/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_existed_user: STARTED
(7/7) type_specific.io-github-autotest-libvirt.virsh.set_user_password.error_test.not_existed_user: PASS (47.51 s)

@fangge1212 fangge1212 changed the title Set user password updates Set user password fix Dec 12, 2024
@fangge1212
Copy link
Contributor Author

@chunfuwen Please help to review this pr

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