mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
annotate errors in e2e tests
This commit is contained in:
parent
617fa91264
commit
b9ca7384ec
@ -206,7 +206,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
sshClient, err = getMasterSSHClient()
|
sshClient, err = getMasterSSHClient()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to get the master SSH client.")
|
||||||
})
|
})
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
@ -252,7 +252,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
for _, p := range remoteFiles {
|
for _, p := range remoteFiles {
|
||||||
err := writeRemoteFile(sshClient, p.data, temporaryRemotePath, p.fileName, 0644)
|
err := writeRemoteFile(sshClient, p.data, temporaryRemotePath, p.fileName, 0644)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to write file %q at remote path %q with ssh client %+v", p.fileName, temporaryRemotePath, sshClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
// directory on kubernetes-master
|
// directory on kubernetes-master
|
||||||
@ -261,7 +261,7 @@ var _ = framework.KubeDescribe("Addon update", func() {
|
|||||||
|
|
||||||
// cleanup from previous tests
|
// cleanup from previous tests
|
||||||
_, _, _, err := sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix))
|
_, _, _, err := sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix))
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to remove remote dir %q with ssh client %+v", destinationDirPrefix, sshClient)
|
||||||
|
|
||||||
defer sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix)) // ignore result in cleanup
|
defer sshExec(sshClient, fmt.Sprintf("sudo rm -rf %s", destinationDirPrefix)) // ignore result in cleanup
|
||||||
sshExecAndVerify(sshClient, fmt.Sprintf("sudo mkdir -p %s", destinationDir))
|
sshExecAndVerify(sshClient, fmt.Sprintf("sudo mkdir -p %s", destinationDir))
|
||||||
@ -352,7 +352,7 @@ func getMasterSSHClient() (*ssh.Client, error) {
|
|||||||
|
|
||||||
func sshExecAndVerify(client *ssh.Client, cmd string) {
|
func sshExecAndVerify(client *ssh.Client, cmd string) {
|
||||||
_, _, rc, err := sshExec(client, cmd)
|
_, _, rc, err := sshExec(client, cmd)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to execute %q with ssh client %+v", cmd, client)
|
||||||
Expect(rc).To(Equal(0), "error return code from executing command on the cluster: %s", cmd)
|
Expect(rc).To(Equal(0), "error return code from executing command on the cluster: %s", cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ var _ = framework.KubeDescribe("ConfigMap", func() {
|
|||||||
configMap.ResourceVersion = "" // to force update
|
configMap.ResourceVersion = "" // to force update
|
||||||
configMap.Data["data-1"] = "value-2"
|
configMap.Data["data-1"] = "value-2"
|
||||||
_, err = f.Client.ConfigMaps(f.Namespace.Name).Update(configMap)
|
_, err = f.Client.ConfigMaps(f.Namespace.Name).Update(configMap)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to update configmap %q in namespace %q", configMap.Name, f.Namespace.Name)
|
||||||
|
|
||||||
By("waiting to observe update in volume")
|
By("waiting to observe update in volume")
|
||||||
Eventually(pollLogs, podLogTimeout, framework.Poll).Should(ContainSubstring("value-2"))
|
Eventually(pollLogs, podLogTimeout, framework.Poll).Should(ContainSubstring("value-2"))
|
||||||
|
@ -127,7 +127,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() {
|
|||||||
podClient.CreateSync(pod)
|
podClient.CreateSync(pod)
|
||||||
|
|
||||||
pod, err := podClient.Get(pod.Name)
|
pod, err := podClient.Get(pod.Name)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to get pod %q", pod.Name)
|
||||||
|
|
||||||
Eventually(func() (string, error) {
|
Eventually(func() (string, error) {
|
||||||
return framework.GetPodLogs(f.Client, f.Namespace.Name, pod.Name, containerName)
|
return framework.GetPodLogs(f.Client, f.Namespace.Name, pod.Name, containerName)
|
||||||
|
@ -56,7 +56,7 @@ func testHostIP(podClient *framework.PodClient, pod *api.Pod) {
|
|||||||
t := time.Now()
|
t := time.Now()
|
||||||
for {
|
for {
|
||||||
p, err := podClient.Get(pod.Name)
|
p, err := podClient.Get(pod.Name)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred(), "Failed to get pod %q", pod.Name)
|
||||||
if p.Status.HostIP != "" {
|
if p.Status.HostIP != "" {
|
||||||
framework.Logf("Pod %s has hostIP: %s", p.Name, p.Status.HostIP)
|
framework.Logf("Pod %s has hostIP: %s", p.Name, p.Status.HostIP)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user