mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Support differentiation of OS distro in e2e tests
This commit is contained in:
parent
01b662af60
commit
364ac85179
@ -219,8 +219,11 @@ script
|
|||||||
export TOKEN_DIR="/etc/srv/kubernetes"
|
export TOKEN_DIR="/etc/srv/kubernetes"
|
||||||
export kubelet_kubeconfig_file="/var/lib/kubelet/kubeconfig"
|
export kubelet_kubeconfig_file="/var/lib/kubelet/kubeconfig"
|
||||||
export TRUSTY_MASTER="true"
|
export TRUSTY_MASTER="true"
|
||||||
|
if [ -n "${TEST_ADDON_CHECK_INTERVAL_SEC:-}" ]; then
|
||||||
|
export TEST_ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC}
|
||||||
|
fi
|
||||||
# Run the script to start and monitoring addon manifest changes.
|
# Run the script to start and monitoring addon manifest changes.
|
||||||
exec /var/lib/cloud/scripts/kubernetes/kube-addons.sh
|
exec /var/lib/cloud/scripts/kubernetes/kube-addons.sh 1>>/var/log/kube-addons.log 2>&1
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Wait for 10s to start it again.
|
# Wait for 10s to start it again.
|
||||||
|
@ -102,6 +102,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
|
|||||||
--repo-root="${KUBE_ROOT}" \
|
--repo-root="${KUBE_ROOT}" \
|
||||||
--node-instance-group="${NODE_INSTANCE_GROUP:-}" \
|
--node-instance-group="${NODE_INSTANCE_GROUP:-}" \
|
||||||
--prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \
|
--prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \
|
||||||
|
${KUBE_OS_DISTRIBUTION:+"--os-distro=${KUBE_OS_DISTRIBUTION}"} \
|
||||||
${NUM_NODES:+"--num-nodes=${NUM_NODES}"} \
|
${NUM_NODES:+"--num-nodes=${NUM_NODES}"} \
|
||||||
${E2E_CLEAN_START:+"--clean-start=true"} \
|
${E2E_CLEAN_START:+"--clean-start=true"} \
|
||||||
${E2E_MIN_STARTUP_PODS:+"--minStartupPods=${E2E_MIN_STARTUP_PODS}"} \
|
${E2E_MIN_STARTUP_PODS:+"--minStartupPods=${E2E_MIN_STARTUP_PODS}"} \
|
||||||
|
@ -284,6 +284,7 @@ oidc-issuer-url
|
|||||||
oidc-username-claim
|
oidc-username-claim
|
||||||
only-idl
|
only-idl
|
||||||
oom-score-adj
|
oom-score-adj
|
||||||
|
os-distro
|
||||||
out-version
|
out-version
|
||||||
outofdisk-transition-frequency
|
outofdisk-transition-frequency
|
||||||
output-base
|
output-base
|
||||||
|
@ -210,13 +210,27 @@ var _ = KubeDescribe("Addon update", func() {
|
|||||||
// Reduce the addon update intervals so that we have faster response
|
// Reduce the addon update intervals so that we have faster response
|
||||||
// to changes in the addon directory.
|
// to changes in the addon directory.
|
||||||
// do not use "service" command because it clears the environment variables
|
// do not use "service" command because it clears the environment variables
|
||||||
|
switch testContext.OSDistro {
|
||||||
|
case "debian":
|
||||||
sshExecAndVerify(sshClient, "sudo TEST_ADDON_CHECK_INTERVAL_SEC=1 /etc/init.d/kube-addons restart")
|
sshExecAndVerify(sshClient, "sudo TEST_ADDON_CHECK_INTERVAL_SEC=1 /etc/init.d/kube-addons restart")
|
||||||
|
case "trusty":
|
||||||
|
sshExecAndVerify(sshClient, "sudo initctl restart kube-addons TEST_ADDON_CHECK_INTERVAL_SEC=1")
|
||||||
|
default:
|
||||||
|
Failf("Unsupported OS distro type %s", testContext.OSDistro)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
if sshClient != nil {
|
if sshClient != nil {
|
||||||
// restart addon_update with the default options
|
// restart addon_update with the default options
|
||||||
|
switch testContext.OSDistro {
|
||||||
|
case "debian":
|
||||||
sshExec(sshClient, "sudo /etc/init.d/kube-addons restart")
|
sshExec(sshClient, "sudo /etc/init.d/kube-addons restart")
|
||||||
|
case "trusty":
|
||||||
|
sshExec(sshClient, "sudo initctl restart kube-addons")
|
||||||
|
default:
|
||||||
|
Failf("Unsupported OS distro type %s", testContext.OSDistro)
|
||||||
|
}
|
||||||
sshClient.Close()
|
sshClient.Close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -72,6 +72,7 @@ func RegisterFlags() {
|
|||||||
flag.StringVar(&testContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.")
|
flag.StringVar(&testContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.")
|
||||||
flag.StringVar(&testContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
|
flag.StringVar(&testContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
|
||||||
flag.StringVar(&testContext.prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
|
flag.StringVar(&testContext.prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")
|
||||||
|
flag.StringVar(&testContext.OSDistro, "os-distro", "debian", "The OS distribution of cluster VM instances (debian, trusty, or coreos).")
|
||||||
|
|
||||||
// TODO: Flags per provider? Rename gce-project/gce-zone?
|
// TODO: Flags per provider? Rename gce-project/gce-zone?
|
||||||
flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke")
|
flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke")
|
||||||
|
@ -190,6 +190,7 @@ type TestContextType struct {
|
|||||||
MinStartupPods int
|
MinStartupPods int
|
||||||
UpgradeTarget string
|
UpgradeTarget string
|
||||||
PrometheusPushGateway string
|
PrometheusPushGateway string
|
||||||
|
OSDistro string
|
||||||
VerifyServiceAccount bool
|
VerifyServiceAccount bool
|
||||||
DeleteNamespace bool
|
DeleteNamespace bool
|
||||||
CleanStart bool
|
CleanStart bool
|
||||||
|
Loading…
Reference in New Issue
Block a user