@@ -22,16 +22,11 @@ def raas = [
22
22
// "cellular_smoke_mtb_mts_dragonfly.json": "8119"
23
23
]
24
24
25
- // List of targets with supported modem families
26
- def target_families = [
27
- " UBLOX" : [" UBLOX_C027" ],
28
- " DRAGONFLY" : [" MTB_MTS_DRAGONFLY" ]
29
- ]
30
-
31
25
// Supported Modems
32
26
def targets = [
33
27
" UBLOX_C027" ,
34
- " MTB_MTS_DRAGONFLY"
28
+ " MTB_MTS_DRAGONFLY" ,
29
+ " UBLOX_C030_U201"
35
30
]
36
31
37
32
// Map toolchains to compilers
@@ -51,22 +46,16 @@ def sockets = [
51
46
def stepsForParallel = [:]
52
47
53
48
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
54
- for (int i = 0 ; i < target_families . size(); i++ ) {
49
+ for (int i = 0 ; i < targets . size(); i++ ) {
55
50
for (int j = 0 ; j < toolchains. size(); j++ ) {
56
- for (int k = 0 ; k < targets. size(); k++ ) {
57
- for (int l = 0 ; l < sockets. size(); l++ ) {
58
- def target_family = target_families. keySet(). asList(). get(i)
59
- def allowed_target_type = target_families. get(target_family)
60
- def target = targets. get(k)
61
- def toolchain = toolchains. keySet(). asList(). get(j)
62
- def compilerLabel = toolchains. get(toolchain)
63
- def stepName = " ${ target} ${ toolchain} "
64
- def socket = sockets. get(l)
65
-
66
- if (allowed_target_type. contains(target)) {
67
- stepsForParallel[stepName] = buildStep(target_family, target, compilerLabel, toolchain, socket)
68
- }
69
- }
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)
70
59
}
71
60
}
72
61
}
@@ -78,14 +67,14 @@ if (params.smoke_test == true) {
78
67
echo " Running smoke tests"
79
68
// Generate smoke tests based on suite amount
80
69
for (int i = 0 ; i < raas. size(); i++ ) {
81
- for (int j = 0 ; j < sockets. size(); j++ ) {
82
- def suite_to_run = raas. keySet(). asList(). get(i)
83
- def raasPort = raas. get(suite_to_run)
84
- def socket = sockets. get(j)
85
-
86
- // Parallel execution needs unique step names. Remove .json file ending.
87
- def smokeStep = " ${ raasPort} ${ suite_to_run.substring(0, suite_to_run.indexOf('.'))} "
88
- parallelRunSmoke[smokeStep] = run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, socket)
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)
89
78
}
90
79
}
91
80
} else {
@@ -97,21 +86,20 @@ timestamps {
97
86
parallel parallelRunSmoke
98
87
}
99
88
100
- def buildStep (target_family , target , compilerLabel , toolchain , socket ) {
89
+ def buildStep (target , compilerLabel , toolchain , socket ) {
101
90
return {
102
- stage (" ${ target_family } _ ${ target} _${ compilerLabel} " ) {
91
+ stage (" ${ target} _${ compilerLabel} " ) {
103
92
node (" ${ compilerLabel} " ) {
104
93
deleteDir()
105
94
dir(" mbed-os-example-cellular" ) {
106
95
checkout scm
107
96
def config_file = " mbed_app.json"
108
97
109
- // Activate traces
110
- // execute("sed -i 's/\"mbed-trace.enable\": false/\"mbed-trace.enable\": true/' ${config_file}")
98
+ if (" ${ target} " == " UBLOX_C030_U201" ) {
99
+ execute(" sed -i 's/internet/JTM2M/' ${ config_file} " )
100
+ }
111
101
112
102
// change socket typembed_app.json
113
-
114
-
115
103
execute(" sed -i 's/\" sock-type\" : .*/\" sock-type\" : \" ${ socket} \" ,/' ${ config_file} " )
116
104
117
105
// Set mbed-os to revision received as parameter
@@ -138,7 +126,7 @@ def buildStep(target_family, target, compilerLabel, toolchain, socket) {
138
126
}
139
127
}
140
128
141
- def run_smoke (target_families , raasPort , suite_to_run , toolchains , targets , socket ) {
129
+ def run_smoke (raasPort , suite_to_run , toolchains , targets , socket ) {
142
130
return {
143
131
env. RAAS_USERNAME = " user"
144
132
env. RAAS_PASSWORD = " user"
@@ -160,18 +148,11 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, sock
160
148
}
161
149
}
162
150
163
- for (int i = 0 ; i < target_families . size(); i++ ) {
151
+ for (int i = 0 ; i < targets . size(); i++ ) {
164
152
for (int j = 0 ; j < toolchains. size(); j++ ) {
165
- for (int k = 0 ; k < targets. size(); k++ ) {
166
- def target_family = target_families. keySet(). asList(). get(i)
167
- def allowed_target_type = target_families. get(target_family)
168
- def target = targets. get(k)
169
- def toolchain = toolchains. keySet(). asList(). get(j)
170
-
171
- if (allowed_target_type. contains(target)) {
172
- unstash " ${ target} _${ toolchain} _${ socket} "
173
- }
174
- }
153
+ def target = targets. get(i)
154
+ def toolchain = toolchains. keySet(). asList(). get(j)
155
+ unstash " ${ target} _${ toolchain} _${ socket} "
175
156
}
176
157
}
177
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} " )
0 commit comments