mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 13:38:26 +00:00
qemu: Add a Kernel unit test
We test that the kernel path and the kernel parameters are properly built. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
8e495f6eff
commit
2ea9b9a385
18
qemu_test.go
18
qemu_test.go
@ -53,6 +53,13 @@ func testAppend(structure interface{}, expected string, t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
params = appendKnobs([]string{}, config)
|
params = appendKnobs([]string{}, config)
|
||||||
|
|
||||||
|
case Kernel:
|
||||||
|
config := Config{
|
||||||
|
Kernel: s,
|
||||||
|
}
|
||||||
|
|
||||||
|
params = appendKernel([]string{}, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
result := strings.Join(params, " ")
|
result := strings.Join(params, " ")
|
||||||
@ -148,3 +155,14 @@ func TestAppendKnobsAllFalse(t *testing.T) {
|
|||||||
|
|
||||||
testAppend(knobs, "", t)
|
testAppend(knobs, "", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var kernelString = "-kernel /opt/vmlinux.container -append root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable"
|
||||||
|
|
||||||
|
func TestAppendKernel(t *testing.T) {
|
||||||
|
kernel := Kernel{
|
||||||
|
Path: "/opt/vmlinux.container",
|
||||||
|
Params: "root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable",
|
||||||
|
}
|
||||||
|
|
||||||
|
testAppend(kernel, kernelString, t)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user