Rahix / tbot

Automation/Testing tool for Embedded Linux Development
https://tbot.tools
GNU General Public License v3.0
89 stars 21 forks source link

Missing documentation for special character: Background #25

Closed niecore closed 4 years ago

Rahix commented 4 years ago

Hi!

I think I've left it out of documentation because it has a few nasty side-effects. If a program in the background still outputs to the console, this will silently break things. Ideally, a proper Background special symbol would always redirect output to prevent all console clobbering. E.g.

# Automatically adds redirects to /dev/null
m.exec0("python", "-m", "http.server", linux.Background)

# Redirect stdout
m.exec0("python", "-m", "http.server", linux.Background(stdout="/tmp/http.log"))

# Redirect stdout & stderr
m.exec0("python", "-m", "http.server", linux.Background(stdout="/tmp/http.log", stderr="/tmp/http-error.log"))

But this, of course, needs to be implemented first ...

Rahix commented 4 years ago

Finally got around to adding this: https://tbot.tools/modules/machine_linux.html#tbot.machine.linux.Background