pull/4955/head
Christopher A. Stelma 7 years ago
parent 48a9c92d7c
commit c4f91cb949

@ -22,6 +22,7 @@ import (
"testing" "testing"
"k8s.io/helm/pkg/helm/helmpath" "k8s.io/helm/pkg/helm/helmpath"
"k8s.io/helm/pkg/repo"
) )
func TestEnsureHome(t *testing.T) { func TestEnsureHome(t *testing.T) {
@ -42,6 +43,35 @@ func TestEnsureHome(t *testing.T) {
t.Error(err) t.Error(err)
} }
rr, err := repo.LoadRepositoriesFile(hh.RepositoryFile())
if err != nil {
t.Error(err)
}
foundStable := false
for _, rr := range rr.Repositories {
if rr.Name == stableRepository {
foundStable = true
if err != nil {
t.Error(err)
}
if !filepath.IsAbs(rr.Cache) {
t.Errorf("%s stable repo cache path is an absolute path", rr.Cache)
}
absCache, err := filepath.Abs(filepath.Join(hh.Cache(), rr.Cache))
if err != nil {
t.Error(err)
}
if absCache != hh.CacheIndex(stableRepository) {
t.Errorf("%s stable repo cache path doesn't resolve to absolute cache index path", rr.Cache)
}
break
}
}
if !foundStable {
t.Errorf("stable repo not found")
}
expectedDirs := []string{hh.String(), hh.Repository(), hh.Cache()} expectedDirs := []string{hh.String(), hh.Repository(), hh.Cache()}
for _, dir := range expectedDirs { for _, dir := range expectedDirs {
if fi, err := os.Stat(dir); err != nil { if fi, err := os.Stat(dir); err != nil {

Loading…
Cancel
Save