Unit Testing Loadable Kernel Module

chrischris Posts: 9

I just wrote my first character device and wanted to write some unit test for it using parasoft c++test. I know how to use parasoft for my regular user c code but being searching the net and can't find any example for creating unit tests, stubs, etc for this kernel module that i have. Is it even possible in parasoft? can someone please point me in the right direction?



  • MirekMirek Posts: 137 ✭✭✭

    Hi @chris,

    Testing kernel modules is possible with Parasoft C/C++test, but it requires a custom setup. I think the best path to move forward would be to contact the support team so that they can guide you.

    Can you please share some details of your development environment? Which kernel version are you working with? What is the version of the GCC compiler?

  • chrischris Posts: 9

    I found this project klibc, so i'm in the process of following their example...cloned this project and also cloned linux source v4.12...in the process of building the kernel now and to leave it to do something else but will be getting back to it. Once I get to the part of creating the project i'll see if I have anymore question. I'm new to this area so sometimes hard to know what i dont know :smile:
    GCC compiler 7.x
    For some reason i feel like this is for testing the actual linux and not the LKM that i have but i could be wrong. Let me know if you are familiar with the klibc project

  • MirekMirek Posts: 137 ✭✭✭

    Yes, we have experimented with klibc based setup recently. Again if you hit any problems when setting up, let us know, we can schedule a session to guide you.

  • chrischris Posts: 9

    hey @Mirek
    So I am stuck...i built the kernel, i followed the steps to create the C++test project using the bdf that was created from the trace of the linux make... so now i have a linux project and i have no idea how or where to put my LKM .c file to test :smile:
    How do i set up a session?

  • JeffEstesJeffEstes Posts: 105 admin

    Hi Chris, I sent you and email with info to connect

Sign In or Register to comment.