Re: Kernel Mocking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your expedient answer!

So, I was discussing an alternative to mocking; function hooking. But in a benign way. Is there any way to, at runtime replace the functionality of code in order that you specify what it does for any given kernel function?

On Fri, Feb 20, 2015 at 3:24 PM, Greg KH <greg@xxxxxxxxx> wrote:
On Fri, Feb 20, 2015 at 02:51:25PM -0500, Kenneth Adam Miller wrote:
> So, in userland development, the idea of mocking is used to isolate context
> management and machine configuration into a single class or set of functions
> that can be reused, and also facilitate testing much easier. Google mock is a
> great example.
>
> Say I develop a kernel module, and I want that module to have some result X
> after some returned result, whatever that might be. Is there anything similar
> for kernel code? 

Not really, sorry.  Running in the kernel means you don't have much room
for "simulation".  But you can use qemu, or other virtual machines and a
debugger to test your code if you really want to.

Good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux