lcu14 211- lava use cases- sw testing & reproducing a lava failures locally using care
DESCRIPTION
LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care --------------------------------------------------- Speaker: Rémi Duraffort Date: September 16, 2014 --------------------------------------------------- ★ Session Summary ★ In this session, Remi, an ST assignee, will review how he is using LAVA within ST to perform PRoot (an ST opensource project) testing and some of the extensions he has created for artifact publishing and reproducing LAVA failures using CARE (an extension to PRoot). --------------------------------------------------- ★ Resources ★ Zerista: http://lcu14.zerista.com/event/member/137737 Google Event: https://plus.google.com/u/0/events/c4u50tkmpj0aako5u400dsl6l94 Video: Etherpad: http://pad.linaro.org/p/lcu14-211 --------------------------------------------------- ★ Event Details ★ Linaro Connect USA - #LCU14 September 15-19th, 2014 Hyatt Regency San Francisco Airport --------------------------------------------------- http://www.linaro.org http://connect.linaro.orgTRANSCRIPT
![Page 1: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/1.jpg)
LCU14 BURLINGAME
Rémi Duraffort, LCU14
LCU14-211: LAVA Use Cases: SW testing & reproducing a LAVA failures locally using CARE
![Page 2: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/2.jpg)
● Rémi Duraffort (aka ivoire)● STMicroelectronics engineer
● Porting v8 js engine on sh4 processors● PRoot co-developer
● Assignee working on LAVA● Open Source dev
● VLC media player (core developer)● dvblast, PRoot, NFS-Ganesha, ...
● … and ..● French :)
Who am I?
![Page 3: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/3.jpg)
Testing PRoot within LAVAhttp://proot.me
Please, pronounced it “P-Root”...
![Page 4: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/4.jpg)
● A syscall instrumentation engine:● alter syscalls arguments● change syscalls return values● replace and chain syscalls
● Based on PTrace● without any privileges● all linux ≥ 2.6.0
● In user space, we have:● mount --bind● chroot● binfmt_misc● ...
PRoot
Linux kernel
Application
PTrace
PRoot
open(‘/etc/hosts’) open(‘/tmp/hosts.local’)
![Page 5: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/5.jpg)
![Page 6: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/6.jpg)
● mount --bind:● proot -b /tmp/hosts.local:/etc/hosts cat /etc/hosts● proot -b ./local/gcc/install/bin:/usr/bin/ gcc
● chroot:● proot -R /tmp/ubuntu-14.04-x86_64 /bin/bash● proot -R /tmp/gentoo-x86 /bin/bash
● binfmt_misc:● proot -q qemu-aarch64 -R /tmp/debian-sid-aarch64 /usr/bin/gcc
●
Use cases (and demo)
execve(“gcc”, …) execve(“qemu-aarch64”, “gcc”, …)
![Page 7: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/7.jpg)
● Kernel compatibility:● Allow to run new rootfs on old kernels● Emulate some kernel features (openat, fstatat, ...)
● proot -k 4.0 uname
● fake id● Fake some syscalls return values
● proot -0 id● proot -0 -R /tmp/ubuntu-14.04-x86 apt-get install vlc
● all together:● proot -0 -q qemu-arm -R /tmp/debian-sid-armhf apt-get install vlc
Use cases: having fun
![Page 8: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/8.jpg)
● Tests requirements● Multi distro● Multi arch
● x86, x86-64, arm, aarch64, sh4● Multi testsuites
● coreutils, Perl, LTP, gdb, … (soon)● on distro kernel (unlike OBS, chroot)● as root and normal user
● Using LAVA:● KVM, qemu-system-aarch64, ST boards (soon)● results:
● http://armv7.com/dashboard/image-charts/PRoot● https://staging.validation.linaro.org/dashboard/image-charts/PRoot
Testing PRoot is challenging
![Page 9: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/9.jpg)
LAVA: PRoot tests
proot-make-check-user.yaml
![Page 10: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/10.jpg)
LAVA: PRoot jobs
![Page 11: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/11.jpg)
Comprehensible Archiver for Reproducible Execution (aka CARE)
http://reproducible.io
![Page 12: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/12.jpg)
● Just a PRoot extension:● Monitor filesystem accesses● Archive all accessed files before usage (/lib/ld-linux.so, /usr/lib/*, /etc/vim/vimrc, …)
● Archive = minimal root filesystem● Use the archive to re-execute the application
● Same filesystem environment● Same env variables● not replaying the syscalls!! (was often asked)
● A Visual Demo Is Worth a Thousand Words...
CARE
![Page 13: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/13.jpg)
● Sometimes jobs are failing (really? a bug?)
● How to reproduce it?
● What do you need● the same hardware (or a good/same simulator)● the same software environment● the same env variables
● CARE can help for the software part● For the hardware, ask Linaro :)
Reproducing LAVA executions
![Page 14: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/14.jpg)
● Inside LAVA● care -o build-failure.bin make -j4
● At home (on a board)● extract
● ./build-failure.bin (or “care -x build-failure.bin”)● Re-execute
● ./build-failure/re-execute.sh● ./build-failure/re-execute.sh make -j1 V=1● ./build-failure/re-execute.sh gcc -Wall -o foo foo.c
● At home (without a board (really, you should ask Linaro!))● PROOT=proot-x86 ./build-failure/re-execute.sh -q qemu-arm make -j1 V=1
Reproducing LAVA executions
![Page 15: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/15.jpg)
Questions?
![Page 16: LCU14 211- LAVA Use Cases- SW Testing & Reproducing a LAVA Failures Locally Using Care](https://reader033.vdocuments.us/reader033/viewer/2022052904/557b2b61d8b42a796a8b563f/html5/thumbnails/16.jpg)
More about Linaro Connect: connect.linaro.org Linaro members: www.linaro.org/membersMore about Linaro: www.linaro.org/about/