Skip to content

Commit

Permalink
osday2024 post
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmanzo committed Mar 11, 2024
1 parent e44ce5b commit bb7a9b7
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 1 deletion.
224 changes: 223 additions & 1 deletion content/post/followup_Linux_Test_Project_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,232 @@ draft: true

## 🕵️ Intro

In the [last post](https://ilmanzo.github.io/post/first_steps_of_ltp_linux_test_project/) we only mentioned the most important part of a LTP test. With this articlem, we are going to describe the options available in the `struct tst_test`.
In the [last post](https://ilmanzo.github.io/post/first_steps_of_ltp_linux_test_project/) we only mentioned the most important part of a LTP test. In this articlem, we are going to describe the options available in the `struct tst_test`.

The [Linux Test Project](https://github.com/linux-test-project/ltp) is a joint project started years ago by SGI, OSDL and Bull developed and now maintained by IBM, Cisco, Fujitsu, SUSE, Red Hat, Oracle and many others. The project goal is to deliver tests to the open source community that validate the reliability, robustness, and stability of Linux.

## Talk is cheap

The struct itself is pretty well commented, we are going to highlight the most important stuff. For the rest, please consult documentation (TODO: link)

{{< highlight C "linenos=table">}}
struct tst_test {
/* number of tests available in test() function */
unsigned int tcnt;

struct tst_option *options;

const char *min_kver;

/*
* The supported_archs is a NULL terminated list of archs the test
* does support.
*/
const char *const *supported_archs;

/* If set the test is compiled out */
const char *tconf_msg;

int needs_tmpdir:1;
int needs_root:1;
int forks_child:1;
int needs_device:1;
int needs_checkpoints:1;
int needs_overlay:1;
int format_device:1;
int mount_device:1;
int needs_rofs:1;
int child_needs_reinit:1;
int needs_devfs:1;
int restore_wallclock:1;

/*
* If set the test function will be executed for all available
* filesystems and the current filesystem type would be set in the
* tst_device->fs_type.
*
* The test setup and cleanup are executed before/after __EACH__ call
* to the test function.
*/
int all_filesystems:1;

int skip_in_lockdown:1;
int skip_in_secureboot:1;
int skip_in_compat:1;

/*
* If set, the hugetlbfs will be mounted at .mntpoint.
*/
int needs_hugetlbfs:1;

/*
* The skip_filesystems is a NULL terminated list of filesystems the
* test does not support. It can also be used to disable whole class of
* filesystems with a special keywords such as "fuse".
*/
const char *const *skip_filesystems;

/* Minimum number of online CPU required by the test */
unsigned long min_cpus;

/* Minimum size(MB) of MemAvailable required by the test */
unsigned long min_mem_avail;

/* Minimum size(MB) of SwapFree required by the test */
unsigned long min_swap_avail;

/*
* Two policies for reserving hugepage:
*
* TST_REQUEST:
* It will try the best to reserve available huge pages and return the number
* of available hugepages in tst_hugepages, which may be 0 if hugepages are
* not supported at all.
*
* TST_NEEDS:
* This is an enforced requirement, LTP should strictly do hpages applying and
* guarantee the 'HugePages_Free' no less than pages which makes that test can
* use these specified numbers correctly. Otherwise, test exits with TCONF if
* the attempt to reserve hugepages fails or reserves less than requested.
*
* With success test stores the reserved hugepage number in 'tst_hugepages. For
* the system without hugetlb supporting, variable 'tst_hugepages' will be set to 0.
* If the hugepage number needs to be set to 0 on supported hugetlb system, please
* use '.hugepages = {TST_NO_HUGEPAGES}'.
*
* Also, we do cleanup and restore work for the hpages resetting automatically.
*/
struct tst_hugepage hugepages;

/*
* If set to non-zero, call tst_taint_init(taint_check) during setup
* and check kernel taint at the end of the test. If all_filesystems
* is non-zero, taint check will be performed after each FS test and
* testing will be terminated by TBROK if taint is detected.
*/
unsigned int taint_check;

/*
* If set non-zero denotes number of test variant, the test is executed
* variants times each time with tst_variant set to different number.
*
* This allows us to run the same test for different settings. The
* intended use is to test different syscall wrappers/variants but the
* API is generic and does not limit the usage in any way.
*/
unsigned int test_variants;

/* Minimal device size in megabytes */
unsigned int dev_min_size;

/* Device filesystem type override NULL == default */
const char *dev_fs_type;

/* Options passed to SAFE_MKFS() when format_device is set */
const char *const *dev_fs_opts;
const char *const *dev_extra_opts;

/* Device mount options, used if mount_device is set */
const char *mntpoint;
unsigned int mnt_flags;
void *mnt_data;

/*
* Maximal test runtime in seconds.
*
* Any test that runs for more than a second or two should set this and
* also use tst_remaining_runtime() to exit when runtime was used up.
* Tests may finish sooner, for example if requested number of
* iterations was reached before the runtime runs out.
*
* If test runtime cannot be know in advance it should be set to
* TST_UNLIMITED_RUNTIME.
*/
int max_runtime;

void (*setup)(void);
void (*cleanup)(void);

void (*test)(unsigned int test_nr);
void (*test_all)(void);

/* Syscall name used by the timer measurement library */
const char *scall;

/* Sampling function for timer measurement testcases */
int (*sample)(int clk_id, long long usec);

/* NULL terminated array of resource file names */
const char *const *resource_files;

/* NULL terminated array of needed kernel drivers */
const char * const *needs_drivers;

/*
* {NULL, NULL} terminated array of (/proc, /sys) files to save
* before setup and restore after cleanup
*/
const struct tst_path_val *save_restore;

/*
* {} terminated array of ulimit resource type and value.
*/
const struct tst_ulimit_val *ulimit;

/*
* NULL terminated array of kernel config options required for the
* test.
*/
const char *const *needs_kconfigs;

/*
* {NULL, NULL} terminated array to be allocated buffers.
*/
struct tst_buffers *bufs;

/*
* {NULL, NULL} terminated array of capability settings
*/
struct tst_cap *caps;

/*
* {NULL, NULL} terminated array of tags.
*/
const struct tst_tag *tags;

/* NULL terminated array of required commands */
const char *const *needs_cmds;

/* Requires a particular CGroup API version. */
const enum tst_cg_ver needs_cgroup_ver;

/* {} terminated array of required CGroup controllers */
const char *const *needs_cgroup_ctrls;
};
{{< / highlight >}}

##

- line 3: this is the number of the tests that the program contains. If you are using a data-driven approach with many test cases in an array, you want to have this number equal to the array size.

- line 5: a pointer to a null-terminated list of options (TODO)

- line 7: a string describing the minimum kernel version needed for this test. When run on an older one, LTP will automatically exclude this test with an appropriate message

- line 13:

- line 16:

- lines 18-48: set of boolean flags that enables specific LTP behaviour. For example if `needs_tmpdir` is `true`, LTP will automatically create a temporary directory for our program data.


- line 135-136: pointers to the `setup` and `clean` functions that will be called only once, before and after the test run

- line 138-139: mutually exclusive pointers to the actual test code. The first accepts an integer number, useful when you have many test cases for the same function. If the test is a single case, you can use the the second one

- line 168: array of kconfig options required; when the test is run on a kernel missing some requirement, LTP will skip the test with a message.

- line 173: if your test


## ✅ Conclusion
Expand Down
71 changes: 71 additions & 0 deletions content/post/wrapping_up_osday_2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
layout: post
title: "Osday 2024 recap"
description: "Quick debriefing after a cool event in Florence"
categories: conference
tags: [linux, opensource, conferences, networking, social]
author: Andrea Manzini
date: 2024-03-11
---

# Intro: [SYN]

Last 7-8 March 2024 I was at [Open Source Day 2024](https://osday.dev/): a free conference organized by [Schrodinger-Hat Open Source Community](https://www.schrodinger-hat.it/). Two days of talks, meeting old and new friends, networking and fun in [a beautiful city](https://en.wikipedia.org/wiki/Florence).

Since the event was split into two tracks, I had to carefully choose which one to attend ; if you are interested [all the sessions was recorded and live streamed](https://osday.dev/agenda).

| Day | Stream Recording links |
|------|-------------|------------|
| 1 | [Alpha Track](https://youtube.com/live/_mA4mvYpU68) | [Beta Track](https://youtube.com/live/te8tNwnej0M) |
| 2 | [Alpha Track](https://youtube.com/live/8owI4xBEIl0) | [Beta Track](https://youtube.com/live/Va6vIYCVxj0) |

Speaking of open source events, each talk proposal is simply an issue on a [GitHub repository](https://github.com/Schrodinger-Hat/osday/issues?q=is%3Aissue+label%3AOSDay-talk), and the selection was done by picking the ones with most "thumbs up" vote from the community.

I will just post here some highlights and musings, without any intention to detract from those I won't mention :smile:

![badge1](/img/osday_2024/1709976654872.jpeg)

# First day: [SYN-ACK]

📜 [PJ Hagerty](https://twitter.com/aspleenic) made an examination of the history of Open Source; from naive days of "everything is free for everyone", to the current status where Open Source have become financially a part of everything technology driven. Good hints about how to be a participant and good Open Source citizen.

🦀 [Irine Kokilashvili](https://github.com/mamaicode) introduced [nanocl](https://github.com/next-hat/nanocl), a kubernetes replacement written in Rust started as a study project.

[Alessandro Albano](https://www.linkedin.com/in/alessandro-albano-57b015122/) talked about the importance of designing accessible and inclusive software.

🛡️ [Abdel Sghiouar](https://twitter.com/boredabdel) gave a wonderful talk about Software Supply Chain Security (SLSA, SBOM), why we should care and how it works in practice.

🛰️ [Sal Kimmich](https://twitter.com/Sal_on_Cyber) brought us to the space, explaining how Linux has been adapted for use in extra terrestrial project, discussing both technical advancements and the broader implications for the open source community.

👾 followed also two afternoon talks about webassembly, a technology which is catching on. One from [Sohan Maheshwar](https://twitter.com/soganmageshwar) and other from [Noah Jelich](https://twitter.com/NoahJelich); [Edoardo Dusi](https://twitter.com/edodusi) talk about WebAssembly on the next day as well.

👔 last but not least, [Francesco Corti](https://www.linkedin.com/in/fcorti/) made us think about a simple question: [where is Open Source going ?](https://www.slideshare.net/slideshows/from-the-origin-to-the-future-of-open-source-model-and-business/266713630) Is the model sustainable from a business perspective ?

![pic1](/img/osday_2024/img_20240307_100520.jpg)

# Second Day: [ACK]

📈 [Nathan Marrs](https://twitter.com/NathanielMarrs) told us the art of monetizing open-source projects without compromising their core principles, with the use case of real-world success story of Grafana.

⌨️ [Noam Honig](https://twitter.com/noamhonig) did a live coding session showing off the [*remult*](https://remult.dev/) framework, for seamless backend-frontend integration and fast REST API development.

🔮 [Christina Dahlén](https://www.linkedin.com/in/christinadahlen/) introduced [*lavinmq*](https://lavinmq.com/), an open source message broker engineered for optimal resource utilisation and high performance. As a Crystal language ambassador, I appreciated the use of this underrated language :smile:

🐱 [Schrödinger Hat team](https://www.linkedin.com/company/schrodinger-hat/) gave an historic retrospective of the team and a nice review of the last year of their activities.

🔬 [Costa Tsaousis](https://twitter.com/CostaTsaousis) presented an in-depth overview of building [Netdata](https://www.netdata.cloud/), a powerful open-source, distributed observability pipeline designed to provide higher fidelity, easier scalability, and a lower cost of ownership compared to traditional monitoring solutions.

💾 [Federico Terzi](https://twitter.com/terzi_federico) introduced Conflict-free Replicated Data Types in theory and practice. Awesome and easy to follow even for non-Javascript lovers!

🎸 [Omar Diop](https://www.linkedin.com/in/omar-diop-dev/) Brought us on a musical journey through the world of open source software as he shared the story behind crafting from scratch an online guitar tuner.

🎤 [Francesco Napoletano](https://twitter.com/napodev) explained in a nice way how to fight ageism, and how an over 40 developer can still rock in [10 easy steps](https://www.youtube.com/live/Va6vIYCVxj0?si=Y6ocjJm4DPKWS_dN&t=28050) !

![pic2](/img/osday_2024/img_20240307_102019.jpg)

# Goodbye [FIN]

A special **thank you** to all sponsors, in particular to [SUSE](https://www.suse.com) for making this conference and my attendance possible. In the next picture you can see my awesome colleagues Giulio, Luca, and Stefano at SUSE booth. Good work guys!

![suse](/img/osday_2024/1709802588364.jpeg)

Binary file added static/img/osday_2024/1709802588364.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/osday_2024/1709976654479.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/osday_2024/1709976654872.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/osday_2024/img_20240307_100520.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/osday_2024/img_20240307_102019.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bb7a9b7

Please sign in to comment.