diff --git a/lib/utils.pm b/lib/utils.pm index 471dda78492c..332207ee2860 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -956,7 +956,7 @@ sub ensure_serialdev_permissions { # ownership has effect immediately, group change is for effect after # reboot an alternative https://superuser.com/a/609141/327890 would need # handling of optional sudo password prompt within the exec - assert_script_run "chown $testapi::username /dev/$testapi::serialdev && gpasswd -a $testapi::username dialout"; + assert_script_run "chown $testapi::username /dev/$testapi::serialdev && gpasswd -a $testapi::username \$(stat -c %G /dev/$testapi::serialdev)"; } 1;