A utility for rapid testing of Linux kernel changes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
dracut.conf.d
initrds
kernel
tools
.gitignore
COPYING
blktests_rbd_autorun.sh
blktests_zram_autorun.sh
cephfs_autorun.sh
cephfs_fuse_autorun.sh
cut_blktests_rbd.sh
cut_blktests_zram.sh
cut_cephfs.sh
cut_cephfs_fuse.sh
cut_dropbear.sh
cut_fcoe_local.sh
cut_fstests_cephfs.sh
cut_fstests_cifs.sh
cut_fstests_local.sh
cut_lio_local.sh
cut_lio_rbd.sh
cut_mpath_local.sh
cut_nvme_local.sh
cut_nvme_rbd.sh
cut_nvme_rdma.sh
cut_qemu_rbd.sh
cut_rbd.sh
cut_rbd_nbd.sh
cut_samba_cephfs.sh
cut_samba_local.sh
cut_simple_example.sh
cut_tcmu_rbd_loop.sh
cut_tgt_local.sh
cut_usb_rbd.sh
dropbear_autorun.sh
fcoe_local_autorun.sh
fstests_cephfs_autorun.sh
fstests_cifs_autorun.sh
fstests_local_autorun.sh
lio_local_autorun.sh
lio_rbd_autorun.sh
mpath_local_autorun.sh
nvme_local_autorun.sh
nvme_rbd_autorun.sh
nvme_rdma_autorun.sh
rapido.conf.example
rbd_autorun.sh
rbd_nbd_autorun.sh
readme.adoc
runtime.vars
samba_cephfs_autorun.sh
samba_local_autorun.sh
simple_example_autorun.sh
tcmu_rbd_loop_autorun.sh
tgt_local_autorun.sh
usb_rbd_autorun.sh
vm.sh
vm_autorun.env

readme.adoc

Rapido

Overview

Rapido is a utility for rapid testing of Linux kernel changes. It was initially targeted at Ceph RBD and CephFS kernel client functionality, but now also covers a number of standalone use cases.

The scripts that make up Rapido are in themselves quite brainless. Most of the heavy lifting is instead performed by:

Dracut

Generates a VM image, with kernel-modules and minimal user-space.

QEMU

Boots a given Dracut VM image and compiled Linux kernel on the local system.

Setup

Rapido has a pretty minimal set of dependencies, which should be present on all major Linux distributions.

  • Dracut

  • QEMU / KVM

  • iproute2 with 'ip tuntap' support

Once all dependencies have been installed, Rapido can be configured via rapido.conf (see rapido.conf.example). At a minimum, the Linux kernel source parameters should be defined.

Network Configuration

Test VM images may be "cut" with or without network support. For networking, the bridge, tap and MAC address parameters must be specified in rapido.conf. The tools/br_setup.sh script should be run as root to configure the bridge network device. By default, the bridge network is isolated, and isn’t connected to any physical adapters.

Running

Depending on which kernel component or functionality you’d like to test, choose a 'cut_' script to generate a VM image, which pulls all relevant kernel modules from the rapido.conf KERNEL_SRC directory. The VM initramfs image will be written to 'initrds/myinitrd'.

Once generated, the VM image and kernel can be booted by running 'vm.sh'.

Adding Your Own Tests

Rapido can be easily extended to test any kernel functionality of interest. To do so, make a copy of the 'cut_simple_example.sh' and 'simple_example_autorun.sh' scripts, and modify them to suit your needs. The example scripts are fully annotated.

Feedback and Bug Reporting

Please raise any questions or issues upstream via https://github.com/rapido-linux/rapido/issues

Architecture

                                   +------------------------+
                                   |                        |
                                   | Rapido "cut" script    |
                                   |                        |
                                   | +--------------------+ |    +-----+
                                   | |                    | |    |     |
                                   | | File manifest:     | |    |     |
+------------------------+         | | + Kernel modules   | |    |     |
|                        |         | | + User-space files | |    |     |
| Userspace dependencies |         | |                    | |    |     |
| E.g.                   |         | +---------+----------+ |    |     |
| - xfstests, blktests   |         |           |            <----+     |
| - Ceph conf + binaries |         | +---------v----------+ |    |     |
| - Samba                +------+---->                    | |    |     |
| - etc.                 |      |  | |  Dracut initramfs  | |    |  R  |
|                        |      |  | |  generator         | |    |  a  |
+------------------------+      ^  | |                    | |    |  p  |
                                |  | +---------+----------+ |    |  i  |
+-------------------------+     |  |           |            |    |  d  |
|                         |     |  +------------------------+    |  o  |
| Rapido "autorun" script +-----+              |                 |  .  |
|                         |     |    +---------v----------+      |  c  |
+-------------------------+     |    |                    |      |  o  |
                                |    | Initramfs          |      |  n  |
                                ^    | + Includes all     |      |  f  |
+------------------------+      |    |   kernel / user    |      |     |
| Compiled Linux Kernel  |      |    |   dependencies     |      |     |
|                        |      |    |                    |      |     |
| +---------+            |      |    +---------+----------+      |     |
| | Modules +-------------------+              |                 |     |
| +---------+            |         +------------------------+    |     |
|                        |         |           |            |    |     |
| +---------+            |         |  Rapido "vm" script    |    |     |
| | bzImage +-------------------+  |           |            |    |     |
| +---------+            |      |  |  +--------v----+       |    |     |
|                        |      |  |  |             |       <----+     |
+------------------------+      +-----> qemu / KVM  |       |    |     |
                                   |  |             |       |    |     |
                                   |  +--------+----+       |    |     |
                                   |           |            |    +--+--+
                                   +------------------------+       |
   ___________________                         |                    |
   | Virtual network |o-------+    +-----------v--------------+     v
   =========^=========        |    |                          |     |
            |                 |    | Virtual Machine          |     |
            |                 +---o| + Console redirected     |     |
            |                      |   to stdout / from stdin <-----+
+-----------+--------------+       | + autorun script         |     |
|                          |       |   executed on boot       |     |
| Rapido "br_setup" script |       |                          |     v
|                          |       +--------------------------+     |
+-----------^--------------+                                        |
            |                                                       |
            +------------------------------<------------------------+