-def create_new_job(name, build_device):
- job = OrderedDict({
- 'health_check': False,
- 'job_name': name,
- 'device_type': build_device,
- 'tags': [ ],
- 'timeout': 7200,
- 'actions': []
- })
- if build_device in 'x86':
- job['tags'].append('dev-sda1')
-
- return job
-
-def get_boot_cmd():
- command = OrderedDict({
- 'command': 'boot_image'
- })
- return command
-
-def get_config_cmd(build_device):
- packages=['bsdtar', 'psmisc', 'wget', 'python3', 'python3-pip', \
- 'libglib2.0-dev', 'libffi-dev', 'elfutils', 'libdw-dev', \
- 'libelf-dev', 'libmount-dev', 'libxml2', 'libpfm4-dev', \
- 'libnuma-dev', 'python3-dev', 'swig', 'stress']
- command = OrderedDict({
- 'command': 'lava_command_run',
- 'parameters': {
- 'commands': [
- 'cat /etc/resolv.conf',
- 'echo nameserver 172.18.0.12 > /etc/resolv.conf',
- 'groupadd tracing'
- ],
- 'timeout':300
- }
- })
- if build_device in 'x86':
- command['parameters']['commands'].extend([
- 'mount /dev/sda1 /tmp',
- 'rm -rf /tmp/*'])
-
- command['parameters']['commands'].extend([
- 'depmod -a',
- 'locale-gen en_US.UTF-8',
- 'apt-get update',
- 'apt-get upgrade',
- 'apt-get install -y {}'.format(' '.join(packages))
- ])
- return command
-
-def get_baremetal_benchmarks_cmd():
- command = OrderedDict({
- 'command': 'lava_test_shell',
- 'parameters': {
- 'testdef_repos': [
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/failing-close.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/failing-ioctl.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/failing-open-efault.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/success-dup-close.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/raw-syscall-getpid.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/failing-open-enoent.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/lttng-test-filter.yml'
- }
- ],
- 'timeout': 7200
- }
- })
- return command
-
-def get_baremetal_tests_cmd():
- command = OrderedDict({
- 'command': 'lava_test_shell',
- 'parameters': {
- 'testdef_repos': [
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/perf-tests.yml'
- }
- ],
- 'timeout': 3600
- }
- })
- return command
-
-def get_kvm_tests_cmd():
- command = OrderedDict({
- 'command': 'lava_test_shell',
- 'parameters': {
- 'testdef_repos': [
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/kernel-tests.yml'
- },
- {
- 'git-repo': 'https://github.com/lttng/lttng-ci.git',
- 'revision': 'master',
- 'testdef': 'lava/system-tests/destructive-tests.yml'
- }
- ],
- 'timeout': 7200
- }
- })
- return command
-
-def get_kprobes_generate_data_cmd():
- random_seed = random.randint(0, 1000000)
- 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-generate-data.yml',
- 'parameters': { 'RANDOM_SEED': str(random_seed) }
- }
- ],
- '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
-
-def get_results_cmd(stream_name):
- command = OrderedDict({
- 'command': 'submit_results',
- 'parameters': {
- 'server': 'http://lava-master.internal.efficios.com/RPC2/'
- }
- })
- command['parameters']['stream']='/anonymous/'+stream_name+'/'
- return command
-
-def get_deploy_cmd_kvm(jenkins_job, kernel_path, linux_modules_path, lttng_modules_path):
- command = OrderedDict({
- 'command': 'deploy_kernel',
- 'metadata': {},
- 'parameters': {
- 'customize': {},
- 'kernel': None,
- 'target_type': 'ubuntu',
- 'rootfs': 'file:///var/lib/lava-server/default/media/images/xenial.img.gz',
- 'login_prompt': 'kvm02 login:',
- 'username': 'root'
- }
- })
-
- 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):
- command = OrderedDict({
- 'command': 'deploy_kernel',
- 'metadata': {},
- 'parameters': {
- 'overlays': [],
- 'kernel': None,
- 'nfsrootfs': str(SCP_PATH+'/storage/jenkins-lava/rootfs/rootfs_amd64_trusty_2016-02-23-1134.tar.gz'),
- 'target_type': 'ubuntu'
- }
- })
-
- 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
- if nb_iter is not None:
- command['metadata']['nb_iterations'] = nb_iter
-
- return command
-
-
-def get_env_setup_cmd(build_device, lttng_tools_commit, lttng_ust_commit=None):
- command = OrderedDict({
- 'command': 'lava_command_run',
- 'parameters': {
- 'commands': [
- 'pip3 install --upgrade pip',
- 'hash -r',
- 'pip3 install vlttng',
- ],
- 'timeout': 3600
- }
- })