Skip to content

Commit

Permalink
Merge pull request kubevirt#7902 from oshoval/isolation
Browse files Browse the repository at this point in the history
unit test, isolation: Make test agnostic to virt-launcher process name
  • Loading branch information
kubevirt-bot authored Jun 20, 2022
2 parents 6b360dc + 1618218 commit 8dea8d0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/virt-handler/isolation/detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ var _ = Describe("Isolation Detector", func() {

var _ = Describe("findIsolatedQemuProcess", func() {
const virtLauncherPid = 1
virtLauncherProc := ProcessStub{pid: virtLauncherPid, ppid: 0, binary: "virt-launcher"}
virtLauncherForkedProc := ProcessStub{pid: 26, ppid: 1, binary: "virt-launcher --no-fork true"}
libvirtdProc := ProcessStub{pid: 226, ppid: 26, binary: "libvirtd"}
fakeProcess1 := ProcessStub{pid: virtLauncherPid, ppid: 0, binary: "fake-process-1"}
fakeProcess2 := ProcessStub{pid: 26, ppid: virtLauncherPid, binary: "fake-process-2"}
fakeProcess3 := ProcessStub{pid: 226, ppid: 26, binary: "fake-process-3"}
virtLauncherProcesses := []ps.Process{
virtLauncherProc,
virtLauncherForkedProc,
libvirtdProc}
fakeProcess1,
fakeProcess2,
fakeProcess3}

qemuKvmProc := ProcessStub{pid: 101, ppid: 1, binary: "qemu-kvm"}
qemuSystemProc := ProcessStub{pid: 101, ppid: 1, binary: "qemu-system"}
qemuKvmProc := ProcessStub{pid: 101, ppid: virtLauncherPid, binary: "qemu-kvm"}
qemuSystemProc := ProcessStub{pid: 101, ppid: virtLauncherPid, binary: "qemu-system"}

DescribeTable("should return QEMU process",
func(processes []ps.Process, pid int, expectedProcess ps.Process) {
Expand Down

0 comments on commit 8dea8d0

Please sign in to comment.