Skip to content

Commit

Permalink
Merge pull request kubernetes#24505 from yujuhong/remove_test
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Remove disabled mirror pod test in cmd/integration

The new tests for mirror pods are being added in the node e2e suite.

This partially addresses kubernetes#24440
  • Loading branch information
k8s-merge-robot committed Apr 20, 2016
2 parents c46788a + 3e2901a commit 28f968a
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/cm"
containertest "k8s.io/kubernetes/pkg/kubelet/container/testing"
"k8s.io/kubernetes/pkg/kubelet/dockertools"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/master"
"k8s.io/kubernetes/pkg/runtime"
Expand Down Expand Up @@ -383,73 +382,6 @@ func podRunning(c *client.Client, podNamespace string, podName string) wait.Cond
}
}

// runStaticPodTest is disabled until #6651 is resolved.
func runStaticPodTest(c *client.Client, configFilePath string) {
var testCases = []struct {
desc string
fileContents string
}{
{
desc: "static-pod-from-manifest",
fileContents: `version: v1beta2
id: static-pod-from-manifest
containers:
- name: static-container
image: gcr.io/google_containers/pause:2.0`,
},
{
desc: "static-pod-from-spec",
fileContents: `{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "static-pod-from-spec"
},
"spec": {
"containers": [{
"name": "static-container",
"image": "gcr.io/google_containers/pause:2.0"
}]
}
}`,
},
}

for _, testCase := range testCases {
func() {
desc := testCase.desc
manifestFile, err := ioutil.TempFile(configFilePath, "")
defer os.Remove(manifestFile.Name())
ioutil.WriteFile(manifestFile.Name(), []byte(testCase.fileContents), 0600)

// Wait for the mirror pod to be created.
podName := fmt.Sprintf("%s-localhost", desc)
namespace := kubetypes.NamespaceDefault
if err := wait.Poll(time.Second, longTestTimeout,
podRunning(c, namespace, podName)); err != nil {
if pods, err := c.Pods(namespace).List(api.ListOptions{}); err == nil {
for _, pod := range pods.Items {
glog.Infof("pod found: %s/%s", namespace, pod.Name)
}
}
glog.Fatalf("%s FAILED: mirror pod has not been created or is not running: %v", desc, err)
}
// Delete the mirror pod, and wait for it to be recreated.
c.Pods(namespace).Delete(podName, nil)
if err = wait.Poll(time.Second, longTestTimeout,
podRunning(c, namespace, podName)); err != nil {
glog.Fatalf("%s FAILED: mirror pod has not been re-created or is not running: %v", desc, err)
}
// Remove the manifest file, and wait for the mirror pod to be deleted.
os.Remove(manifestFile.Name())
if err = wait.Poll(time.Second, longTestTimeout,
podNotFound(c, namespace, podName)); err != nil {
glog.Fatalf("%s FAILED: mirror pod has not been deleted: %v", desc, err)
}
}()
}
}

func runReplicationControllerTest(c *client.Client) {
t := time.Now()
clientAPIVersion := c.APIVersion().String()
Expand Down

0 comments on commit 28f968a

Please sign in to comment.