Skip to content

Commit 90dac35

Browse files
author
Kimmo Lepikkö
authored
Add Ublox c030 (#66)
* Added Ublox C030 to CI
1 parent 42c7214 commit 90dac35

File tree

1 file changed

+29
-48
lines changed

1 file changed

+29
-48
lines changed

Jenkinsfile

Lines changed: 29 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@ def raas = [
2222
//"cellular_smoke_mtb_mts_dragonfly.json": "8119"
2323
]
2424

25-
// List of targets with supported modem families
26-
def target_families = [
27-
"UBLOX": ["UBLOX_C027"],
28-
"DRAGONFLY": ["MTB_MTS_DRAGONFLY"]
29-
]
30-
3125
// Supported Modems
3226
def targets = [
3327
"UBLOX_C027",
34-
"MTB_MTS_DRAGONFLY"
28+
"MTB_MTS_DRAGONFLY",
29+
"UBLOX_C030_U201"
3530
]
3631

3732
// Map toolchains to compilers
@@ -51,22 +46,16 @@ def sockets = [
5146
def stepsForParallel = [:]
5247

5348
// 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++) {
5550
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)
7059
}
7160
}
7261
}
@@ -78,14 +67,14 @@ if (params.smoke_test == true) {
7867
echo "Running smoke tests"
7968
// Generate smoke tests based on suite amount
8069
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)
8978
}
9079
}
9180
} else {
@@ -97,21 +86,20 @@ timestamps {
9786
parallel parallelRunSmoke
9887
}
9988

100-
def buildStep(target_family, target, compilerLabel, toolchain, socket) {
89+
def buildStep(target, compilerLabel, toolchain, socket) {
10190
return {
102-
stage ("${target_family}_${target}_${compilerLabel}") {
91+
stage ("${target}_${compilerLabel}") {
10392
node ("${compilerLabel}") {
10493
deleteDir()
10594
dir("mbed-os-example-cellular") {
10695
checkout scm
10796
def config_file = "mbed_app.json"
10897

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+
}
111101

112102
//change socket typembed_app.json
113-
114-
115103
execute("sed -i 's/\"sock-type\": .*/\"sock-type\": \"${socket}\",/' ${config_file}")
116104

117105
// Set mbed-os to revision received as parameter
@@ -138,7 +126,7 @@ def buildStep(target_family, target, compilerLabel, toolchain, socket) {
138126
}
139127
}
140128

141-
def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, socket) {
129+
def run_smoke(raasPort, suite_to_run, toolchains, targets, socket) {
142130
return {
143131
env.RAAS_USERNAME = "user"
144132
env.RAAS_PASSWORD = "user"
@@ -160,18 +148,11 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets, sock
160148
}
161149
}
162150

163-
for (int i = 0; i < target_families.size(); i++) {
151+
for (int i = 0; i < targets.size(); i++) {
164152
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}"
175156
}
176157
}
177158
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

Comments
 (0)