提交 e0de5e44 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'lmr/manual-and-ci-testing-improvements-v2'

......@@ -19,6 +19,7 @@ script:
- inspekt lint
- inspekt indent
- inspekt style
- ./selftests/cyclical_deps avocado
- ./selftests/modules_boundaries
- ./selftests/run -v selftests/all/doc
- ./selftests/run -v selftests/all/functional
......
......@@ -67,12 +67,15 @@ clean:
test -L avocado/core/plugins/virt_test_list.py && rm -f avocado/core/plugins/virt_test_list.py || true
test -L etc/avocado/conf.d/virt-test.conf && rm -f etc/avocado/conf.d/virt-test.conf || true
check: clean
check: clean check_cyclical modules_boundaries
selftests/checkall
check_cyclical:
selftests/cyclical_deps avocado
modules_boundaries:
selftests/modules_boundaries
link: link_virt link_vt
link_virt:
......
......@@ -6,9 +6,6 @@
{"name": "Avocado source is sound",
"description": "On your development machine, on a freshen Avocado source to be released, run `$ make check`. Expected result: Make command should say OK."},
{"name": "Avocado modules does not contains cyclical dependencies",
"description": "Pre-requirements: Python Snakefood (pip install snakefood) and Python NetworkX (yum install python-networkx). On your development machine, on a freshen Avocado source to be released, run `$ make check_cyclical`. Expected result: Make command should say OK."},
{"name": "Avocado RPM build",
"description": "On your development machine, build the Avocado RPM packages using: `$ make build-rpm-all`. Expected result: SRPM file `SRPMS/avocado-x.y.z-r.distro.src.rpm` and RPM files at `RPMS/noarch`"},
......@@ -45,6 +42,12 @@
{"name": "Avocado Virt Boot Test Run and HTML report",
"description": "Now that your system is setup to run virtualization tests, run the boot test with `$ avocado run avocado-virt-tests/qemu/boot.py --sysinfo on --open-browser`. Expected result: `PASS`, followed by a web browser showing an HTML report"},
{"name": "Avocado Virt - Assignment of values from the cmdline",
"description": "Test that we can assign values from the cmdline. Create a new qemu bin path, for example sudo ln -s `/usr/bin/qemu-kvm /usr/bin/qemu-kvm-avocado-functional`, then run the boot test with `$ avocado run avocado-virt-tests/qemu/boot.py --qemu-bin /usr/bin/qemu-kvm-avocado-functional --sysinfo on --open-browser`. Expected result: `PASS`, followed by the web report. Look at the job log, it should list the path `/usr/bin/qemu-kvm-avocado-functional` in the QEMU command line."},
{"name": "Avocado Virt - Migration test",
"description": "Run the boot test with `$ avocado run avocado-virt-tests/qemu/migration/migration.py --sysinfo on --open-browser`. Expected result: `PASS`, followed by a web browser showing an HTML report"},
{"name": "Avocado HTML report sysinfo",
"description": "On the HTML report, click on `Sysinfo (pre job, click to expand)` and verify that system information such as `hostname` and `cpuinfo` are present and accurate"},
......
......@@ -9,3 +9,6 @@ pep8==1.6.2
requests==1.2.3
PyYAML==3.11
Pillow==2.2.1
snakefood==1.4
networkx==1.9.1
pygraphviz==1.3rc2
......@@ -57,12 +57,16 @@ class App(object):
self.args, _ = self.parser.parse_known_args()
if not (self.args.template or self.args.input):
self.parser.print_usage()
sys.exit(0)
return 0
if self.args.input:
self.report()
else:
self.run_test_plan()
try:
self.run_test_plan()
except KeyboardInterrupt:
print("\nTest Plan interrupted by the user")
return 1
def run_test_plan(self):
self.json = json.load(self.args.template)
......@@ -98,6 +102,7 @@ class App(object):
self.user_identification = user
self.save()
return 0
def get_output_file_name(self, suffix='json'):
"""
......@@ -145,6 +150,7 @@ class App(object):
print("%s: '%s': %s" % (result.get("result"),
result.get("name"),
result.get("notes")))
return 0
if __name__ == '__main__':
app = App()
......
......@@ -3,7 +3,8 @@
from __future__ import print_function
"""Simple script to test cyclical dependencies in modules.
"""
Simple script to test cyclical dependencies in modules.
Requirements:
- SnakeFood (pip install snakefood)
......@@ -24,6 +25,15 @@ except ImportError:
print("Please, install 'python-networkx' with yum or apt.", file=sys.stderr)
sys.exit(2)
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'avocado')):
os.environ['PATH'] += ":" + os.path.join(basedir, 'scripts')
os.environ['PATH'] += ":" + os.path.join(basedir, 'libexec')
sys.path.append(basedir)
from avocado.utils import process
def has_snakefood():
with open(os.devnull, 'w') as null:
......@@ -39,9 +49,10 @@ def has_snakefood():
def generate_dot_file(path):
cmdline = 'sfood --internal %s | sfood-graph --remove-extensions'
output = subprocess.check_output(cmdline % path, shell=True)
output = process.system_output(cmdline % path, shell=True)
tmp = tempfile.mktemp()
fd = open(tmp, 'w').write(output)
with open(tmp, 'w') as sfood_file:
sfood_file.write(output)
return tmp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册