@@ -38,21 +38,30 @@ def toolchains = [
38
38
IAR : " iar_arm"
39
39
]
40
40
41
+ // supported socket tests
42
+ def sockets = [
43
+ " udp" ,
44
+ " tcp"
45
+ ]
46
+
41
47
def stepsForParallel = [:]
42
48
43
49
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
44
50
for (int i = 0 ; i < target_families. size(); i++ ) {
45
51
for (int j = 0 ; j < toolchains. size(); j++ ) {
46
52
for (int k = 0 ; k < targets. size(); k++ ) {
47
- def target_family = target_families. keySet(). asList(). get(i)
48
- def allowed_target_type = target_families. get(target_family)
49
- def target = targets. get(k)
50
- def toolchain = toolchains. keySet(). asList(). get(j)
51
- def compilerLabel = toolchains. get(toolchain)
52
-
53
- def stepName = " ${ target} ${ toolchain} "
54
- if (allowed_target_type. contains(target)) {
55
- stepsForParallel[stepName] = buildStep(target_family, target, compilerLabel, toolchain)
53
+ for (int l = 0 ; l < sockets. size(); l++ ) {
54
+ def target_family = target_families. keySet(). asList(). get(i)
55
+ def allowed_target_type = target_families. get(target_family)
56
+ def target = targets. get(k)
57
+ def toolchain = toolchains. keySet(). asList(). get(j)
58
+ def compilerLabel = toolchains. get(toolchain)
59
+ def stepName = " ${ target} ${ toolchain} "
60
+ def socket = sockets. get(l)
61
+
62
+ if (allowed_target_type. contains(target)) {
63
+ stepsForParallel[stepName] = buildStep(target_family, target, compilerLabel, toolchain, socket)
64
+ }
56
65
}
57
66
}
58
67
}
@@ -65,11 +74,15 @@ def parallelRunSmoke = [:]
65
74
if ( params. smoke_test == true ) {
66
75
// Generate smoke tests based on suite amount
67
76
for (int i = 0 ; i < raas. size(); i++ ) {
68
- def suite_to_run = raas. keySet(). asList(). get(i)
69
- def raasPort = raas. get(suite_to_run)
70
- // Parallel execution needs unique step names. Remove .json file ending.
71
- def smokeStep = " ${ raasPort} ${ suite_to_run.substring(0, suite_to_run.indexOf('.'))} "
72
- parallelRunSmoke[smokeStep] = run_smoke(target_families, raasPort, suite_to_run, toolchains, targets)
77
+ for (int j = 0 ; j < sockets. size(); j++ ) {
78
+ def suite_to_run = raas. keySet(). asList(). get(i)
79
+ def raasPort = raas. get(suite_to_run)
80
+ def socket = sockets. get(j)
81
+
82
+ // Parallel execution needs unique step names. Remove .json file ending.
83
+ def smokeStep = " ${ raasPort} ${ suite_to_run.substring(0, suite_to_run.indexOf('.'))} "
84
+ parallelRunSmoke[smokeStep] = run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, socket)
85
+ }
73
86
}
74
87
}
75
88
@@ -78,7 +91,7 @@ timestamps {
78
91
parallel parallelRunSmoke
79
92
}
80
93
81
- def buildStep (target_family , target , compilerLabel , toolchain ) {
94
+ def buildStep (target_family , target , compilerLabel , toolchain , socket ) {
82
95
return {
83
96
stage (" ${ target_family} _${ target} _${ compilerLabel} " ) {
84
97
node (" ${ compilerLabel} " ) {
@@ -88,7 +101,12 @@ def buildStep(target_family, target, compilerLabel, toolchain) {
88
101
def config_file = " mbed_app.json"
89
102
90
103
// Activate traces
91
- execute(" sed -i 's/\" mbed-trace.enable\" : false/\" mbed-trace.enable\" : true/' ${ config_file} " )
104
+ // execute("sed -i 's/\"mbed-trace.enable\": false/\"mbed-trace.enable\": true/' ${config_file}")
105
+
106
+ // change socket typembed_app.json
107
+
108
+
109
+ execute(" sed -i 's/\" sock-type\" : .*/\" sock-type\" : \" ${ socket} \" ,/' ${ config_file} " )
92
110
93
111
// Set mbed-os to revision received as parameter
94
112
execute (" mbed deploy --protocol ssh" )
@@ -98,15 +116,15 @@ def buildStep(target_family, target, compilerLabel, toolchain) {
98
116
99
117
execute (" mbed compile --build out/${ target} _${ toolchain} / -m ${ target} -t ${ toolchain} -c --app-config ${ config_file} " )
100
118
}
101
- stash name : " ${ target} _${ toolchain} " , includes : ' **/mbed-os-example-cellular.bin'
119
+ stash name : " ${ target} _${ toolchain} _ ${ socket } " , includes : ' **/mbed-os-example-cellular.bin'
102
120
archive ' **/mbed-os-example-cellular.bin'
103
121
step([$class : ' WsCleanup' ])
104
122
}
105
123
}
106
124
}
107
125
}
108
126
109
- def run_smoke (target_families , raasPort , suite_to_run , toolchains , targets ) {
127
+ def run_smoke (target_families , raasPort , suite_to_run , toolchains , targets , socket ) {
110
128
return {
111
129
env. RAAS_USERNAME = " user"
112
130
env. RAAS_PASSWORD = " user"
@@ -131,15 +149,15 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets) {
131
149
for (int i = 0 ; i < target_families. size(); i++ ) {
132
150
for (int j = 0 ; j < toolchains. size(); j++ ) {
133
151
for (int k = 0 ; k < targets. size(); k++ ) {
134
- def target_family = target_families. keySet(). asList(). get(i)
135
- def allowed_target_type = target_families. get(target_family)
136
- def target = targets. get(k)
137
- def toolchain = toolchains. keySet(). asList(). get(j)
138
-
139
- if (allowed_target_type. contains(target)) {
140
- unstash " ${ target} _${ toolchain} "
141
- }
142
- }
152
+ def target_family = target_families. keySet(). asList(). get(i)
153
+ def allowed_target_type = target_families. get(target_family)
154
+ def target = targets. get(k)
155
+ def toolchain = toolchains. keySet(). asList(). get(j)
156
+
157
+ if (allowed_target_type. contains(target)) {
158
+ unstash " ${ target} _${ toolchain} _ ${ socket } "
159
+ }
160
+ }
143
161
}
144
162
}
145
163
if (" ${ suiteName} " == " cellular_smoke_mts_dragonfly" ) {
0 commit comments