Skip to content

Commit 76157f3

Browse files
author
Kimmo Lepikkö
authored
Merge pull request #77 from ARMmbed/new_targets
Updated smoke test and added new targets
2 parents 90dac35 + a91eca8 commit 76157f3

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

Jenkinsfile

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ if (env.MBED_OS_REVISION == '') {
1818

1919
// Map RaaS instances to corresponding test suites
2020
def raas = [
21-
"cellular_smoke_ublox_c027.json": "8072"
21+
"cellular_smoke_ublox_c027.json": "levi"
2222
//"cellular_smoke_mtb_mts_dragonfly.json": "8119"
2323
]
2424

2525
// Supported Modems
2626
def targets = [
2727
"UBLOX_C027",
2828
"MTB_MTS_DRAGONFLY",
29-
"UBLOX_C030_U201"
29+
"UBLOX_C030_U201",
30+
"MTB_ADV_WISE_1570",
31+
"K64F"
3032
]
3133

3234
// Map toolchains to compilers
@@ -37,26 +39,17 @@ def toolchains = [
3739
ARMC6: "arm6"
3840
]
3941

40-
// supported socket tests
41-
def sockets = [
42-
"udp",
43-
"tcp"
44-
]
45-
4642
def stepsForParallel = [:]
4743

4844
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
4945
for (int i = 0; i < targets.size(); i++) {
5046
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)
6053
}
6154
}
6255

@@ -67,15 +60,12 @@ if (params.smoke_test == true) {
6760
echo "Running smoke tests"
6861
// Generate smoke tests based on suite amount
6962
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)
7969
}
8070
} else {
8171
echo "Skipping smoke tests"
@@ -86,7 +76,7 @@ timestamps {
8676
parallel parallelRunSmoke
8777
}
8878

89-
def buildStep(target, compilerLabel, toolchain, socket) {
79+
def buildStep(target, compilerLabel, toolchain) {
9080
return {
9181
stage ("${target}_${compilerLabel}") {
9282
node ("${compilerLabel}") {
@@ -95,13 +85,26 @@ def buildStep(target, compilerLabel, toolchain, socket) {
9585
checkout scm
9686
def config_file = "mbed_app.json"
9787

88+
// Configurations for different targets
9889
if ("${target}" == "UBLOX_C030_U201") {
9990
execute("sed -i 's/internet/JTM2M/' ${config_file}")
10091
}
10192

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

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+
}
105108
// Set mbed-os to revision received as parameter
106109
execute ("mbed deploy --protocol ssh")
107110
if (env.MBED_OS_REVISION != '') {
@@ -118,21 +121,27 @@ def buildStep(target, compilerLabel, toolchain, socket) {
118121

119122
execute ("mbed compile --build out/${target}_${toolchain}/ -m ${target} -t ${toolchain} -c --app-config ${config_file}")
120123
}
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+
}
123132
step([$class: 'WsCleanup'])
124133
}
125134
}
126135
}
127136
}
128137

129-
def run_smoke(raasPort, suite_to_run, toolchains, targets, socket) {
138+
def run_smoke(raasName, suite_to_run, toolchains, targets) {
130139
return {
131140
env.RAAS_USERNAME = "user"
132141
env.RAAS_PASSWORD = "user"
133142
// Remove .json from suite name
134143
def suiteName = suite_to_run.substring(0, suite_to_run.indexOf('.'))
135-
stage ("smoke_${raasPort}_${suiteName}") {
144+
stage ("smoke_${raasName}_${suiteName}") {
136145
//node is actually the type of machine, i.e., mesh-test boild down to linux
137146
node ("linux") {
138147
deleteDir()
@@ -152,11 +161,13 @@ def run_smoke(raasPort, suite_to_run, toolchains, targets, socket) {
152161
for(int j = 0; j < toolchains.size(); j++) {
153162
def target = targets.get(i)
154163
def toolchain = toolchains.keySet().asList().get(j)
155-
unstash "${target}_${toolchain}_${socket}"
164+
unstash "${target}_${toolchain}"
156165
}
157166
}
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}/**/*"
160171
}
161172
}
162173
}

0 commit comments

Comments
 (0)