skip cache imge test for none
parent
b3c9eea3d8
commit
8796539112
|
@ -44,31 +44,36 @@ func TestDownloadOnly(t *testing.T) {
|
||||||
if !isTestNoneDriver(t) { // none driver doesnt need to be deleted
|
if !isTestNoneDriver(t) { // none driver doesnt need to be deleted
|
||||||
defer mk.TearDown(t)
|
defer mk.TearDown(t)
|
||||||
}
|
}
|
||||||
|
t.Run("group", func(t *testing.T) {
|
||||||
t.Run("OldestNewest", func(t *testing.T) {
|
t.Run("CacheOldestNewest", func(t *testing.T) {
|
||||||
minHome := constants.GetMinipath()
|
if !isTestNoneDriver(t) { // don't cache images
|
||||||
for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} {
|
t.Skip("skipping test for none driver as it doesn't cache images")
|
||||||
mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v))
|
|
||||||
// checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...)
|
|
||||||
_, imgs := constants.GetKubeadmCachedImages("", v)
|
|
||||||
for _, img := range imgs {
|
|
||||||
img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2
|
|
||||||
fp := filepath.Join(minHome, "cache", "images", img)
|
|
||||||
_, err := os.Stat(fp)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("expected image file exist at %q but got error: %v", fp, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// checking binaries downloaded (kubelet,kubeadm)
|
minHome := constants.GetMinipath()
|
||||||
for _, bin := range constants.GetKubeadmCachedBinaries() {
|
for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} {
|
||||||
fp := filepath.Join(minHome, "cache", v, bin)
|
mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v))
|
||||||
_, err := os.Stat(fp)
|
// checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...)
|
||||||
if err != nil {
|
_, imgs := constants.GetKubeadmCachedImages("", v)
|
||||||
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
|
for _, img := range imgs {
|
||||||
|
img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2
|
||||||
|
fp := filepath.Join(minHome, "cache", "images", img)
|
||||||
|
_, err := os.Stat(fp)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("expected image file exist at %q but got error: %v", fp, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// checking binaries downloaded (kubelet,kubeadm)
|
||||||
|
for _, bin := range constants.GetKubeadmCachedBinaries() {
|
||||||
|
fp := filepath.Join(minHome, "cache", v, bin)
|
||||||
|
_, err := os.Stat(fp)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// this downloads the latest published binary from where we publish the minikube binary
|
// this downloads the latest published binary from where we publish the minikube binary
|
||||||
|
|
Loading…
Reference in New Issue