|
|
@ -29,19 +29,21 @@ import (
|
|
|
|
var testName = "test-name"
|
|
|
|
var testName = "test-name"
|
|
|
|
|
|
|
|
|
|
|
|
func TestRepoAddCmd(t *testing.T) {
|
|
|
|
func TestRepoAddCmd(t *testing.T) {
|
|
|
|
srv := repotest.NewServer("testdata/testserver")
|
|
|
|
srv, thome, err := repotest.NewTempServer("testdata/testserver/*.*")
|
|
|
|
defer srv.Stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thome, err := tempHelmHome(t)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
oldhome := homePath()
|
|
|
|
oldhome := homePath()
|
|
|
|
helmHome = thome
|
|
|
|
helmHome = thome
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
srv.Stop()
|
|
|
|
helmHome = oldhome
|
|
|
|
helmHome = oldhome
|
|
|
|
os.Remove(thome)
|
|
|
|
os.Remove(thome)
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
if err := ensureTestHome(helmpath.Home(thome), t); err != nil {
|
|
|
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tests := []releaseCase{
|
|
|
|
tests := []releaseCase{
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -61,15 +63,22 @@ func TestRepoAddCmd(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestRepoAdd(t *testing.T) {
|
|
|
|
func TestRepoAdd(t *testing.T) {
|
|
|
|
ts := repotest.NewServer("testdata/testserver")
|
|
|
|
ts, thome, err := repotest.NewTempServer("testdata/testserver/*.*")
|
|
|
|
defer ts.Stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thome, err := tempHelmHome(t)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defer os.Remove(thome)
|
|
|
|
|
|
|
|
|
|
|
|
oldhome := homePath()
|
|
|
|
|
|
|
|
helmHome = thome
|
|
|
|
hh := helmpath.Home(thome)
|
|
|
|
hh := helmpath.Home(thome)
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
ts.Stop()
|
|
|
|
|
|
|
|
helmHome = oldhome
|
|
|
|
|
|
|
|
os.Remove(thome)
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
if err := ensureTestHome(hh, t); err != nil {
|
|
|
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := addRepository(testName, ts.URL(), hh); err != nil {
|
|
|
|
if err := addRepository(testName, ts.URL(), hh); err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
t.Error(err)
|
|
|
|