# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
#
# This program is free software: you can redistribute it and/or modify
# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
#
# This program is free software: you can redistribute it and/or modify
-import pprint
-
-from jinja2 import Environment, FileSystemLoader, meta
+from urllib.parse import urljoin
+from urllib.request import urlretrieve
+import yaml
+from jinja2 import Environment, FileSystemLoader
USERNAME = 'lava-jenkins'
HOSTNAME = 'lava-master-02.internal.efficios.com'
OBJSTORE_URL = "https://obj.internal.efficios.com/lava/results/"
class TestType():
USERNAME = 'lava-jenkins'
HOSTNAME = 'lava-master-02.internal.efficios.com'
OBJSTORE_URL = "https://obj.internal.efficios.com/lava/results/"
class TestType():
values = {
'baremetal-benchmarks' : baremetal_benchmarks,
'baremetal-tests' : baremetal_tests,
values = {
'baremetal-benchmarks' : baremetal_benchmarks,
'baremetal-tests' : baremetal_tests,
try:
bundle_sha = server.scheduler.job_status(str(job))['bundle_sha1']
bundle = server.dashboard.get(bundle_sha)
try:
bundle_sha = server.scheduler.job_status(str(job))['bundle_sha1']
bundle = server.dashboard.get(bundle_sha)
- except xmlrpc.client.Fault as f:
- print('Error while fetching results bundle', f.faultString)
- raise f
+ except xmlrpc.client.Fault as error:
+ print('Error while fetching results bundle', error.faultString)
+ raise error
print("Testcase result:")
content = server.results.get_testjob_results_yaml(str(job))
testcases = yaml.load(content)
print("Testcase result:")
content = server.results.get_testjob_results_yaml(str(job))
testcases = yaml.load(content)
for testcase in testcases:
if testcase['result'] != 'pass':
print("\tFAILED {}\n\t\t See http://{}{}".format(
for testcase in testcases:
if testcase['result'] != 'pass':
print("\tFAILED {}\n\t\t See http://{}{}".format(
- 'processed_results_ioctl.csv',
- 'processed_results_open_efault.csv',
- 'processed_results_open_enoent.csv',
- 'processed_results_dup_close.csv',
- 'processed_results_raw_syscall_getpid.csv',
- 'processed_results_lttng_test_filter.csv']
+ 'processed_results_ioctl.csv',
+ 'processed_results_open_efault.csv',
+ 'processed_results_open_enoent.csv',
+ 'processed_results_dup_close.csv',
+ 'processed_results_raw_syscall_getpid.csv',
+ 'processed_results_lttng_test_filter.csv']
for testcase in testcases:
url = urljoin(OBJSTORE_URL, "{:s}/{:s}".format(build_id, testcase))
for testcase in testcases:
url = urljoin(OBJSTORE_URL, "{:s}/{:s}".format(build_id, testcase))
job_finished, log = server.scheduler.jobs.logs(str(job))
logs = yaml.load(log.data.decode('ascii'))
print_line = False
job_finished, log = server.scheduler.jobs.logs(str(job))
logs = yaml.load(log.data.decode('ascii'))
print_line = False
-def get_vlttng_cmd(device, lttng_tools_commit, lttng_ust_commit=None):
+def get_vlttng_cmd(lttng_tools_commit, lttng_ust_commit=None):
+ """
+ Return vlttng cmd to be used in the job template for setup.
+ """
vlttng_cmd = 'vlttng --jobs=$(nproc) --profile urcu-master' \
' --override projects.babeltrace.build-env.PYTHON=python3' \
vlttng_cmd = 'vlttng --jobs=$(nproc) --profile urcu-master' \
' --override projects.babeltrace.build-env.PYTHON=python3' \
return -1
jinja_loader = FileSystemLoader(os.path.dirname(os.path.realpath(__file__)))
jinja_env = Environment(loader=jinja_loader, trim_blocks=True,
return -1
jinja_loader = FileSystemLoader(os.path.dirname(os.path.realpath(__file__)))
jinja_env = Environment(loader=jinja_loader, trim_blocks=True,
- jobid = server.scheduler.submit_job(render)
+ for attempt in range(10):
+ try:
+ jobid = server.scheduler.submit_job(render)
+ except xmlrpc.client.ProtocolError as error:
+ print('Protocol error on submit, sleeping and retrying. Attempt #{}'
+ .format(attempt))
+ time.sleep(5)
+ continue
+ else:
+ break
print('Lava jobid:{}'.format(jobid))
print('Lava job URL: http://lava-master-02.internal.efficios.com/scheduler/job/{}'.format(jobid))
print('Lava jobid:{}'.format(jobid))
print('Lava job URL: http://lava-master-02.internal.efficios.com/scheduler/job/{}'.format(jobid))
#Check the status of the job every 30 seconds
jobstatus = server.scheduler.job_state(jobid)['job_state']
running = False
#Check the status of the job every 30 seconds
jobstatus = server.scheduler.job_state(jobid)['job_state']
running = False
- while jobstatus in ['Submitted','Scheduling','Scheduled','Running']:
+ while jobstatus in ['Submitted', 'Scheduling', 'Scheduled', 'Running']:
if not running and jobstatus == 'Running':
print('Job started running')
running = True
time.sleep(30)
try:
jobstatus = server.scheduler.job_state(jobid)['job_state']
if not running and jobstatus == 'Running':
print('Job started running')
running = True
time.sleep(30)
try:
jobstatus = server.scheduler.job_state(jobid)['job_state']
- except xmlrpc.client.ProtocolError as e:
- print('Protocol error, retring')
+ except xmlrpc.client.ProtocolError as error:
+ print('Protocol error, retrying')
+ continue