<div dir="ltr"><div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 7, 2019 at 7:44 AM Saravana Kannan <<a href="mailto:saravanak@google.com" target="_blank">saravanak@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 7, 2019, 3:00 AM Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
> - ltpuser = SAFE_GETPWNAM(username);<br>
> - uid = ltpuser->pw_uid;<br>
> + if (!tst_run_cmd(cmd_useradd, NULL, NULL, 1)) {<br>
> + user_added = 1;<br>
> + ltpuser = SAFE_GETPWNAM(username);<br>
> + uid = ltpuser->pw_uid;<br>
> + }<br>
<br>
The only thing that I don't like here is that we do not check the cause<br>
of failure here. What exactly happens on android, is useradd missing<br>
there completely?</blockquote></div></div><div dir="auto"><br></div><div dir="auto"></div><div dir="auto">Correct, useradd is missing.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> If so we should proceed with TCONF only if<br>
tst_run_cmd() returned 255 and TBROK the test on other non-zero return<br>
values.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">But is the test that's broken if useradd fails for wherever reason? Isn't it a configuration issue?</div><div dir="auto"><br></div></div></blockquote><div><br></div><div>Looking more into the definition of TBROK, TCONF and the code before my changes:</div><div><br></div><div><div>- if (eaccess("/etc/passwd", W_OK))</div><div>- tst_brk(TCONF, "/etc/passwd is not accessible");</div><div>-</div><div>- tst_run_cmd(cmd_useradd, NULL, NULL, 0);</div><div>- user_added = 1;</div><div>-</div></div><div><br></div><div>Should an eaccess write failure have resulted in a TCONF? Shouldn't that have been a TBROK too?<br></div><div><br></div><div>I'm fine with whatever way we go, except not wanting to fail the entire test case just because useradd isn't present in android. It's still very useful to run the other setpriority tests.</div><div><br></div><div>Thanks,</div><div>Saravana</div></div></div></div>