import base64
import json
import os
+import random
import sys
import time
import xmlrpc.client
# Decode the base64 file and split on newlines to iterate
# on list
- testoutput = str(base64.b64decode(bytes(attachment['content'], encoding='UTF-8'))).split('\n')
+ testoutput = str(base64.b64decode(bytes(attachment['content'], encoding='UTF-8')))
+
+ testoutput = testoutput.replace('\\n', '\n')
# Create a generator to iterate on the lines and keeping
# the state of the iterator across the two loops.
- testoutput_iter = iter(testoutput)
+ testoutput_iter = iter(testoutput.split('\n'))
for line in testoutput_iter:
# Find the header of the test case and start printing
# from there
if 'LAVA_SIGNAL_STARTTC run-tests' in line:
- found = True
print('---- TEST SUITE OUTPUT BEGIN ----')
for line in testoutput_iter:
if 'LAVA_SIGNAL_ENDTC run-tests' not in line:
# section
break
- if found is True:
print('----- TEST SUITE OUTPUT END -----')
break
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/failing-close.yml'
+ 'testdef': 'lava/system-tests/failing-close.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/failing-ioctl.yml'
+ 'testdef': 'lava/system-tests/failing-ioctl.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/failing-open-efault.yml'
+ 'testdef': 'lava/system-tests/failing-open-efault.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/success-dup-close.yml'
+ 'testdef': 'lava/system-tests/success-dup-close.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/raw-syscall-getpid.yml'
+ 'testdef': 'lava/system-tests/raw-syscall-getpid.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/failing-open-enoent.yml'
+ 'testdef': 'lava/system-tests/failing-open-enoent.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/lttng-test-filter.yml'
+ 'testdef': 'lava/system-tests/lttng-test-filter.yml'
}
],
'timeout': 7200
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/perf-tests.yml'
+ 'testdef': 'lava/system-tests/perf-tests.yml'
}
],
'timeout': 3600
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/kernel-tests.yml'
+ 'testdef': 'lava/system-tests/kernel-tests.yml'
},
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/destructive-tests.yml'
+ 'testdef': 'lava/system-tests/destructive-tests.yml'
}
],
'timeout': 7200
}
})
return command
-def get_kprobes_test_cmd():
+
+def get_kprobes_generate_data_cmd():
+ random_seed = random.randint(0, 1000000)
command = OrderedDict({
'command': 'lava_test_shell',
'parameters': {
{
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
- 'testdef': 'lava/baremetal-tests/kprobe-fuzzing-tests.yml'
+ 'testdef': 'lava/system-tests/kprobe-fuzzing-generate-data.yml',
+ 'parameters': { 'RANDOM_SEED': str(random_seed) }
}
],
- 'timeout': 7200
+ 'timeout': 60
+ }
+ })
+ return command
+
+def get_kprobes_test_cmd(round_nb):
+ command = OrderedDict({
+ 'command': 'lava_test_shell',
+ 'parameters': {
+ 'testdef_repos': [
+ {
+ 'git-repo': 'https://github.com/lttng/lttng-ci.git',
+ 'revision': 'master',
+ 'testdef': 'lava/system-tests/kprobe-fuzzing-tests.yml',
+ 'parameters': { 'ROUND_NB': str(round_nb) }
+ }
+ ],
+ 'timeout': 1000
}
})
return command
command['parameters']['stream']='/anonymous/'+stream_name+'/'
return command
-def get_deploy_cmd_kvm(jenkins_job, kernel_path, linux_modules_path, lttng_modules_path):
+def get_deploy_cmd_kvm(jenkins_job, kernel_path, lttng_modules_path):
command = OrderedDict({
'command': 'deploy_kernel',
'metadata': {},
}
})
- command['parameters']['customize'][SCP_PATH+linux_modules_path]=['rootfs:/','archive']
command['parameters']['customize'][SCP_PATH+lttng_modules_path]=['rootfs:/','archive']
command['parameters']['kernel'] = str(SCP_PATH+kernel_path)
command['metadata']['jenkins_jobname'] = jenkins_job
return command
-def get_deploy_cmd_x86(jenkins_job, kernel_path, linux_modules_path, lttng_modules_path, nb_iter=None):
+def get_deploy_cmd_x86(jenkins_job, kernel_path, lttng_modules_path, nb_iter=None):
command = OrderedDict({
'command': 'deploy_kernel',
'metadata': {},
}
})
- command['parameters']['overlays'].append( str(SCP_PATH+linux_modules_path))
command['parameters']['overlays'].append( str(SCP_PATH+lttng_modules_path))
command['parameters']['kernel'] = str(SCP_PATH+kernel_path)
command['metadata']['jenkins_jobname'] = jenkins_job
parser.add_argument('-t', '--type', required=True)
parser.add_argument('-j', '--jobname', required=True)
parser.add_argument('-k', '--kernel', required=True)
- parser.add_argument('-km', '--kmodule', required=True)
parser.add_argument('-lm', '--lmodule', required=True)
parser.add_argument('-tc', '--tools-commit', required=True)
parser.add_argument('-uc', '--ust-commit', required=False)
if test_type is TestType.baremetal_benchmarks:
j = create_new_job(args.jobname, build_device='x86')
- j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule))
+ j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.lmodule))
elif test_type is TestType.baremetal_tests:
j = create_new_job(args.jobname, build_device='x86')
- j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule))
+ j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.lmodule))
elif test_type is TestType.kvm_tests or test_type is TestType.kvm_fuzzing_tests:
j = create_new_job(args.jobname, build_device='kvm')
- j['actions'].append(get_deploy_cmd_kvm(args.jobname, args.kernel, args.kmodule, args.lmodule))
+ j['actions'].append(get_deploy_cmd_kvm(args.jobname, args.kernel, args.lmodule))
j['actions'].append(get_boot_cmd())
print('Tests runs need -uc/--ust-commit options. Exiting...')
return -1
j['actions'].append(get_config_cmd('kvm'))
- j['actions'].append(get_env_setup_cmd('kvm', args.tools_commit, args.ust_commit))
- j['actions'].append(get_kprobes_test_cmd())
+ j['actions'].append(get_kprobes_generate_data_cmd())
+ for i in range(10):
+ j['actions'].append(get_kprobes_test_cmd(round_nb=i))
j['actions'].append(get_results_cmd(stream_name='tests-kernel'))
else:
assert False, 'Unknown test type'