SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Testing Firmware the DevOps way
System Firmware
The firmware that starts your computer
BIOS
UEFI
LinuxBoot
LinuxBoot on OCP hardware
ITRENEW is selling Open Compute Project hardware under the SESAME brand.
Most of our hardware comes from hyper-scale datacenter decommissioning.
The recertification process includes updating the firmwares.
One option for firmware is LinuxBoot.
ITRENEW historical activity is decommissioning
LinuxBoot ?
What
Linuxboot is placing a Linux kernel in the BIOS flash and using userland to implement a bootloader.
Presented last year at ER2018 by Trammel Hudson.
We use u-root and it's bootloader implementations
Why
Maintainability
Security
microcode update
Reduice/Remove UEFI footprint
Linux is already part of our security audit...
Extra features (nvme, infra integration)
Replacing the UEFI (proprietary) firmware, with an open source one gives us those advantages.
Developing LinuxBoot need Testing !
Testing requirements
Automated testing with CI, like devops!
Keeping the full logs from the console for debugging
Up to 3 logs to watch:
test output
serial console
IPMI console
Keep all details on first run (long tests)
Simple/summary view by default
IPMI provides a Serial Over LAN access to the console.
Testing Hardware setup
This setup was presented last year at ER2018 by Jean-Marie Verdun.
The hardware for testing is composed of
servers used as DUT,
controlling servers used as CI runners.
Each DUT has:
a relay for controlling power,
a flash emulator to load firmware.
So today we will focus on the testing software.
Let's look at it!
DEMO time!
If you are reading the slides: Features are presented live here, explanations comes later...
Why use Golang to write tests ?
u-root is written in Go
Go has it's test framework: go test and the testing package.
BUT
Go test output does not directly fulfil our requirements
go test
Files named *_test.go are compiled only for testing.
Functions named Test*(t) are test case automatically run by the framework.
Inside test functions subtest can be created by calling t.Run.
Short example:
func TestMyFeature(t *testing.T) {
got := MyFeature(/* ... */)
want := "OK" /* expected result */
if got != want {
t.Fatalf("test failed, got %v, want %v", got, want)
}
}
go test output
Success has very minimal output:
ok MyPackage 0.001s
Error is more verbose:
--- FAIL: TestMyFeature (0.00s)
prez_test.go:13: test failed, got KO, want OK
FAIL
FAIL MyPackage 0.001s
Verbose mode: messages on success, error gets flooded :(
=== RUN TestMyFeature
--- PASS: TestMyFeature (0.00s)
PASS
ok command-line-arguments 0.001s
go test -json
There is a JSON output for further processing
an event log with one JSON event per line
{"Action":"run","Test":"TestMyFeature","Time":"2019-08-12T11:55:41.174693884+02:00"}
{"Action":"output","Test":"TestMyFeature","Output":"=== RUN TestMyFeaturen","Time":"2
{"Action":"output","Test":"TestMyFeature","Output":"--- FAIL: TestMyFeature (0.00s)n","
{"Action":"output","Test":"TestMyFeature","Output":" prez_test.go:13: test failed, go
{"Action":"fail","Test":"TestMyFeature","Elapsed":0,"Time":"2019-08-12T11:55:41.17486883
{"Action":"output","Output":"FAILn","Time":"2019-08-12T11:55:41.174877223+02:00"}
{"Action":"output","Output":"FAILtMyPackaget0.001sn","Time":"2019-08-12T11:55:41.1750
{"Action":"fail","Elapsed":0.001,"Time":"2019-08-12T11:55:41.175039291+02:00"}
GoTestWeb in a nutshell
html5/css/js application
Parses go test json output client side
Integrates asciinema-player for showing console (serial, IPMI) logs
parses output event to get asciinema filename
events timestamp are used to seek the video on click
Renders the verbose test results folded if OK, open if Failed.
Keep test hierarchy (renders subtests inside tests)
GoTestWeb development
Disclaimer: I'm not a front dev!
github: GoTestWeb
techno:
Bootstrap
jQuerry
Ractive.js
RequireJS
Enough of JS, more of Go!
Tastevin
Tastevin is grouping the Go code used to build the tests.
Provides packages to ease writing test for remote platform.
Includes a gotest command to wrap go test -json save the json and display the summary.
Named as a wine tool to go with fiano the project to analyse and build LinuxBoot images from UEFI images.
GoExpect
goexpect is an implementation of Expect in go.
expect allows to script a behavior on a terminal:
wait for a regex
send a string
wait for another regex
send another string
...
GoExpect Spawners
command
ssh
generic (to be customized)
GoExpect custom Spawners
serial Spawner
connect a serial port to the generic spawner
IPMI Spawner
wrap ipmitool sol activate in a command spawner
QEMU Spawner
wrap qemu in a command spawner
can be extended as needed!
GoExpect Batcher
A sequence of actions (expect/send) can be presented in a go slice
BExp expect a regexp with the default timeout
BExpT expect a regexp with a given timeout
BSnd send a string
example for login in a server:
[]expect.Batcher{
&expect.BExp{R: "username:"},
&expect.BSnd{S: *user + "n"},
&expect.BExp{R: "password:"},
&expect.BSnd{S: *pass + "n"},
}
BExpTLog: BExpT with Log output
This custom element can be used in Batcher.
It provides the same feature as BExpT:
a matching regex and
a timeout
Adds a Log output to be send when the text is matched.
The goal: this log will be a seek point for the asciinema view.
Asciinema Writer
goexpect can duplicate the terminal output to a writer interface.
it's actually a writecloser interface, it will close at the end of the expect session.
The asciinema writer
gets it's data for the writer interface
adds the timestamp for the current event
save it in asciicast v2 format
logs message on open/close so that GoTestWeb can catch the details.
Scriptreplay Writer
The scriptreplay writer
log the data to a plain file
record the timestamp in a timing file
can be played with scriptreplay -t file.tim file.log
logs message on open/close so that GoTestWeb can generate download links.
Tastevin packages
Includes:
goexpect spawner for serial, IPMI, qemu
goexpect batcher extension: BExpTLog
console writer: asciicast and scriptreplay
control package for the CI system: em100, relay
a basic testsuite for LinuxBoot startup
a few utility packages
Tastevin command
gotest run
a wrapper to go test -json
saves the json to a file
output the package test summary (without error detail)
or output the verbose go test output
gotest serve
for developer: given a JSON, locally serve GoTestWeb to render it
https://github.com/gotestyourself/gotestsum can convert json to junit.
CI integration
gotest can be used directly in CI systems to save the json and asciicasts
gotest gen can generate the html and export the GoTestWeb application as well
simply place the json, asciicast, html and GoTestWeb in a CI artifact for later rendering in the browser!
Developer live mode
DEMO
gotest live
cd gotest-live-demo
gotest live go test -json .
Developer live mode
gotest live
run tests as gotest run
serve the results as gotest serve
use websocket to stream the results between gotest live and the browser
asciinema-player can only play plain files so this is unfortunately not streamed.
Tastevin and GoTestWeb are ready
For you to use and contribute to!
https://github.com/JulienVdG/tastevin/
https://github.com/JulienVdG/gotestweb/
Or contact me for more informations:
Julien Viard de Galbert julien.viard-de-galbert@itrenew.com
Questions ?
Links
Tastevin and GoTestWeb on github:
https://github.com/JulienVdG/tastevin/
https://github.com/JulienVdG/gotestweb/
More on ITRENEW vision by Ali Fenn at OCPSummit19
Unlocking the Power of Circular Datacenters
Introducing Sesame Open Hardware Compute
Me: Julien Viard de Galbert julien.viard-de-galbert@itrenew.com

Contenu connexe

Tendances

Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
Anne Nicolas
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
Etsuji Nakai
 

Tendances (20)

Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
 
6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of servers6. hands on - open mano demonstration in remote pool of servers
6. hands on - open mano demonstration in remote pool of servers
 
Linux firmware for iRMC controller on Fujitsu Primergy servers
Linux firmware for iRMC controller on Fujitsu Primergy serversLinux firmware for iRMC controller on Fujitsu Primergy servers
Linux firmware for iRMC controller on Fujitsu Primergy servers
 
Building a Virtualized Continuum with Intel(r) Clear Containers
Building a Virtualized Continuum with Intel(r) Clear ContainersBuilding a Virtualized Continuum with Intel(r) Clear Containers
Building a Virtualized Continuum with Intel(r) Clear Containers
 
淺談 Live patching technology
淺談 Live patching technology淺談 Live patching technology
淺談 Live patching technology
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano5. hands on - building local development environment with Open Mano
5. hands on - building local development environment with Open Mano
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
New Virtualization Technologies
New Virtualization TechnologiesNew Virtualization Technologies
New Virtualization Technologies
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 
Fast boot
Fast bootFast boot
Fast boot
 
Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xM
 
Kernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesKernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologies
 
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
 

Similaire à Embedded Recipes 2019 - Testing firmware the devops way

Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
ericholscher
 

Similaire à Embedded Recipes 2019 - Testing firmware the devops way (20)

Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Github
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Releasing and deploying python tools
Releasing and deploying python toolsReleasing and deploying python tools
Releasing and deploying python tools
 
Scripting for infosecs
Scripting for infosecsScripting for infosecs
Scripting for infosecs
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 

Plus de Anne Nicolas

Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Anne Nicolas
 

Plus de Anne Nicolas (20)

Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIKernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
 
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelKernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
 
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
 
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
 
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxEmbedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
 
Embedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialEmbedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less special
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
 
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureEmbedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
 
Embedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerEmbedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmaker
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integration
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDP
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easy
 
Kernel Recipes 2019 - CVEs are dead, long live the CVE!
Kernel Recipes 2019 - CVEs are dead, long live the CVE!Kernel Recipes 2019 - CVEs are dead, long live the CVE!
Kernel Recipes 2019 - CVEs are dead, long live the CVE!
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
 
Kernel Recipes 2019 - Kernel hacking behind closed doors
Kernel Recipes 2019 - Kernel hacking behind closed doorsKernel Recipes 2019 - Kernel hacking behind closed doors
Kernel Recipes 2019 - Kernel hacking behind closed doors
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 

Dernier

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Embedded Recipes 2019 - Testing firmware the devops way

  • 1. Testing Firmware the DevOps way
  • 2. System Firmware The firmware that starts your computer BIOS UEFI LinuxBoot
  • 3. LinuxBoot on OCP hardware ITRENEW is selling Open Compute Project hardware under the SESAME brand. Most of our hardware comes from hyper-scale datacenter decommissioning. The recertification process includes updating the firmwares. One option for firmware is LinuxBoot. ITRENEW historical activity is decommissioning
  • 4. LinuxBoot ? What Linuxboot is placing a Linux kernel in the BIOS flash and using userland to implement a bootloader. Presented last year at ER2018 by Trammel Hudson. We use u-root and it's bootloader implementations Why Maintainability Security microcode update Reduice/Remove UEFI footprint Linux is already part of our security audit... Extra features (nvme, infra integration) Replacing the UEFI (proprietary) firmware, with an open source one gives us those advantages.
  • 5. Developing LinuxBoot need Testing ! Testing requirements Automated testing with CI, like devops! Keeping the full logs from the console for debugging Up to 3 logs to watch: test output serial console IPMI console Keep all details on first run (long tests) Simple/summary view by default IPMI provides a Serial Over LAN access to the console.
  • 6. Testing Hardware setup This setup was presented last year at ER2018 by Jean-Marie Verdun. The hardware for testing is composed of servers used as DUT, controlling servers used as CI runners. Each DUT has: a relay for controlling power, a flash emulator to load firmware. So today we will focus on the testing software.
  • 7. Let's look at it! DEMO time! If you are reading the slides: Features are presented live here, explanations comes later...
  • 8. Why use Golang to write tests ? u-root is written in Go Go has it's test framework: go test and the testing package. BUT Go test output does not directly fulfil our requirements
  • 9. go test Files named *_test.go are compiled only for testing. Functions named Test*(t) are test case automatically run by the framework. Inside test functions subtest can be created by calling t.Run. Short example: func TestMyFeature(t *testing.T) { got := MyFeature(/* ... */) want := "OK" /* expected result */ if got != want { t.Fatalf("test failed, got %v, want %v", got, want) } }
  • 10. go test output Success has very minimal output: ok MyPackage 0.001s Error is more verbose: --- FAIL: TestMyFeature (0.00s) prez_test.go:13: test failed, got KO, want OK FAIL FAIL MyPackage 0.001s Verbose mode: messages on success, error gets flooded :( === RUN TestMyFeature --- PASS: TestMyFeature (0.00s) PASS ok command-line-arguments 0.001s
  • 11. go test -json There is a JSON output for further processing an event log with one JSON event per line {"Action":"run","Test":"TestMyFeature","Time":"2019-08-12T11:55:41.174693884+02:00"} {"Action":"output","Test":"TestMyFeature","Output":"=== RUN TestMyFeaturen","Time":"2 {"Action":"output","Test":"TestMyFeature","Output":"--- FAIL: TestMyFeature (0.00s)n"," {"Action":"output","Test":"TestMyFeature","Output":" prez_test.go:13: test failed, go {"Action":"fail","Test":"TestMyFeature","Elapsed":0,"Time":"2019-08-12T11:55:41.17486883 {"Action":"output","Output":"FAILn","Time":"2019-08-12T11:55:41.174877223+02:00"} {"Action":"output","Output":"FAILtMyPackaget0.001sn","Time":"2019-08-12T11:55:41.1750 {"Action":"fail","Elapsed":0.001,"Time":"2019-08-12T11:55:41.175039291+02:00"}
  • 12. GoTestWeb in a nutshell html5/css/js application Parses go test json output client side Integrates asciinema-player for showing console (serial, IPMI) logs parses output event to get asciinema filename events timestamp are used to seek the video on click Renders the verbose test results folded if OK, open if Failed. Keep test hierarchy (renders subtests inside tests)
  • 13. GoTestWeb development Disclaimer: I'm not a front dev! github: GoTestWeb techno: Bootstrap jQuerry Ractive.js RequireJS
  • 14. Enough of JS, more of Go!
  • 15. Tastevin Tastevin is grouping the Go code used to build the tests. Provides packages to ease writing test for remote platform. Includes a gotest command to wrap go test -json save the json and display the summary. Named as a wine tool to go with fiano the project to analyse and build LinuxBoot images from UEFI images.
  • 16. GoExpect goexpect is an implementation of Expect in go. expect allows to script a behavior on a terminal: wait for a regex send a string wait for another regex send another string ...
  • 18. GoExpect custom Spawners serial Spawner connect a serial port to the generic spawner IPMI Spawner wrap ipmitool sol activate in a command spawner QEMU Spawner wrap qemu in a command spawner can be extended as needed!
  • 19. GoExpect Batcher A sequence of actions (expect/send) can be presented in a go slice BExp expect a regexp with the default timeout BExpT expect a regexp with a given timeout BSnd send a string example for login in a server: []expect.Batcher{ &expect.BExp{R: "username:"}, &expect.BSnd{S: *user + "n"}, &expect.BExp{R: "password:"}, &expect.BSnd{S: *pass + "n"}, }
  • 20. BExpTLog: BExpT with Log output This custom element can be used in Batcher. It provides the same feature as BExpT: a matching regex and a timeout Adds a Log output to be send when the text is matched. The goal: this log will be a seek point for the asciinema view.
  • 21. Asciinema Writer goexpect can duplicate the terminal output to a writer interface. it's actually a writecloser interface, it will close at the end of the expect session. The asciinema writer gets it's data for the writer interface adds the timestamp for the current event save it in asciicast v2 format logs message on open/close so that GoTestWeb can catch the details.
  • 22. Scriptreplay Writer The scriptreplay writer log the data to a plain file record the timestamp in a timing file can be played with scriptreplay -t file.tim file.log logs message on open/close so that GoTestWeb can generate download links.
  • 23. Tastevin packages Includes: goexpect spawner for serial, IPMI, qemu goexpect batcher extension: BExpTLog console writer: asciicast and scriptreplay control package for the CI system: em100, relay a basic testsuite for LinuxBoot startup a few utility packages
  • 24. Tastevin command gotest run a wrapper to go test -json saves the json to a file output the package test summary (without error detail) or output the verbose go test output gotest serve for developer: given a JSON, locally serve GoTestWeb to render it https://github.com/gotestyourself/gotestsum can convert json to junit.
  • 25. CI integration gotest can be used directly in CI systems to save the json and asciicasts gotest gen can generate the html and export the GoTestWeb application as well simply place the json, asciicast, html and GoTestWeb in a CI artifact for later rendering in the browser!
  • 26. Developer live mode DEMO gotest live cd gotest-live-demo gotest live go test -json .
  • 27. Developer live mode gotest live run tests as gotest run serve the results as gotest serve use websocket to stream the results between gotest live and the browser asciinema-player can only play plain files so this is unfortunately not streamed.
  • 28. Tastevin and GoTestWeb are ready For you to use and contribute to! https://github.com/JulienVdG/tastevin/ https://github.com/JulienVdG/gotestweb/ Or contact me for more informations: Julien Viard de Galbert julien.viard-de-galbert@itrenew.com
  • 30. Links Tastevin and GoTestWeb on github: https://github.com/JulienVdG/tastevin/ https://github.com/JulienVdG/gotestweb/ More on ITRENEW vision by Ali Fenn at OCPSummit19 Unlocking the Power of Circular Datacenters Introducing Sesame Open Hardware Compute Me: Julien Viard de Galbert julien.viard-de-galbert@itrenew.com