WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 0997e4c

Browse files
debugging : testing with simple pod
testing with simple pod Signed-off-by: Jyoti-Prakash-Muddanna <[email protected]>
1 parent 86c2313 commit 0997e4c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/cloud-api-adaptor/test/e2e/assessment_runner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ func (tc *TestCase) Run() {
242242
}
243243
}
244244
if podvmName != "" {
245+
t.Log("Verifying PodVM console log")
245246
tc.assert.VerifyPodvmConsole(t, podvmName, tc.expectedPodvmConsoleLog)
246247
} else {
247248
t.Logf("Warning: Failed to validated as podvmName is failed")

src/cloud-api-adaptor/test/e2e/common_suite.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var E2eNamespace = envconf.RandomName("coco-pp-e2e-test", 25)
2929
func DoTestCreateSimplePod(t *testing.T, e env.Environment, assert CloudAssert) {
3030
pod := NewBusyboxPodWithName(E2eNamespace, "simple-test").GetPodOrFatal(t)
3131
if isTestOnCrio() {
32-
NewTestCase(t, e, "SimplePeerPod", assert, "PodVM is created").WithPod(pod).Run()
32+
t.Log("crio busybox error")
33+
NewTestCase(t, e, "SimplePeerPod", assert, "PodVM is created").WithPod(pod).WithExpectedPodvmConsoleLog("error").Run()
3334
} else {
3435
NewTestCase(t, e, "SimplePeerPod", assert, "PodVM is created").WithPod(pod).WithNydusSnapshotter().Run()
3536
}

src/cloud-api-adaptor/test/e2e/libvirt_common.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"testing"
1212
"time"
1313

14-
log "github.com/sirupsen/logrus"
1514
"libvirt.org/go/libvirt"
1615
)
1716

@@ -88,6 +87,7 @@ func (l LibvirtAssert) VerifyPodvmConsole(t *testing.T, podvmName, expectedStrin
8887
var dom *libvirt.Domain
8988
var err error
9089
for range 10 {
90+
t.Logf("Checking for PodVM %s", podvmName)
9191
dom, err = l.conn.LookupDomainByName(podvmName)
9292
if err == nil {
9393
break
@@ -105,7 +105,7 @@ func (l LibvirtAssert) VerifyPodvmConsole(t *testing.T, podvmName, expectedStrin
105105
}
106106

107107
if state == libvirt.DOMAIN_SHUTOFF {
108-
log.Info("starting podvm")
108+
t.Log("starting podvm")
109109
err = dom.Create()
110110
if err != nil {
111111
t.Error("Failed to start domain")
@@ -128,12 +128,13 @@ func (l LibvirtAssert) VerifyPodvmConsole(t *testing.T, podvmName, expectedStrin
128128
buf := make([]byte, 4096)
129129
var output strings.Builder
130130
var LibvirtLog = ""
131-
for range [10]int{} {
131+
for range 10 {
132132
n, err := stream.Recv(buf)
133133
if n > 0 {
134134
output.Write(buf[:n])
135135
if len(output.String()) > len(LibvirtLog) {
136136
LibvirtLog = output.String()
137+
t.Logf("Libvirt console output so far: \n%s", LibvirtLog)
137138
}
138139
if strings.Contains(LibvirtLog, expectedString) {
139140
t.Logf("Found expected String :%s in \n console :%s", expectedString, LibvirtLog)

0 commit comments

Comments
 (0)