Commit cef9edcd authored by Jon Cope's avatar Jon Cope

Extract volume test utils into framework.

Moved remaining util functions moved cinder specific function back to volumes.go, will have to be extracted later when a cinder e2e package is created. remove dupe code from common/volume.go Moved [Volume] tags to KubeDescribe
parent 879f8e0c
......@@ -51,7 +51,6 @@ go_library(
"//vendor:github.com/onsi/ginkgo",
"//vendor:github.com/onsi/gomega",
"//vendor:golang.org/x/net/websocket",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/api/resource",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/fields",
......
......@@ -35,6 +35,7 @@ go_library(
"test_context.go",
"upgrade_util.go",
"util.go",
"volume_util.go",
],
tags = ["automanaged"],
deps = [
......
......@@ -134,9 +134,9 @@ func updateNodeLabels(c clientset.Interface, nodeNames sets.String, toAdd, toRem
// ip address.
// Note: startVolumeServer() waits for the nfs-server pod to be Running and sleeps some
// so that the nfs server can start up.
func createNfsServerPod(c clientset.Interface, config VolumeTestConfig) (*v1.Pod, string) {
func createNfsServerPod(c clientset.Interface, config framework.VolumeTestConfig) (*v1.Pod, string) {
pod := startVolumeServer(c, config)
pod := framework.StartVolumeServer(c, config)
Expect(pod).NotTo(BeNil())
ip := pod.Status.PodIP
Expect(len(ip)).NotTo(BeZero())
......@@ -387,7 +387,7 @@ var _ = framework.KubeDescribe("kubelet", func() {
var (
nfsServerPod *v1.Pod
nfsIP string
NFSconfig VolumeTestConfig
NFSconfig framework.VolumeTestConfig
pod *v1.Pod // client pod
)
......@@ -404,12 +404,12 @@ var _ = framework.KubeDescribe("kubelet", func() {
}
BeforeEach(func() {
NFSconfig = VolumeTestConfig{
namespace: ns,
prefix: "nfs",
serverImage: NfsServerImage,
serverPorts: []int{2049},
serverArgs: []string{"-G", "777", "/exports"},
NFSconfig = framework.VolumeTestConfig{
Namespace: ns,
Prefix: "nfs",
ServerImage: framework.NfsServerImage,
ServerPorts: []int{2049},
ServerArgs: []string{"-G", "777", "/exports"},
}
nfsServerPod, nfsIP = createNfsServerPod(c, NFSconfig)
})
......
......@@ -14,10 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This test references
// persistent_volumes.go
// volumes.go
package e2e
import (
......
......@@ -77,12 +77,12 @@ func completeMultiTest(f *framework.Framework, c clientset.Interface, ns string,
// initNFSserverPod wraps volumes.go's startVolumeServer to return a running nfs host pod
// commonly used by persistent volume testing
func initNFSserverPod(c clientset.Interface, ns string) *v1.Pod {
return startVolumeServer(c, VolumeTestConfig{
namespace: ns,
prefix: "nfs",
serverImage: NfsServerImage,
serverPorts: []int{2049},
serverArgs: []string{"-G", "777", "/exports"},
return framework.StartVolumeServer(c, framework.VolumeTestConfig{
Namespace: ns,
Prefix: "nfs",
ServerImage: framework.NfsServerImage,
ServerPorts: []int{2049},
ServerArgs: []string{"-G", "777", "/exports"},
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment