public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] test.sh and ROD redirection
@ 2016-01-21 13:51 Cyril Hrubis
  2016-01-22  9:15 ` Alexey Kodanev
  0 siblings, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2016-01-21 13:51 UTC (permalink / raw)
  To: ltp

Hi!
As I've been doing last minute fixes to shell testcases I've stambled
upon this problem. We have a couple of places that do:

ROD echo foo > bar

And while this works fine if the command executes successfully it writes
the error message to the file bar on failure as well (since the part
that gets to the ROD as $@ is the 'echo foo' while the '> bar' is parsed
by the shell.

One solution would be redirecting the messages from tst_* to stderr, so
we would be able to at least see the error message, but this wouldn't
catch errors when we cannot write to the 'bar' (since echo foo would
executed successfully anyway).

Another solution would be to create ROD_ECHO and ROD_CAT and change ROD
to abort if anybody tries to use it with these two. Which solves our
usage pattern but this is clumsy and still broken as anyone can redirect
output from ROD anyway.

Is there a elegant solution to this problem that I'm missing?

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-25 18:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 13:51 [LTP] test.sh and ROD redirection Cyril Hrubis
2016-01-22  9:15 ` Alexey Kodanev
2016-01-25 11:16   ` Cyril Hrubis
2016-01-25 13:45     ` Cyril Hrubis
2016-01-25 16:26       ` Alexey Kodanev
2016-01-25 16:41         ` Cyril Hrubis
2016-01-25 17:18         ` Cyril Hrubis
2016-01-25 17:51           ` Alexey Kodanev
2016-01-25 18:07             ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox