From 24c46489a2ed62a50d2a3210c4cc061496ddc696 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 12 Nov 2020 10:26:10 -0800 Subject: [PATCH] desktop_login: use chpasswd not passwd to set user password This allows us to use assert_script_run, and be more reliable. Same approach used in _do_install_and_reboot postinstall stuff. Signed-off-by: Adam Williamson --- tests/desktop_login.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index 5b468cf4..3613882c 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -29,9 +29,7 @@ sub adduser { assert_script_run "useradd -c '$name' $login"; if ($password ne "askuser") { # If we want to create a user with a defined password. - type_very_safely "passwd $login\n"; - type_password $password; - type_password $password; + assert_script_run "echo '$login:$password' | chpasswd"; } else { # If we want to create a user without a password,