avocado.utils.script: Introduce 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 ...
Avocado functional tests makes use of script creation,
so we will handle these creation using this proper module.
Signed-off-by: NRudá Moura <rmoura@redhat.com>
Showing
avocado/utils/script.py
0 → 100644
想要评论请 注册 或 登录