Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
8fd8564a
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8fd8564a
编写于
2月 25, 2017
作者:
D
Dan Lorenc
提交者:
dlorenc
2月 27, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add an integration test for pvcs.
上级
9b539db1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
0 deletion
+79
-0
hack/jenkins/common.sh
hack/jenkins/common.sh
+1
-0
test/integration/functional_test.go
test/integration/functional_test.go
+1
-0
test/integration/pv_test.go
test/integration/pv_test.go
+67
-0
test/integration/testdata/pvc.yaml
test/integration/testdata/pvc.yaml
+10
-0
未找到文件。
hack/jenkins/common.sh
浏览文件 @
8fd8564a
...
...
@@ -29,6 +29,7 @@ mkdir -p out/ testdata/
gsutil
cp
gs://minikube-builds/
${
MINIKUBE_LOCATION
}
/minikube-
${
OS_ARCH
}
out/
gsutil
cp
gs://minikube-builds/
${
MINIKUBE_LOCATION
}
/e2e-
${
OS_ARCH
}
out/
gsutil
cp
gs://minikube-builds/
${
MINIKUBE_LOCATION
}
/testdata/busybox.yaml testdata/
gsutil
cp
gs://minikube-builds/
${
MINIKUBE_LOCATION
}
/testdata/pvc.yaml testdata/
# Set the executable bit on the e2e binary and out binary
chmod
+x out/e2e-
${
OS_ARCH
}
...
...
test/integration/functional_test.go
浏览文件 @
8fd8564a
...
...
@@ -40,4 +40,5 @@ func TestFunctional(t *testing.T) {
t
.
Run
(
"Addons"
,
testAddons
)
t
.
Run
(
"Dashboard"
,
testDashboard
)
t
.
Run
(
"ServicesList"
,
testServicesList
)
t
.
Run
(
"Provisioning"
,
testProvisioning
)
}
test/integration/pv_test.go
0 → 100644
浏览文件 @
8fd8564a
// +build integration
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
integration
import
(
"fmt"
"path/filepath"
"testing"
"time"
"k8s.io/kubernetes/pkg/api"
commonutil
"k8s.io/minikube/pkg/util"
"k8s.io/minikube/test/integration/util"
)
var
(
pvcName
=
"testpvc"
pvcCmd
=
[]
string
{
"get"
,
"pvc"
,
pvcName
}
)
func
testProvisioning
(
t
*
testing
.
T
)
{
t
.
Parallel
()
kubectlRunner
:=
util
.
NewKubectlRunner
(
t
)
defer
func
()
{
kubectlRunner
.
RunCommand
([]
string
{
"delete"
,
"pvc"
,
pvcName
})
}()
pvcPath
,
_
:=
filepath
.
Abs
(
"testdata/pvc.yaml"
)
if
_
,
err
:=
kubectlRunner
.
RunCommand
([]
string
{
"create"
,
"-f"
,
pvcPath
});
err
!=
nil
{
t
.
Fatalf
(
"Error creating pvc"
)
}
checkStorage
:=
func
()
error
{
pvc
:=
api
.
PersistentVolumeClaim
{}
if
err
:=
kubectlRunner
.
RunCommandParseOutput
(
pvcCmd
,
&
pvc
);
err
!=
nil
{
return
&
commonutil
.
RetriableError
{
Err
:
err
}
}
// The test passes if the volume claim gets bound.
if
pvc
.
Status
.
Phase
==
"Bound"
{
return
nil
}
return
&
commonutil
.
RetriableError
{
Err
:
fmt
.
Errorf
(
"PV not attached to PVC: %v"
,
pvc
)}
}
if
err
:=
commonutil
.
RetryAfter
(
25
,
checkStorage
,
20
*
time
.
Second
);
err
!=
nil
{
t
.
Fatal
(
"PV Creation failed with error:"
,
err
)
}
}
test/integration/testdata/pvc.yaml
0 → 100644
浏览文件 @
8fd8564a
kind
:
PersistentVolumeClaim
apiVersion
:
v1
metadata
:
name
:
testpvc
spec
:
accessModes
:
-
ReadWriteOnce
resources
:
requests
:
storage
:
2Gi
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录