Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
8a651ba6
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,发现更多精彩内容 >>
提交
8a651ba6
编写于
2月 12, 2021
作者:
I
Ilya Zuyev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add .deb installation tests
上级
ee6283ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
172 addition
and
2 deletion
+172
-2
.github/workflows/pr.yml
.github/workflows/pr.yml
+1
-2
Makefile
Makefile
+7
-0
hack/jenkins/minikube_deb_install_test.sh
hack/jenkins/minikube_deb_install_test.sh
+57
-0
test/integration/pkg_install_test.go
test/integration/pkg_install_test.go
+107
-0
未找到文件。
.github/workflows/pr.yml
浏览文件 @
8a651ba6
...
@@ -25,8 +25,7 @@ jobs:
...
@@ -25,8 +25,7 @@ jobs:
run
:
go mod download
run
:
go mod download
-
name
:
Build Binaries
-
name
:
Build Binaries
run
:
|
run
:
|
make cross
make cross e2e-cross debs
make e2e-cross
cp -r test/integration/testdata ./out
cp -r test/integration/testdata ./out
whoami
whoami
echo github ref $GITHUB_REF
echo github ref $GITHUB_REF
...
...
Makefile
浏览文件 @
8a651ba6
...
@@ -487,6 +487,13 @@ verify-iso: # Make sure the current ISO exists in the expected bucket
...
@@ -487,6 +487,13 @@ verify-iso: # Make sure the current ISO exists in the expected bucket
out/docs/minikube.md
:
$(shell find "cmd") $(shell find "pkg/minikube/constants") $(SOURCE_GENERATED)
out/docs/minikube.md
:
$(shell find "cmd") $(shell find "pkg/minikube/constants") $(SOURCE_GENERATED)
go run
-ldflags
=
"
$(MINIKUBE_LDFLAGS)
"
-tags
gendocs hack/help_text/gen_help_text.go
go run
-ldflags
=
"
$(MINIKUBE_LDFLAGS)
"
-tags
gendocs hack/help_text/gen_help_text.go
.PHONY
:
debs
debs
:
out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_amd64.deb
\
out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_arm64.deb
\
out/docker-machine-driver-kvm2_$(DEB_VERSION).deb
.PHONY
:
deb_version
.PHONY
:
deb_version
deb_version
:
deb_version
:
@
echo
$(DEB_VERSION)
-
$(DEB_REVISION)
@
echo
$(DEB_VERSION)
-
$(DEB_REVISION)
...
...
hack/jenkins/minikube_deb_install_test.sh
0 → 100755
浏览文件 @
8a651ba6
#!/bin/bash
# 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.
# This script builds the minikube binary for all 3 platforms and uploads them.
# This is to done as part of the CI tests for Github PRs
# The script expects the following env variables:
# bucket: The GCP bucket to get .deb files from
# debs: .deb packages to test
set
-eu
-o
pipefail
trap exit
SIGINT
for
pkg
in
${
debs
[@]
}
;
do
gsutil
cp
-r
"gs://
${
bucket
}
/
${
pkg
}
.deb"
.
done
declare
-ra
distros
=(
\
debian:sid
\
debian:latest
\
debian:buster
\
debian:stretch
\
ubuntu:latest
\
ubuntu:20.10
\
ubuntu:20.04
\
ubuntu:19.10
\
ubuntu:19.04
\
ubuntu:18.10
\
ubuntu:18.04
)
for
distro
in
"
${
distros
[@]
}
"
;
do
for
pkg
in
${
debs
[@]
}
;
do
echo
"=============================================================="
printf
"Install %s on %s
\n
"
"
${
pkg
}
"
"
${
distro
}
"
echo
"=============================================================="
docker run
--rm
-v
"
$PWD
:/var/tmp"
"
${
distro
}
"
sh
-c
"apt-get update;
\
(dpkg -i /var/tmp/
${
pkg
}
||
(apt-get -fy install && dpkg -i /var/tmp/
${
pkg
}
))
|| echo "
Failed to
install
${
pkg
}
.deb on
${
distro
}
"
done
done
test/integration/pkg_install_test.go
0 → 100644
浏览文件 @
8a651ba6
// 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
(
"context"
"fmt"
"os/exec"
"path/filepath"
"runtime"
"testing"
)
var
distros
=
[]
string
{
"debian:sid"
,
"debian:latest"
,
"debian:10"
,
"debian:9"
,
//
"ubuntu:latest"
,
"ubuntu:20.10"
,
"ubuntu:20.04"
,
"ubuntu:19.10"
,
"ubuntu:19.04"
,
}
var
timeout
=
Minutes
(
10
)
// TestPackageInstall tests installation of .deb packages with minikube itself and with kvm2 driver
// on debian/ubuntu docker images enumerated in "distros"
func
TestDebPackageInstall
(
t
*
testing
.
T
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
defer
cancel
()
pkgDir
,
err
:=
filepath
.
Abs
(
filepath
.
Dir
(
Target
()))
if
err
!=
nil
{
t
.
Errorf
(
"failed to get minikube path: %e"
,
err
)
}
mkDebs
,
err
:=
filepath
.
Glob
(
fmt
.
Sprintf
(
"%s/minikube_*_%s.deb"
,
pkgDir
,
"amd64"
))
if
err
!=
nil
{
t
.
Errorf
(
"failed to find minikube deb in %q: %e"
,
pkgDir
,
err
)
}
kvmDebs
,
err
:=
filepath
.
Glob
(
fmt
.
Sprintf
(
"%s/docker-machine-driver-kvm2_*_%s.deb"
,
pkgDir
,
runtime
.
GOARCH
))
if
err
!=
nil
{
t
.
Errorf
(
"failed to find minikube deb in %q: %e"
,
pkgDir
,
err
)
}
for
_
,
distro
:=
range
distros
{
distroImg
:=
distro
t
.
Run
(
"installMinikube_"
+
distroImg
,
func
(
t
*
testing
.
T
)
{
// apt-get update; dpkg -i minikube_${ver}_${arch}.deb
t
.
Run
(
"minikube"
,
func
(
t
*
testing
.
T
)
{
for
_
,
mkDeb
:=
range
mkDebs
{
rr
,
err
:=
dpkgInstall
(
ctx
,
t
,
distro
,
mkDeb
)
if
err
!=
nil
||
rr
.
ExitCode
!=
0
{
t
.
Errorf
(
"failed to install %q on %q: err=%e, exit=%d"
,
mkDeb
,
distroImg
,
err
,
rr
.
ExitCode
)
}
}
})
// apt-get update; apt-get install -y libvirt0; dpkg -i docker-machine-driver-kvm2_${ver}_${arch}.deb
t
.
Run
(
"kvm2-driver"
,
func
(
t
*
testing
.
T
)
{
for
_
,
kvmDeb
:=
range
kvmDebs
{
rr
,
err
:=
dpkgInstallDriver
(
ctx
,
t
,
distro
,
kvmDeb
)
if
err
!=
nil
||
rr
.
ExitCode
!=
0
{
t
.
Errorf
(
"failed to install %q on %q: err=%e, exit=%d"
,
kvmDeb
,
distroImg
,
err
,
rr
.
ExitCode
)
}
}
})
})
}
}
func
dpkgInstall
(
ctx
context
.
Context
,
t
*
testing
.
T
,
image
,
deb
string
)
(
*
RunResult
,
error
)
{
return
Run
(
t
,
exec
.
CommandContext
(
ctx
,
"docker"
,
"run"
,
"--rm"
,
fmt
.
Sprintf
(
"-v%s:/var/tmp"
,
filepath
.
Dir
(
deb
)),
image
,
"sh"
,
"-c"
,
fmt
.
Sprintf
(
"apt-get update; dpkg -i /var/tmp/%s"
,
filepath
.
Base
(
deb
))))
}
func
dpkgInstallDriver
(
ctx
context
.
Context
,
t
*
testing
.
T
,
image
,
deb
string
)
(
*
RunResult
,
error
)
{
return
Run
(
t
,
exec
.
CommandContext
(
ctx
,
"docker"
,
"run"
,
"--rm"
,
fmt
.
Sprintf
(
"-v%s:/var/tmp"
,
filepath
.
Dir
(
deb
)),
image
,
"sh"
,
"-c"
,
fmt
.
Sprintf
(
"apt-get update; apt-get install -y libvirt0; dpkg -i /var/tmp/%s"
,
filepath
.
Base
(
deb
))))
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录