-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
96 lines (92 loc) · 6.64 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env groovy
pipeline {
parameters {
choice(
name: 'TEST_SET',
choices: 'all\nscenario-real-iperf\nscenario-complex-ncat\nscenario-scaling\nerror-in-configure\nerror-in-instantiate\nerror-in-start\nerror-in-terminate\nwrong-lifecycle-event\nsimple',
description: 'Integration tests to run'
)
string(
name: 'VIM_LOCATION',
defaultValue: '192.168.161.121',
description: 'Which Openstack testbed to use'
)
string(
name: 'BRANCH',
defaultValue: 'latest',
description: 'tag, e.g. latest, 4.0.0, 5.0, ...'
)
}
agent any
options {
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
}
stages {
stage('Run scenario-real-iperf') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'scenario-real-iperf' || params.TEST_SET == 'simple'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} scenario-real-iperf.ini"
}
}
stage('Run scenario-complex-ncat') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'scenario-complex-ncat'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} scenario-complex-ncat.ini"
}
}
stage('Run scenario-scaling') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'scenario-scaling'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} scenario-scaling.ini"
}
}
stage('Run error-in-configure') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'error-in-configure'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} error-in-configure.ini"
}
}
stage('Run error-in-instantiate') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'error-in-instantiate'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} error-in-instantiate.ini"
}
}
stage('Run error-in-start') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'error-in-start'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} error-in-start.ini"
}
}
stage('Run error-in-terminate') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'error-in-terminate'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} error-in-terminate.ini"
}
}
stage('Run wrong-lifecycle-event') {
when { expression { params.TEST_SET == 'all' || params.TEST_SET == 'wrong-lifecycle-event'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} wrong-lifecycle-event.ini"
}
}
stage('Run user-project-test') {
when { expression { params.TEST_SET == 'user-project-test'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} user-project-test.ini"
}
}
stage('Run stress-test') {
when { expression { params.TEST_SET == 'stress-test'} }
steps {
sh "docker run -P --rm --name integration-tests -p 8181:8181 -v $PEM_FILE:/etc/openbaton/integration-test/integration-test.key -v $INTEGRATION_TESTS_CONFIG:/etc/openbaton/integration-tests/integration-tests.properties -v $VIM_FILES/${params.VIM_LOCATION}.json:/etc/openbaton/integration-tests/vim-instances/real-vim.json openbaton/integration-tests:${params.BRANCH} stress-test.ini"
}
}
}
post {
failure {
archive '*.log'
}
}
}