提交 771c3564 编写于 作者: C Cleber Rosa

doublefree test: fix the temporary directories being used

This test is using the location of the source file as the build
location, instead of the `srcdir` provided by the Test class.

Also, since `srcdir` is a temporary directory, I believe we should
not have to manually clean it up.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 7cb90a27
#!/usr/bin/python
import os
import shutil
from avocado import test
from avocado import job
......@@ -20,9 +21,10 @@ class DoubleFreeTest(test.Test):
"""
Build 'doublefree'.
"""
self.cwd = os.getcwd()
c_file = self.get_data_path(self.params.source)
self.srcdir = os.path.dirname(c_file)
c_file_name = os.path.basename(c_file)
dest_c_file = os.path.join(self.srcdir, c_file_name)
shutil.copy(c_file, dest_c_file)
build.make(self.srcdir,
env={'CFLAGS': '-g -O0'},
extra_args='doublefree')
......@@ -35,11 +37,5 @@ class DoubleFreeTest(test.Test):
cmd_result = process.run(cmd)
self.log.info(cmd_result)
def cleanup(self):
"""
Clean up 'doublefree'.
"""
os.unlink(os.path.join(self.srcdir, 'doublefree'))
if __name__ == "__main__":
job.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册