Use UIDFaker to ensure Credentials_test cleans up setting UID
Credntials_test currently sets the UID back to ROOT in the teardown of the class. It also doesn't ensure the UIDs are set back after each call to seteuid. This seems to result in a race where the UID is not updated before calling the next test. This may lead to failures in later tests if the UID is not updated in time. This fix also exposes a bug in the CredentialsTest where it verifes that Shell UID doesn't have privilege access to SF, but that's actually incorrect since Shell does have ACCESS_SURFACE_FLINGER permission so it can call the privileged APIs. Test: CredentialsTest Bug: 243597796 Change-Id: I515f802aaedf1ea3dfc345af54e4d7383335bbb7
Loading
Please register or sign in to comment