From cc7940a98d5b0db1889ed7935337ea925226ad6e Mon Sep 17 00:00:00 2001 From: Bella Khizgiyaev Date: Mon, 27 Nov 2023 14:07:01 +0200 Subject: [PATCH] Change CI tag to latest version and VM id. Signed-off-by: Bella Khizgiyaev --- .github/workflows/pull-request.yml | 2 +- tests/suit/framework/ova.go | 2 +- tests/suit/ova_test.go | 38 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 38fbb1736..13c26612b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -54,7 +54,7 @@ jobs: uses: actions/checkout@v4 with: repository: kubev2v/forkliftci - ref: v9.0 + ref: v10.0 - name: Build and setup everything with bazel id: forkliftci diff --git a/tests/suit/framework/ova.go b/tests/suit/framework/ova.go index cba013f0b..03c0f7a98 100644 --- a/tests/suit/framework/ova.go +++ b/tests/suit/framework/ova.go @@ -17,7 +17,7 @@ func (r *OvaClient) LoadSourceDetails() (vm *OvaVM, err error) { r.storageClass = "nfs-csi" } - r.vmData.testVMId = "21bf790bcdc4591ef01ec6fa7b4812e0d830" + r.vmData.testVMId = "c5686650854d1e69b4123f4bf2e70fe1ed2a" r.vmData.testNetworkID = "ae1badc8c693926f492a01e2f357d6af321b" r.vmData.testStorageName = "Dummy storage for source provider ova-provider" return &r.vmData, nil diff --git a/tests/suit/ova_test.go b/tests/suit/ova_test.go index 02d24f0e9..cf5233f90 100644 --- a/tests/suit/ova_test.go +++ b/tests/suit/ova_test.go @@ -1,6 +1,11 @@ package suit_test import ( + "bytes" + "context" + "fmt" + "io" + "strings" "time" forkliftv1 "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1" @@ -8,6 +13,8 @@ import ( "github.com/konveyor/forklift-controller/tests/suit/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -78,6 +85,37 @@ var _ = Describe("[level:component]Migration tests for OVA provider", func() { err = utils.CreateMigrationFromDefinition(f.CrClient, migrationDef) Expect(err).ToNot(HaveOccurred()) err = utils.WaitForMigrationSucceededWithTimeout(f.CrClient, provider.Namespace, test_migration_name, 900*time.Second) + if err != nil { + podname := "" + pods, err1 := f.K8sClient.CoreV1().Pods(targetNS.Name).List(context.Background(), metav1.ListOptions{}) + if err1 != nil { + fmt.Println("this is error, ", err1) + } + + for _, pod := range pods.Items { + if strings.Contains(pod.Name, "virtv2v") { + podname = pod.Name + } + } + podLogOpts := core.PodLogOptions{} + request := f.K8sClient.CoreV1().Pods(namespace).GetLogs(podname, &podLogOpts) + podLogs, err1 := request.Stream(context.Background()) + if err1 != nil { + panic(err1.Error()) + } + defer podLogs.Close() + + buf := new(bytes.Buffer) + _, err1 = io.Copy(buf, podLogs) + if err1 != nil { + panic(err1.Error()) + } + str := buf.String() + + fmt.Println("Logs for pod", podname) + fmt.Println(str) + + } Expect(err).ToNot(HaveOccurred()) })