From c9352592e25d86731ed89fcfac1a60c3031af19c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 25 May 2020 15:35:54 -0700 Subject: [PATCH] desktop_login: correct ownership of home dir after touching it Here we are creating ~/.config for a newly-created user with root ownership. We can't leave it that way, as commands run as the user account won't be able to change it, as they should be able to. So we need to change the ownership (and, just in case, fix SELinux contexts) afterwards. This was the real source of the problem we were seeing (the test failing early due to the gsettings command which should turn the screen background black failing). Signed-off-by: Adam Williamson --- tests/desktop_login.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index 2a5ef3f0..34b89482 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -54,6 +54,8 @@ sub adduser { if ($desktop eq "gnome") { assert_script_run "mkdir /home/$login/.config"; assert_script_run "echo 'yes' >> /home/$login/.config/gnome-initial-setup-done"; + assert_script_run "chown -R $login.$login /home/$login/.config"; + assert_script_run "restorecon -vr /home/$login/.config"; } if ($args{termstop}) { type_very_safely "exit\n";