aboutsummaryrefslogtreecommitdiff
path: root/schneider-openembedded/lava-job-definitions/rzn1d/prod-image.yaml
blob: 3f6ee2d2ce0f3442caa7249b850639bb1681c854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
device_type: rzn1d
job_name: SE ${MACHINE} prod-image (u-boot,ubi) ${MANIFEST_BRANCH}-${KERNEL_VERSION_PATCHLEVEL} ${BUILD_NUMBER}

timeouts:
  job:
    minutes: 100
  action:
    minutes: 70
  connection:
    minutes: 20
priority: medium
visibility: public

actions:

####################
# Deploy QSPI images
####################
- deploy:
    namespace: dfu-firmware
    to: tmpfs
    images:
      sf_fsbl:
        image_arg: --alt sf_fsbl --download {sf_fsbl}
        url: ${FSBL_URL}
      sf_trustedfw0:
        image_arg: --alt sf_trustedfw0 --download {sf_trustedfw0}
        url: ${OPTEE_ITB_URL}
      sf_trustedfw1:
        image_arg: --alt sf_trustedfw1 --download {sf_trustedfw1}
        url: ${OPTEE_ITB_URL}
      sf_uboot0:
        image_arg: --alt sf_uboot0 --download {sf_uboot0}
        url: ${UBOOT_ITB_URL}
      sf_uboot1:
        image_arg: --alt sf_uboot1 --download {sf_uboot1}
        url: ${UBOOT_ITB_URL}

- command:
    namespace: dfu-firmware
    name: set_boot_to_nand

- boot:
    namespace: dfu-firmware
    method: dfu
    timeout:
      minutes: 10

- command:
    namespace: test
    name: set_boot_to_qspi

##########################
# Configure ethernet ports
##########################
- command:
    namespace: test
    name: j17_off
- command:
    namespace: test
    name: j21_on
- command:
    namespace: test
    name: j22_off
- command:
    namespace: test
    name: j23_off
- command:
    namespace: test
    name: j24_off

###############
# u-boot
###############
- deploy:
    namespace: test-uboot
    timeout:
      minutes: 15
    to: tftp
    kernel:
      # This is a known kernel image used for CRC checks only
      url: https://releases.linaro.org/members/schneider/openembedded/2019.09-warrior/soca9/zImage--4.19.72+git0+7549a49ae5-r0-snarc-soca9-20191003145415.bin
      type: zimage

- boot:
    namespace: test-uboot
    connection-namespace: dfu-firmware
    timeout:
      minutes: 20
    method: bootloader
    bootloader: u-boot
    commands: []
    prompts: ["=>"]

# Run some U-Boot tests
- test:
    namespace: test-uboot
    timeout:
      minutes: 5
    interactive:
    - name: uboot-tests
      prompts: ["=> ", "/ # "]
      script:
      - command: echo "u-boot echo test"
        name: echo
        successes:
        - message: "u-boot echo test"
      - command: version
        name: version
        successes:
        - message: "U-Boot"
      - command: help test
        name: help
        successes:
        - message: "test - minimal test like /bin/sh"
      # saveenv and printenv
      - command: setenv test_var test123
      - command: printenv
        name: setenv-and-printenv
        successes:
        - message: "test_var=test123"
    - name: memory-test
      prompts: ["=> ", "/ # "]
      script:
      # memory test
      # base - print or set address offset
      - command: base
        name: print-default-base-address-offset
        successes:
        - message: "Base Address: 0x"
      - command: base 80000000
        name: set-address-offset-0x80000000
        successes:
        - message: "Base Address: 0x80000000"
      - command: base
        name: check-address-offset-0x80000000
        successes:
        - message: "Base Address: 0x80000000"
      # crc32 - checksum calculation
      - command: mw.b 00000000 aa 400
      - command: crc32 -v 80000000 400 3c6f327d
      - command: echo return code $$?
        name: compute-CRC32-checksum
        successes:
        - message: "return code 0"
      # mw - memory write
      # md - memory display
      - command: mw 100000 aabbccdd 10
      - command: md 100000 10
        name: mw-md-100000
        successes:
        - message: "aabbccdd"
      # md - memory display
      # cp - memory copy
      - command: cp 100000 200000 10
      - command: md 200000 10
        name: cp-md-200000
        successes:
        - message: "aabbccdd"
      # cmp - memory compare
      - command: cmp 100000 200000 10
        name: cmp-100000-200000-10
        successes:
        - message: "Total of 16 word\\(s\\) were the same"
    - name: dhcp-cmds
      prompts: ["=> ", "/ # "]
      script:
      # dhcp
      - command: setenv autoload no ; dhcp ; dhcp
        name: dhcp
        successes:
        - message: "DHCP client bound to address"
    - name: ping-cmds
      prompts: ["=> ", "/ # "]
      script:
      # ping
      - command: ping {SERVER_IP}
        name: ping
        successes:
        - message: "is alive"
    - name: tftp-cmds
      prompts: ["=> ", "/ # "]
      script:
      # TFTP
      - command: setenv serverip {SERVER_IP} ; tftp {KERNEL_ADDR} {KERNEL}
        name: tftp
        successes:
        - message: "Bytes transferred = 6752784"
      - command: crc32 -v {KERNEL_ADDR} 670a10 ca050911
      - command: echo return code $$?
        successes:
        - message: "return code 0"
    - name: nand-commands
      prompts: ["=> ", "/ # "]
      script:
      # nand
      - command: nand info
        name: nand-info
        successes:
        - message: nand0, sector size 128 KiB

###############
# prod-image.ubi
###############
- deploy:
    namespace: test-ubi
    to: tmpfs
    images:
      n_fs1:
        image_arg: --alt n_fs1 --download {n_fs1}
        url: ${UBI_IMAGE_URL}

- command:
    namespace: test-ubi
    name: set_boot_to_nand
- boot:
    namespace: test-ubi
    method: dfu
    timeout:
      minutes: 10
- command:
    namespace: test-ubi
    name: set_boot_to_qspi

- boot:
    namespace: test-ubi
    connection-namespace: test-ubi
    timeout:
      minutes: 20
    method: u-boot
    commands:
      - run linux_bestla
    auto_login:
      login_prompt: "login:"
      username: root
      password_prompt: "Password:"
      password: "P@ssword-1"
      login_commands:
      - "P@ssword-1"
      - "azertAZERT12345"
      - "azertAZERT12345"
      - "azertAZERT12345"
    prompts:
    - "Current password: "
    - "New password: "
    - "Retype new password: "
    - "root@rzn1d400-bestla:"

- test:
    namespace: test-ubi
    connection-namespace: test-ubi
    timeout:
      minutes: 60
    interactive:
    - name: basic-cmds-ubi
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla"]
      script:
      - command: uname -a
      - command: cat /proc/device-tree/model ; echo ""
      - command: ps aux --sort -rss
      - command: cat /proc/meminfo
      - command: cat /proc/cpuinfo
      - command: free -h
      - command: sysctl -a | grep vm.min_free_kbytes
      - command: mount
      - command: systemctl --no-pager status systemd-resolved
      - command: systemctl --no-pager restart systemd-resolved
      - command: systemctl --no-pager status systemd-resolved
      - command: ifconfig -a
      - command: ping -c 3 github.com
      - command: which docker
      - command: systemctl --no-pager status docker
      - command: sleep 100
      - command: systemctl --no-pager status docker
      - command: ifconfig -a
      - command: docker run hello-world
      - command: docker run -it ubuntu uname -a


##################
# Reboot/Poweroff Tests
##################
- test:
    namespace: test-reboot
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: reboot-cmds-1
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla", "=> "]
      script:
      - command: reboot ; sleep 10

# Trigger 2nd boot
- boot:
    namespace: test-reboot
    connection-namespace: test-ubi
    timeout:
      minutes: 10
    method: u-boot
    commands:
    - run linux_bestla
    auto_login:
      login_prompt: "login:"
      username: root
      password_prompt: "Password:"
      password: azertAZERT12345
    prompts:
    - "root@snarc-soca9:"
    - "root@rzn1d400-bestla:"

- test:
    namespace: test-reboot
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: check-1st-reboot
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla"]
      script:
      - command: echo "We came back from a reboot"


# Reboot the board a 2nd time
- test:
    namespace: test-reboot-2
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: reboot-cmds-2
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla", "=> "]
      script:
      - command: reboot ; sleep 10

# Trigger a new boot
- boot:
    namespace: test-reboot-2
    connection-namespace: test-ubi
    timeout:
      minutes: 10
    method: u-boot
    commands:
    - run linux_bestla
    auto_login:
      login_prompt: "login:"
      username: root
      password_prompt: "Password:"
      password: "azertAZERT12345"
    prompts:
    - "root@snarc-soca9:"
    - "root@rzn1d400-bestla:"

- test:
    namespace: test-reboot-2
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: check-2nd-reboot
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla", "=> "]
      script:
      - command: echo "We came back from the 2nd reboot"

# Test poweroff
- test:
    namespace: test-poweroff
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: poweroff-cmds
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla", "=> "]
      script:
      - command: poweroff ; sleep 10

# Check we are in u-boot after poweroff
- test:
    namespace: test-poweroff
    connection-namespace: test-ubi
    timeout:
      minutes: 5
    interactive:
    - name: check-poweroff
      prompts: ["=> "]
      script:
      - command: version
        successes:
        - message: "U-Boot"

metadata:
  machine: ${MACHINE}
  manifest branch: ${MANIFEST_BRANCH}-${KERNEL_VERSION_PATCHLEVEL}
  manifest commit: ${MANIFEST_COMMIT}
  build url: ${BUILD_URL}
  build location: ${PUBLISH_SERVER}${PUB_DEST}

notify:
    recipients:
    - to:
        method: email
        email: ryan.harkin@linaro.org
    criteria:
        status: incomplete
    verbosity: verbose