Generally, there are many ways in which you can test the Linux kernel, but we will concentrate on the following four approaches:
- Using a test version of the kernel for normal work.
- Running special test suites, like LTP, on the new kernel.
- Doing unusual things with the new kernel installed.
- Measuring the system performance with the new kernel installed.
Of course, all of them can be used within one combined test procedure, so they can be regarded as diﬀerent phases of the testing process.
2.1 Phase One
The ﬁrst phase of kernel testing is simple: we try to boot the kernel and use it for normal work.
- Before starting the system in a fully functional conﬁguration it is recommended to boot the kernel with the init=/bin/bash command line argument, which makes it start only one bash process. From there you can check if the ﬁlesystems are mounted and unmounted properly and you can test some more complex kernel functions, like the suspend to disk or to RAM, in the minimal conﬁguration. In that case the only kernel modules loaded are the ones present in the initrd image mentioned in Subsection 1.6.6. Generally, you should refer to the documentation of your boot loader for more information about manual passing command line arguments to the kernel (in our opinion it is easier if GRUB is used).
Next, it is advisable to start the system in the runlevel 2 (usually, by passing the number 2 to the kernel as the last command line argument), in which case network servers and the X server are not started (your system may be conﬁgured to use another runlevel for this purpose, although this is very unusual, so you should look into /etc/inittab for conﬁdence). In this conﬁguration you can check if the network interfaces work and you can try to run the X server manually to make sure that it does not crash.
- Finally, you can boot the system into the runlevel 5 (ie. fully functional) or 3 (ie. fully functional withot X), depending on your needs.
Now, you are ready to use the system in a normal way for some time. Still, if you want to test the kernel quickly, you can carry out some typical operations, like downloading some ﬁles, reading email, browsing some web pages, ripping some audio tracks (from a legally bought audio CD, we presume), burning a CD or DVD etc., in a row to check if any of them fail in a way that would indicate a kernel problem.