Add support for cloud tests to ansible-test. (#24315)

* Split out ansible-test docker functions.
* Add cloud support to ansible-test.
This commit is contained in:
Matt Clay 2017-05-05 16:23:00 +08:00 committed by GitHub
parent 986765312f
commit a07d42e16d
19 changed files with 1059 additions and 135 deletions

View file

@ -5,6 +5,10 @@ from __future__ import absolute_import, print_function
import tarfile
import os
from lib.util import (
display,
)
# improve performance by disabling uid/gid lookups
tarfile.pwd = None
tarfile.grp = None
@ -44,7 +48,7 @@ def ignore(item):
if item.path.startswith('./test/results/'):
return None
if item.path.startswith('./docsite/') and filename.endswith('_module.rst'):
if item.path.startswith('./docs/docsite/_build/'):
return None
if name in IGNORE_FILES:
@ -65,5 +69,9 @@ def create_tarfile(dst_path, src_path, tar_filter):
:type src_path: str
:type tar_filter: (tarfile.TarInfo) -> tarfile.TarInfo | None
"""
display.info('Creating a compressed tar archive of path: %s' % src_path, verbosity=1)
with tarfile.TarFile.gzopen(dst_path, mode='w', compresslevel=4) as tar:
tar.add(src_path, filter=tar_filter)
display.info('Resulting archive is %d bytes.' % os.path.getsize(dst_path), verbosity=1)