This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-1.8.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-1.8.x by this push:
     new 6556b97ee [TEST] Test container command
6556b97ee is described below

commit 6556b97eeb19031bbe11135ad2d5dfebdc9ba9c5
Author: Jan Bouska <[email protected]>
AuthorDate: Mon Aug 8 11:55:09 2022 +0200

    [TEST] Test container command
---
 e2e/native/native_test.go | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/e2e/native/native_test.go b/e2e/native/native_test.go
index b74010667..72580ba4e 100644
--- a/e2e/native/native_test.go
+++ b/e2e/native/native_test.go
@@ -23,6 +23,7 @@ limitations under the License.
 package native
 
 import (
+       "strings"
        "testing"
 
        . "github.com/onsi/gomega"
@@ -79,6 +80,7 @@ func TestNativeIntegrations(t *testing.T) {
 
                        // Check the Integration is ready
                        Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), 
TestTimeoutShort).Should(WithTransform(getContainerCommand(), 
ContainSubstring("java")))
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
 
                        Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -95,6 +97,7 @@ func TestNativeIntegrations(t *testing.T) {
 
                        // Check the Integration is still ready
                        Eventually(IntegrationPodPhase(ns, name), 
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+                       Eventually(IntegrationPod(ns, name), 
TestTimeoutShort).Should(WithTransform(getContainerCommand(), 
MatchRegexp(".*camel-k-integration-.+-runner.*")))
                        Eventually(IntegrationConditionStatus(ns, name, 
v1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
 
                        Eventually(IntegrationLogs(ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -104,3 +107,11 @@ func TestNativeIntegrations(t *testing.T) {
                Expect(Kamel("delete", "--all", "-n", 
ns).Execute()).To(Succeed())
        })
 }
+
+func getContainerCommand() func(pod *corev1.Pod) string {
+       return func(pod *corev1.Pod) string {
+               cmd := strings.Join(pod.Spec.Containers[0].Command, " ")
+               cmd = cmd + strings.Join(pod.Spec.Containers[0].Args, " ")
+               return cmd
+       }
+}

Reply via email to