Writing shell filters for fun and profit

Why ? During my daily job I have sometimes to debug failed openqa test jobs. One of the testing mantra is to reproduce the issue and for that task the openqa community has developed some tooling. In practice, I often have some output like this one below from some job cloning operations: Cloning parents of sle-15-SP4-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit 1 job has been created: - sle-15-SP4-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit -> https://openqa.suse.de/tests/16425390 Cloning parents of sle-15-SP5-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit 1 job has been created: - sle-15-SP5-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit -> https://openqa.suse.de/tests/16425391 Cloning parents of sle-15-SP4-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit 1 job has been created: - sle-15-SP4-Server-DVD-Updates-x86_64-Build20250112-1-fips_ker_mode_gnome@64bit -> https://openqa.suse.de/tests/16425392 And when I want to monitor those jobs, I’d need to copy-paste all the job URLs and pass them as arguments to the cool openqa-mon utility which will show and notify me of the job status in the terminal. ...

January 19, 2025 · Andrea Manzini

Debriefing Advent of Code 2024

🎄 Intro After a very interesting and fun SUSE hackweek, as every December since some years, I took part to Advent of Code. First of all, I wish to thank Eric Wastl because he’s giving us every year a great and unforgettable advent-ure. [image source: Reddit u/edo360 ] ✨ What’s Advent of Code ? More than just a countdown to Christmas, AoC is a joyful game that invites developers of all age and levels to sharpen their problem-solving abilities and coding skills. Like a virtual advent calendar, AoC presents a new programming puzzle each day from December 1st to 25th. These puzzles are often deceptively simple at first glance, but they quickly unfold into intricate challenges requiring clever algorithms and efficient code. ...

December 26, 2024 · Andrea Manzini

Playing with Rust on ARM architecture

An old find I found an old cubieboard3 (cubietruck) collecting dust in a drawer, so I took the chance to try out Rust cross compilation and collect here some notes about the process. Here’s the baby: Give it a penguin First of all, I installed an ARM linux distro on a MicroSD card and started the device: [user@arm ~]$ cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 50.52 Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 4 processor : 1 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 50.52 Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 4 Hardware : Allwinner sun7i (A20) Family Revision : 0000 So our device is ARM model v7l ; this means is a 32bit CPU, if you are curious there’s also a reference manual around. Now we will work from a development machine. ...

March 1, 2024 · Andrea Manzini

Using containers for unit testing of bash functions

Intro Unit testing of Bash functions involves the process of systematically verifying the correctness and reliability of individual functions within a Bash script. While Bash is primarily used for scripting and automation, it’s important to ensure that the functions within your scripts work as expected, especially as scripts become more complex. Unit testing in Bash can help catch bugs and prevent unexpected behavior. Fixing bugs Working on a bugfix for an internal shell script, I wanted to add some unit tests to ensure correctness. After a quick search, I found this single-file “framework” (thanks, Ryan) that provides xUnit-style assertions. So we can use it as a starting point. ...

August 17, 2023 · Andrea Manzini