User Space Kernel Unit Testing via Mediator Module

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional unit testing tools are unable to effectively test individual kernel functions of a network Operating System (OS) with specific parameters, as kernel functions require parameters to be passed by reference, which are not visible to these tools operating in user space, and attempting to test within the kernel can lead to kernel bloating, performance issues, or halting.

Innovation Solution

A framework that includes a user-space component and a kernel-space component, allowing the user-space component to identify and test kernel functions by generating messages that direct the kernel-space component to populate a queue with function and argument data, enabling sequential execution of kernel functions with arguments in kernel space without affecting the kernel's performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If traditional unit testing tools are used in user space, then the tools can operate independently from the kernel, but they are unable to access kernel function parameters passed by reference

Engineering Contradiction:
Improveindependence of testing toolsVSAvoidaccess to kernel parameters
Core Design Contradiction:
Ease of operationVSLoss of information

Solution Approach 1:

The patent introduces a kernel module as an intermediary component that bridges user space testing tools and kernel space parameters. The kernel module exposes selected kernel functions and their parameters to user space through a controlled interface, allowing traditional user space tools to access and test kernel parameters without direct kernel access. This mediator approach maintains user space independence while enabling parameter access through the kernel module's exposed interface.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If test scripts are written within the kernel to access parameters, then kernel functions can be tested with specific parameters, but the kernel becomes bloated and performance deteriorates

Engineering Contradiction:
Improveability to test kernel functionsVSAvoidkernel performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the testing functionality into a separate kernel module that is distinct from the core kernel. The kernel module contains only the specific test-related code and exposed parameters, while the main kernel remains unchanged and optimized. This segmentation allows testing capabilities to be added without bloating the core kernel, as the test scripts reside in the separate module rather than being integrated into the kernel's execution path.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts testing-related functionality from the kernel core and places it in a separate kernel module. By taking out the test scripts and parameter exposure mechanisms from the main kernel, the core kernel's performance and size are preserved. The extracted testing components can be loaded and unloaded independently, allowing reliable kernel function testing without permanently impacting kernel performance.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If test scripts are linked with the kernel, then kernel functions can be tested, but the kernel's behavior changes and it may halt

Engineering Contradiction:
Improvekernel function testabilityVSAvoidkernel behavior stability
Core Design Contradiction:
ReliabilityVSStability of the object's composition

Solution Approach 1:

The patent implements dynamic loading and unloading of test scripts through the kernel module. Test scripts are not statically linked with the kernel but are dynamically loaded when needed and can be unloaded when testing is complete. This dynamic approach allows the kernel to maintain its original stable behavior during normal operation, while enabling test functionality to be activated temporarily for testing purposes without permanently altering kernel behavior or risking kernel halts.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10108532B1Systems and methods for unit testing of operating system kernels from user space
Publication Date: 2018.10.23 JUNIPER NETWORKS INC
  • US10108532B1 patent drawing
  • US10108532B1 patent drawing
  • US10108532B1 patent drawing

AI summary

The disclosed computer-implemented method may include (1) providing a framework that includes (A) a user-space component and (B) a kernel-space component, (2) identifying, via the user-space component, a series of kernel functions to be tested in kernel space, (3) identifying, via the user-space component, one or more arguments for the series of kernel functions to be tested in kernel space, and then (4) performing, via the user-space component, unit testing of a kernel from user space by (A) generating at least one message that identifies the series of kernel functions and the arguments and (B) sending the message to the kernel-space component to direct the kernel-space component to (I) populate a queue in kernel space with the series of kernel functions and the arguments and (II) sequentially execute the series of kernel functions in the queue with the arguments. Various other methods, systems, and computer-readable media are also disclosed.