@@ -18,15 +18,17 @@ if (env.MBED_OS_REVISION == '') {
18
18
19
19
// Map RaaS instances to corresponding test suites
20
20
def raas = [
21
- " cellular_smoke_ublox_c027.json" : " 8072 "
21
+ " cellular_smoke_ublox_c027.json" : " levi "
22
22
// "cellular_smoke_mtb_mts_dragonfly.json": "8119"
23
23
]
24
24
25
25
// Supported Modems
26
26
def targets = [
27
27
" UBLOX_C027" ,
28
28
" MTB_MTS_DRAGONFLY" ,
29
- " UBLOX_C030_U201"
29
+ " UBLOX_C030_U201" ,
30
+ " MTB_ADV_WISE_1570" ,
31
+ " K64F"
30
32
]
31
33
32
34
// Map toolchains to compilers
@@ -37,26 +39,17 @@ def toolchains = [
37
39
ARMC6 : " arm6"
38
40
]
39
41
40
- // supported socket tests
41
- def sockets = [
42
- " udp" ,
43
- " tcp"
44
- ]
45
-
46
42
def stepsForParallel = [:]
47
43
48
44
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
49
45
for (int i = 0 ; i < targets. size(); i++ ) {
50
46
for (int j = 0 ; j < toolchains. size(); j++ ) {
51
- for (int k = 0 ; k < sockets. size(); k++ ) {
52
- def target = targets. get(i)
53
- def toolchain = toolchains. keySet(). asList(). get(j)
54
- def compilerLabel = toolchains. get(toolchain)
55
- def stepName = " ${ target} ${ toolchain} "
56
- def socket = sockets. get(k)
57
-
58
- stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, socket)
59
- }
47
+ def target = targets. get(i)
48
+ def toolchain = toolchains. keySet(). asList(). get(j)
49
+ def compilerLabel = toolchains. get(toolchain)
50
+ def stepName = " ${ target} ${ toolchain} "
51
+
52
+ stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain)
60
53
}
61
54
}
62
55
@@ -67,15 +60,12 @@ if (params.smoke_test == true) {
67
60
echo " Running smoke tests"
68
61
// Generate smoke tests based on suite amount
69
62
for (int i = 0 ; i < raas. size(); i++ ) {
70
- for (int j = 0 ; j < sockets. size(); j++ ) {
71
- def suite_to_run = raas. keySet(). asList(). get(i)
72
- def raasPort = raas. get(suite_to_run)
73
- def socket = sockets. get(j)
74
-
75
- // Parallel execution needs unique step names. Remove .json file ending.
76
- def smokeStep = " ${ raasPort} ${ suite_to_run.substring(0, suite_to_run.indexOf('.'))} "
77
- parallelRunSmoke[smokeStep] = run_smoke(raasPort, suite_to_run, toolchains, targets, socket)
78
- }
63
+ def suite_to_run = raas. keySet(). asList(). get(i)
64
+ def raasName = raas. get(suite_to_run)
65
+
66
+ // Parallel execution needs unique step names. Remove .json file ending.
67
+ def smokeStep = " ${ raasName} ${ suite_to_run.substring(0, suite_to_run.indexOf('.'))} "
68
+ parallelRunSmoke[smokeStep] = run_smoke(raasName, suite_to_run, toolchains, targets)
79
69
}
80
70
} else {
81
71
echo " Skipping smoke tests"
@@ -86,7 +76,7 @@ timestamps {
86
76
parallel parallelRunSmoke
87
77
}
88
78
89
- def buildStep (target , compilerLabel , toolchain , socket ) {
79
+ def buildStep (target , compilerLabel , toolchain ) {
90
80
return {
91
81
stage (" ${ target} _${ compilerLabel} " ) {
92
82
node (" ${ compilerLabel} " ) {
@@ -95,13 +85,26 @@ def buildStep(target, compilerLabel, toolchain, socket) {
95
85
checkout scm
96
86
def config_file = " mbed_app.json"
97
87
88
+ // Configurations for different targets
98
89
if (" ${ target} " == " UBLOX_C030_U201" ) {
99
90
execute(" sed -i 's/internet/JTM2M/' ${ config_file} " )
100
91
}
101
92
102
- // change socket typembed_app.json
103
- execute(" sed -i 's/\" sock-type\" : .*/\" sock-type\" : \" ${ socket} \" ,/' ${ config_file} " )
93
+ if (" ${ target} " == " UBLOX_C027" ) {
94
+ execute(" sed -i 's/TCP/UDP/' ${ config_file} " )
95
+ }
96
+
97
+ if (" ${ target} " == " MTB_ADV_WISE_1570" ) {
98
+ execute(" sed -i 's/TCP/UDP/' ${ config_file} " )
99
+ execute(" sed -i 's/\" lwip.ppp-enabled\" : true,/\" lwip.ppp-enabled\" : false,/' ${ config_file} " )
100
+ execute(" sed -i 's/\" platform.default-serial-baud-rate\" : 115200,/\" platform.default-serial-baud-rate\" : 9600,/' ${ config_file} " )
101
+ }
104
102
103
+ if (" ${ target} " == " K64F" ) {
104
+ execute(" sed -i 's/TCP/UDP/' ${ config_file} " )
105
+ execute(" sed -i 's/\" lwip.ppp-enabled\" : true,/\" lwip.ppp-enabled\" : false,/' ${ config_file} " )
106
+ execute(" sed -i 's/\" target_overrides\" : {/\" macros\" : [\" CELLULAR_DEVICE=QUECTEL_BG96\" , \" MDMRXD=PTC16\" , \" MDMTXD=PTC17\" ], \" target_overrides\" : {/' ${ config_file} " )
107
+ }
105
108
// Set mbed-os to revision received as parameter
106
109
execute (" mbed deploy --protocol ssh" )
107
110
if (env. MBED_OS_REVISION != ' ' ) {
@@ -118,21 +121,27 @@ def buildStep(target, compilerLabel, toolchain, socket) {
118
121
119
122
execute (" mbed compile --build out/${ target} _${ toolchain} / -m ${ target} -t ${ toolchain} -c --app-config ${ config_file} " )
120
123
}
121
- stash name : " ${ target} _${ toolchain} _${ socket} " , includes : ' **/mbed-os-example-cellular.bin'
122
- archive ' **/mbed-os-example-cellular.bin'
124
+ if (" ${ target} " == " MTB_ADV_WISE_1570" ) {
125
+ stash name : " ${ target} _${ toolchain} " , includes : ' **/mbed-os-example-cellular.hex'
126
+ archive ' **/mbed-os-example-cellular.hex'
127
+ }
128
+ else {
129
+ stash name : " ${ target} _${ toolchain} " , includes : ' **/mbed-os-example-cellular.bin'
130
+ archive ' **/mbed-os-example-cellular.bin'
131
+ }
123
132
step([$class : ' WsCleanup' ])
124
133
}
125
134
}
126
135
}
127
136
}
128
137
129
- def run_smoke (raasPort , suite_to_run , toolchains , targets , socket ) {
138
+ def run_smoke (raasName , suite_to_run , toolchains , targets ) {
130
139
return {
131
140
env. RAAS_USERNAME = " user"
132
141
env. RAAS_PASSWORD = " user"
133
142
// Remove .json from suite name
134
143
def suiteName = suite_to_run. substring(0 , suite_to_run. indexOf(' .' ))
135
- stage (" smoke_${ raasPort } _${ suiteName} " ) {
144
+ stage (" smoke_${ raasName } _${ suiteName} " ) {
136
145
// node is actually the type of machine, i.e., mesh-test boild down to linux
137
146
node (" linux" ) {
138
147
deleteDir()
@@ -152,11 +161,13 @@ def run_smoke(raasPort, suite_to_run, toolchains, targets, socket) {
152
161
for (int j = 0 ; j < toolchains. size(); j++ ) {
153
162
def target = targets. get(i)
154
163
def toolchain = toolchains. keySet(). asList(). get(j)
155
- unstash " ${ target} _${ toolchain} _ ${ socket } "
164
+ unstash " ${ target} _${ toolchain} "
156
165
}
157
166
}
158
- execute(" python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${ suite_to_run} --type hardware --reset --raas 62.44.193.186:${ raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${ raasPort} _${ suiteName} " )
159
- archive " log_${ raasPort} _${ suiteName} /**/*"
167
+ execute(" python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${ suite_to_run} --type hardware --reset \
168
+ --raas ${ raasName} .mbedcloudtesting.com:80 --tcdir mbed-clitest-suites/cellular --raas_queue --raas_queue_timeout 3600 \
169
+ --raas_share_allocs --failure_return_value -vvv -w --log log_${ raasName} _${ suiteName} " )
170
+ archive " log_${ raasName} _${ suiteName} /**/*"
160
171
}
161
172
}
162
173
}
0 commit comments