avocado-framework/avocado — pull request #242 by ruda (2014-10-22 14:34:17+00:00)
Title: Introduce avocado.utils.script module

Introduce `avocado.utils.script` module to handle the creation of scripts stored in the file system.

The module includes a flexible class for creating generic scripts and includes utilities functions too. Some examples:

CONTENT = """
#!/bin/sh
echo "Hi There!"
"""

x = avocado.utils.script.Script('/var/tmp/test.sh', CONTENT)
x.save()
... do something with x, like run it ...
x.remove()

t = avocado.utils.script.make_temp_script('test.sh', CONTENT)
... do something with y, like run it ...

Many Avocado's functional tests makes use of script creation, so we will handle these creation using this proper module.