[TEST] Test container command
@@ -24,6 +24,7 @@ package native
import (
"os"
+ "strings"
"testing"
. "github.com/onsi/gomega"
@@ -86,6 +87,7 @@ func TestNativeIntegrations(t *testing.T) {
// Check the Integration is ready
Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).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!"))
@@ -102,6 +104,7 @@ func TestNativeIntegrations(t *testing.T) {
// Check the Integration is still ready
Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).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!"))
@@ -111,3 +114,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
+ }
+}
